[fpc-devel] x86_64.inc CompareByte

Markus Beth markus.beth at zkrd.de
Sun Oct 1 00:24:16 CEST 2017


It did some changes to CompareByte in rtl/x86_64/x86_64.inc to reduce 
the code size and make it run faster (see attached path). I was 
successful with the code size deduction (47 bytes vs. 62 bytes) and also 
with the speed (according to a micro benchmark [1] run on an Ivy Bridge 
desktop).

To achieve this I used movzbl twice. But then I came across the comment 
in FillChar (also in rtl/x86_64/x86_64.inc) about movzbl breaking 
targets using external GAS (Mantis #19188). As this Mantis issue is 
dated back in 2011 my question is: Is this still valid? And what would 
be the preferred way to overcome this issue?
{$ifdef oldbinutils}
    .byte 0x0F,0xb6,0x01
{$else}
    movzbl (%rcx),%eax
{$endif}


Markus

[1] the benchmark compares a 10 MB memory block with itself 10000 times
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x86_64_comparebyte.patch
Type: text/x-patch
Size: 845 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20171001/ef2b21ef/attachment.bin>


More information about the fpc-devel mailing list