This is the mail archive of the
mailing list for the GCC project.
RE: [RFC PATCH, x86_64] Use -mno-sse[,2] to fall back to x87 FP argument passing convention
- From: "Menezes, Evandro" <evandro dot menezes at amd dot com>
- To: "Uros Bizjak" <ubizjak at gmail dot com>, "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 9 Oct 2006 15:10:31 -0500
- Subject: RE: [RFC PATCH, x86_64] Use -mno-sse[,2] to fall back to x87 FP argument passing convention
> I would like to present a kind of x86_64 ABI enhancement for FP types,
> where argument passing convention would follow x87 argument passing
Honza has already chimed in that such idea would be better implemented much in the way of the sseregparm attribute.
> where patched gcc -O2 -mno-sse [-mfpmath=387] would produce:
> subq $24, %rsp
> movabsq $4611686018427387904, %rax
> movq %rax, 8(%rsp)
> movq 32(%rsp), %rax
> movq %rax, (%rsp)
> call atan2
> fmuls .LC1(%rip)
> addq $24, %rsp
Woa! Which atan2 () on x86-64 returns anything on %st? Please, let's not go down the multilib route for this...
> But the real gain will be using -O2 -mno-sse [-mfpmath=387]
> -ffast-math where x87 builtins will be emitted:
> flds .LC0(%rip)
> fldl 8(%rsp)
> fxch %st(1)
> fmuls .LC1(%rip)
Better??? x87's FPATAN is quite innacturate.
> I think that this would be a nice extension in comparison to an error
> that is currently emmited for -mno-sse. Please note, that complex
> numbers and decimal FP are not supported by attached patch.
I think that all this comes from the fact that the current GLIBC math transcendentals are generally inferior to x87. I tried to correct that by offering other faster, more accurate routines, but their acceptance was stalled.
IMHO, such hurdles will be addressed by Richard Guenther's libgcc-math project for 4.3. As I stated at the BOFS on it, I am ready to donate such routines and then we can revisit this issue, if it still stands.
Evandro Menezes AMD Austin, TX