just looking how fpc optimize this function compared with how gcc doesgcc seems smarter, it reduce it to one instruction while fpc didn't noticed it require only one instructionboth codes compiled with -O3
By the way, this is assembler code for System.SwapEndian(X)Code: ASM [Select][+][-]; SYSTEM_$$_SWAPENDIAN$LONGWORD$$LONGWORD mov %ecx,%eaxbswap %eaxretq
what version do you have ? i am using 3.0.4 32bits ,and this is the asm of this function