This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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, x86_64]: Use soft-fp for TFmode (128bit) FP.


On 4/12/07, Joseph S. Myers <joseph@codesourcery.com> wrote:

> This patch implements TFmode (128bit) floating point by using soft-fp for
> x86_64 targets. To support TImode FP-int conversions, a bunch of support files
> is added to soft-fp directory (+ a couple of small bugfixes, as can be seen in
> attached soft-fp diff).

The changes to existing soft-fp files certainly need to go in FSF glibc
first.

OK, I'll post the diff in glibc mailinglist.


Is there any particular reason you didn't include conversions to/from
XFmode (apart from my notes at
<http://gcc.gnu.org/wiki/Software_floating_point> that you'd need some
changes to the core soft-fp conversion macros to handle conversions
between types with same normal exponent range but different mantissa
size)?  What happens with such conversions with this patch?

This patch doesn't include XFmode conversions yet, but I was playing with following functions (that should be part of libgcc2):

--cut here--
__float80 __trunctfxf2 (__float128 x)
{
 union {__float128 f128; __float80 f80; } __u;
 __u.f128 = x;
 return __u.f80;
}

__float128 __extendxftf2 (__float80 x)
{
 union {__float80 f80; __float128 f128; int z[4]; } __u;
 __u.z[3] = 0;
 __u.f80 = x;
 return __u.f128;
}
--cut here--

If possible I'd say you should define FP_INIT_ROUNDMODE and
FP_HANDLE_EXCEPTIONS in sfp-machine.h to use the hardware rounding mode
and exceptions so that this type works like the other floating-point
types.

IIUC, we should read config bits from SSE/x87 control word and act according to settings there? For FP_INIT_ROUNDMODE, I see no problems, but for FP_HANDLE_EXCEPTIONS, I would needa bit of help (which function to call?).

I propose that we went ahead with the gcc patch (I'll post glibc part
in a moment) and implement those two suggestions in a follow-up patch
(or two).

Uros.


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