9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] 6c CMP reg, $0 optimization
@ 2014-03-29  3:56 cinap_lenrek
  2014-03-29  4:00 ` erik quanstrom
  2014-03-29  4:12 ` Charles Forsyth
  0 siblings, 2 replies; 5+ messages in thread
From: cinap_lenrek @ 2014-03-29  3:56 UTC (permalink / raw)
  To: 9fans

i changed the compiler to remove unneeded compare with
zero instructions when the previous instruction already
sets the zero flag in the peephole optimizaiton pass.

http://felloff.net/usr/cinap_lenrek/6cpeep.diff

this removes compares for zero/non zero tests only.
it only looks at the previous non-nop instruction
to see if it sets our compare value register.

it seems to work fine so far. our pc64 kernel got
arround 8K smaller, ghostscript got 5K smaller.

i'm not a compiler expert tho, so i'd like to hear if
there are any issues with this approach or if there are
better ways to do this.

--
cinap



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-03-29  4:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-29  3:56 [9fans] 6c CMP reg, $0 optimization cinap_lenrek
2014-03-29  4:00 ` erik quanstrom
2014-03-29  4:06   ` cinap_lenrek
2014-03-29  4:12     ` erik quanstrom
2014-03-29  4:12 ` Charles Forsyth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).