Hi everyone,

I'm playing around with a peephole optimization (back to my roots!) and I've come across a relatively simple one that aims to reduce instruction size occasionally.  One part involves reducing the opsize if the constant is numeric.  For example:

testl    $17,76(%rcx) -> testb $17,76(%rcx)

Or:

testl    $1,%ebx -> testb    $1,%bl

Obviously I check to make sure the constant fits into the smaller size.  Is there a time when this is NOT recommended?  I'm trying to remember issues with partial register or memory writes, but in this case, it's just a partial read.

Gareth aka. Kit


--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to