This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Support Cell SPU floating point
- From: Geert Bosch <bosch at adacore dot com>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: "trevor_smigiel at playstation dot sony dot com" <trevor_smigiel at playstation dot sony dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Andrew_Pinski at playstation dot sony dot com, "Ulrich Weigand" <uweigand at de dot ibm dot com>, Russell_Olsen at playstation dot sony dot com, "Ian Lance Taylor" <iant at google dot com>
- Date: Mon, 17 Dec 2007 23:39:34 -0500
- Subject: Re: [PATCH] Support Cell SPU floating point
- References: <20070829001149.GF1923@playstation.sony.com> <email@example.com> <20070904220116.GO1923@playstation.sony.com> <firstname.lastname@example.org>
On Sep 5, 2007, at 05:04, Richard Guenther wrote:
Do you think adding a mode argument to the appropriate routines in
real.c (e.g., real_arithmetic, real_compare) is the correct approach?
That would allow me to model the hardware correctly. Or do you have
Well, in general I think that adding a mode argument to those
makes sense (and I see that would be necessary to do what you need).
Yes, I strongly believe we'll need mode arguments eventually anyway.
We don't yet support C99, in particular support for Annex F
(binding to IEEE 754) is currently lacking.
However, when we do get around to implementing things like
#pragma STDC FENV_ACCESS, fesetround, etc, we'll want to evaluate
constant expressions in those contexts. For that we'll need to pass
Even now, it would be much clearer to have things such as conversion
of float to integer be done properly by GCC, using a rounding mode that
can be specified by the caller. Right now, for x86, in order to perform
unbiased rounding from float to integer, we set the FPU to truncate,
rounding and then adjust based on the difference between the exact
value and the rounded value. However, if we left the FPU in
round-to-even, it could be done without any mode-switching or
compensation code at all.