[PATCH, x86_64]: Provide longlong.h definitions for 128bit operations

Uros Bizjak ubizjak@gmail.com
Fri May 18 10:23:00 GMT 2007


On 5/17/07, Eric Christopher <echristo@apple.com> wrote:

> > Inline asm really is bad.  It's much better to fix the compiler so
> > that users don't have to rely on it to get performance.
>
> Agreed, Ian's patches that take advantage of lower-subreg for x86 help
> this quite a bit. He's waiting AFAIK on the df branch to finish them
> up, but from what I recall they helped this particular case.

OK, I agree with that. However, I'd like too propose the path to this
final solution:

- for now, we implement asm solution, as it optimizes library code
_now_ and follows what master copy of longlong.h does. Also, there is
no simple solution for 128bit "mul" and "div" insns, which are of most
interest here.
- an enhancement PR is opened with the comments from this thread (also
linking to Ian's follow-on patch), so we won't forget this issue.
- once the generated code is equal or better then asm, we change
longlong.h, probably for both, i386 and x86_64.

My opinion is that asm solution is currently "good enough" for current
uses (libgcc)  and code inspection confirms this. It is not "the best
solution" but it is definitelly better than current state. For the
record, 3 "imul" insns are substituted by just one "mul" insns.

Uros.



More information about the Gcc-patches mailing list