Port-amd64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: i387 rounding mode and long double support

joerg%britannica.bec.de@localhost said:
> If GCC really wants to use the i387, it certainly has to pay the price.
> Either setting the rounding mode in a function or forcing loads/stores
> are options for that

To state the obvious: it is not gcc what pays the price but the program
built, or its user.
Some simple checks show that gcc-4.5 and clang indeed prefer sse2 math
to x87 for an amd64 target. Didn't check pcc.

As said, if one can rely on the compiler to avoid the x87 then a change
of the default rounding mode wouldn't harm.

> > FreeBSD deals with that, see the TARGET_96_ROUND_53_LONG_DOUBLE
> > definition in gcc.
> The problem is not GCC.

The properties of "long double" are not defined by any global
standard, so I'd assume that clang has put this into machine specific
files. Didn't check, but it doesn't appear infeasible to do the same.
(I've never said that this is the way to go, just wanted to point
you at the fact that the problem is well known ant that different
people have different ideas about it.)

> The consideration is having proper long double vs crippled long double.

That's on the pro side. On the con side we have a possible crippling
of "double" (if the compilers don't use sse2 strictly), and binary
compatibility issues.

best regards

Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt

Home | Main Index | Thread Index | Old Index