PATCH: Enable TFmode for SSE2

Uros Bizjak ubizjak@gmail.com
Fri Jun 27 14:23:00 GMT 2008


On Fri, Jun 27, 2008 at 4:10 PM, H.J. Lu <hjl.tools@gmail.com> wrote:

>>> There is no run-time __foat128 support for Linux/x86-64 and __float128 is
>>> enabled.  I am enclosing the BoF slides at gcc summit 2008. It covers
>>> __float128. __float128 on ia32 is the same as __float128 on x86-64.
>>> That is there is __float128 psABI without run-time support. We are planning
>>> to  provide complete run-time __float128 support in a separate library for
>>> both ia32 and x86-64. We may use soft-fp if needed.
>>
>> There is basic run-time support for __float128, i.e.: __float128 foo
>> (__float128 a, __float128 b) { return a+b; } works. However, there is
>> no libm support, so there is no i.e. __float128 sinq (__float128 x)
>> and similar IEEE quad functions. I have a half-finished patch that
>> converts glibc's libm to quad functions (so the test programs can link
>> sinq(x) to achieve 128 bit accuracy) but it was never finished mainly
>> due to libgcc-math troubles.
>>
>>>>> The tricky part is, that soft-fp has to be compiled with -msse2 if
>>>>> __float128 are to be passed through xmm registers. You will need to
>>>>> tell libgcc build machinery that some source files (soft-fp/) need
>>>>> different compile flags than the rest of libgcc sources.
>>
>>>
>>> __float128 is passed on stack as specified in out presentation.
>>>
>> Thanks for clarifying. FYI, to enable basic SFP functions for x86_32,
>> Please look at [1] how sfp-machine.h should be defined.
>>
>> [1] http://sourceware.org/cgi-bin/cvsweb.cgi/~checkout~/libc/sysdeps/i386/soft-fp/Attic/sfp-machine.h?rev=1.2&content-type=text/plain&cvsroot=glibc
>>
>
> Last time when I tried, soft-fp didn't support __float128 for ia32
> since it needs TImode. Has it been changed? In any case, we
> are planning to provide complete run-time __float128 support for
> both ia32 and x86-64. Our implementation will be optimized for
> x86 and may not use soft-fp. But I need to enable __float128 first.

TImode was never a requirement for SFP. It was required only by
t-fprules-softfp64, so we can convert 128bit FP to 128bit integer on
x86_64. x86_32 should define its own t-fprules-softfp32, where TImode
is omitted.

Uros.



More information about the Gcc-patches mailing list