|
From: | Pavel Roskin |
Subject: | Re: Endianness macros capitalization |
Date: | Thu, 10 Jul 2008 15:59:14 -0400 |
User-agent: | Internet Messaging Program (IMP) H3 (4.1.4) |
Quoting Christian Franke <address@hidden>:
GCC optimizer does a good job optimizing register use, but function call is still better: Debian gcc 4.1.2-7: inline (portable)=357,asm (%%eax)=126, asm (%0)=107, function=104 Cygwin gcc 3.4.4: inline (portable)=340, asm (%%eax)=124, asm (%0)=104, function=96
Thank you for testing! We could do better with the bswap instruction, but it appeared in 486. I think we still need to support 386.
I understand you are counting the function body, so the calling/inlining code is bigger by more than just 3 or 8 bytes. If the code grows, so will the number of the calls or the inline sites. Yet the function size will remain the same.
Chances are that if we use 3 "rol"s and allow all general purpose registers, we may save a couple more bytes, because the assembler will still convert rol to xchg when possible, whereas gcc will be able to use non-e*x registers if needed.
But I don't want to ask you to spend any more time on it. I think we'll have to go with the function for 32 bit.
-- Regards, Pavel Roskin
[Prev in Thread] | Current Thread | [Next in Thread] |