This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Ideas for Google Summer of Code
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Ross Ridge <rridge at csclub dot uwaterloo dot ca>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 30 Mar 2009 19:54:35 +0000 (UTC)
- Subject: Re: Ideas for Google Summer of Code
- References: <20090330193301.B1FCB73F5B@caffeine.csclub.uwaterloo.ca>
On Mon, 30 Mar 2009, Ross Ridge wrote:
> >2) half-precision floats;
>
> Do you mean just conversion only support, like Sandra Loosemore's
> proposed ARM patch, or full arithmetic support like any other scalar or
> vector type?
Arithmetic via converting to float, doing arithmetic on that and
converting back to half-precision gives you the same semantics as IEEE
arithmetic directly on half-precision, except for the special case of
converting double to half-precision where you can get double rounding if
you go via float. (This is because the precision of float is strictly
more than twice that of half-precision. Of course the above only applies
to single arithmetic operations; more complicated combinations would need
truncation to half-precision at each step rather than doing everything in
float.)
So if you have hardware float operations but not hardware half-precision
you probably want to use those hardware float operations for arithmetic
rather than having any separate half-precision arithmetic implementation.
There are at least three possibilities for semantics: the ARM semantics
where promotion to float happens at the language level; full IEEE
arithmetic with every operation having a result in the range and precision
of half-precision; or C99 excess precision where the semantic type is
half-precision but the values are expressed to the range and precision of
float.
--
Joseph S. Myers
joseph@codesourcery.com