This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Floating Point Representation in libgcc (is IEEE?)
- From: Basile Starynkevitch <basile at starynkevitch dot net>
- To: "Paulo J. Matos" <pocmatos at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 15 Jun 2010 20:15:57 +0200
- Subject: Re: Floating Point Representation in libgcc (is IEEE?)
- References: <AANLkTim-xb8moGZ7d9EVyus4NAf06LsVMULDNjcceux0@mail.gmail.com>
- Reply-to: basile at starynkevitch dot net
On Tue, 2010-06-15 at 13:28 +0100, Paulo J. Matos wrote:
> Hi all,
>
> I am implementing some function for conversion between modes (QI ->
> HF, SF -> HI, etc). For this it would be useful to know the floating
> point representation using in libgcc. However, I can't find any
> description of it anywhere. Is it using IEEE floating point
> representation?
I might be very wrong (back-ends & floating points are things I don't
really know much about), but I would imagine that libgcc implement the
minimal runtime code -used to run your applications compiled by GCC-
useful for floating point. If this is true, then libgcc implement the
floating point number as provided, supported, or suggested by the target
hardware & system [which is different on Vax & on x86, for instance].
Within the GCC compiler, floating points are represented by the struct
real_value defined in gcc/real.h, and not by the native double numbers
of the host system (the one running GCC). This is probably needed to
permit bizarre GCC uses like cross-compiling from an IBM Serie Z (the
successor to IBM 370 etc.) to e.g. a Dec Alpha.
Of course, most GCC users probably run it on some x86 under Linux or
Cygwin (and perhaps cross-compile for an ARM target), but GCC is
designed to support very strange hosts & targets, in particular systems
with non IEEE 754 floating point numbers.
Cheers.
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***