This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: backend support for __float80 and __float128 on IA64
- From: Jim Wilson <wilson at specifixinc dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: 25 Sep 2003 02:06:06 -0700
- Subject: Re: RFC: backend support for __float80 and __float128 on IA64
- References: <87oexcei1o.fsf@codesourcery.com>
On Mon, 2003-09-22 at 12:31, Zack Weinberg wrote:
> This patch arranges for the ia64 back end and the optimizers to
> support simultaneous use of 80-bit (XFmode) and 128-bit (TFmode)
> floating point types.
We tried to use XFmode at the beginning, and we couldn't get it
working. I ran into a series of problems, which got successively harder
to fix. The problem is not so much defining ROUND_TYPE_ALIGN, the
problem is that there are a great many places in the compiler that
assume that XFmode is a 12-byte value with 8 (or maybe 4) byte
alignment, and finding and fixing every one is a large task. Anyplace
that uses GET_MODE_SIZE (XFmode) for instance gets the wrong answer. I
eventually came to the conclusion that we had to change the machmode.def
file which I didn't want to do, and that is when Richard suggested using
TFmode instead, and it wasn't hard for him to write a patch to implement
it. The patch is here:
http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00589.html
The i960 port by the way also uses the same code. The ROUND_TYPE_ALIGN
trick was first used for the i960 port which has the same long double
semantics as ia64, e.g. an 80-bit value stored in a 128-bit space. This
was implemented about 10 years ago. There is a long history of long
double not quite working right in the i960 port, and these problems were
solved when the i960 port was switched to use INTEL_EXTENDED_IEEE_FORMAT
also. If you want to get rid of that code, you either need to obsolete
the i960 port, or change the i960 port to use XFmode instead of TFmode
also. But in this case we have a patch that we can perhaps apply
reversed to get the old code back. The i960 patch is here
http://gcc.gnu.org/ml/gcc-patches/2002-10/msg00354.html
I am trying an ia64-linux bootstrap and testsuite run with your patch,
but I don't know if this is a sufficient test. I suspect I have to
build glibc and run the glibc math tests. My machine is recently
arrived, and isn't set up for building glibc yet, as I will have to
update a lot of system utilities, so this will take some time. Perhaps
even a week or two.
Realistically, I think that if you want to change how the IA-64 long
double support works, you will have to install linux on one of your
machines so that you can do the necessary testing. I know from personal
experience that what you are trying to do is very hard to get working
reliably. I don't accept that running an ABI testsuite is sufficient
testing. Getting the ABI right is the easy part. The hard part is
correctly compiling programs that make heavy use of long double, such as
parts of glibc. I doubt that your patch works in practice.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com