[fpc-devel] x86_64 question

J. Gareth Moreton gareth at moreton-family.com
Thu Oct 1 19:17:47 CEST 2020


Hi everyone,

I have a small question with assembler size optimisation that maybe one 
of you guys can give me a second opinion on:

If you are using the "test" instruction to test some of the lower bits 
of an instruction, e.g. TEST RCX, $2, is there a penalty with calling 
TEST CL, $2 instead? The instruction size is a lot smaller on account of 
the immediate only being 1 byte long instead of 4 bytes, and are 
mathematically equivalent.  I know you have to be careful with partial 
write penalties, but partial reads seem to be a bit more nebulous (the 
register is not modified with TEST).

Gareth aka. Kit


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



More information about the fpc-devel mailing list