This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Optionally emit SSE ABI libm calls on x86
- From: Richard Guenther <rguenther at suse dot de>
- To: Uros Bizjak <uros at kss-loka dot si>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 8 Jul 2005 09:31:17 +0200 (CEST)
- Subject: Re: [PATCH] Optionally emit SSE ABI libm calls on x86
- References: <42CD8A16.6020905@kss-loka.si>
On Thu, 7 Jul 2005, Uros Bizjak wrote:
> Hello Richard!
>
> > + if (ix86_fpmath == FPMATH_SSE
> > + && TARGET_SSE2 && TARGET_SSELIBM)
> > + {
> > + patch_sse_builtin (BUILT_IN_ACOS, "__libm_sse2_acos");
> > + patch_sse_builtin (BUILT_IN_ACOSF, "__libm_sse2_acosf");
> > + patch_sse_builtin (BUILT_IN_ASIN, "__libm_sse2_asin");
> > + patch_sse_builtin (BUILT_IN_ASINF, "__libm_sse2_asinf");
> >
> It is interesting that float versions of functions depend on SSE2. Out of
> curiosity, Is there a reason that float functions can't be implemented in pure
> SSE (not SSE2) code? This kind of library could then be used also on pentium3.
It may be possible. Though I was following precedent set by the Intel
compiler which uses, f.i. in __libm_sse2_sinf:
00000000 <__libm_sse2_sinf>:
0: f3 0f 10 c8 movss %xmm0,%xmm1
4: 66 0f 7e c1 movd %xmm0,%ecx
8: 0f 5a c9 cvtps2pd %xmm1,%xmm1
b: f2 0f 10 15 40 05 00 movsd 0x540,%xmm2
...
i.e. it uses SSE2 for implementing the float sin function.
I honestly doubt it is worth the trouble - my evil plan is to share
the actual implementation between x86_64 and i386 anyway... and as
Uli just made the possibility of sticking these into libm vanish, I
hope to do even more interesting things inside libgcc then.
Richard.