This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch cygwin]: Replace inline-assembler in string.h by C implementation


On 24/10/2012 5:16 AM, Kai Tietz wrote:
Hello,

this patch replaces the inline-assember used in string.h by C implementation.
There are three reasons why I want to suggest this.  First, the C-code might
be optimized further by fixed (constant) arguments.  Secondly, it is
architecture
independent and so we just need to maintain on code-path.  And as
third point, by
inspecting generated assembly code produced by compiler out of C code
vs. inline-assembler
it shows that compiler produces better code.  It handles
jump-threading better, and also
improves average executed instructions.
Devil's advocate: better-looking code isn't always faster code.

However, I'm surprised that code was inline asm in the first place -- no special instructions or unusual control flow -- and would not be at all surprised if the compiler does a better job.

Also, the portability issue is relevant now that cygwin is starting the move toward 64-bit support.

$0.02
Ryan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]