A patch for libm-ieee754

Geoffrey KEATING geoffk@discus.anu.edu.au
Sun Feb 22 19:30:00 GMT 1998


> Date: Sun, 22 Feb 1998 21:37:55 -0500
> From: David Edelsohn <dje@watson.ibm.com>

> 	On PowerPC you probably also need -mno-fused-madd option to
> disable use of the fma, etc. instructions because of the intermediate
> extended precision.  Note that this will halve FP performance in some
> cases. 

This is not necessary.

The libm doesn't mind if _expressions_ have extra precision, the
important thing is that _variables_ have the right precision.

In the same way, I expect

unsigned char x;
unsigned char y=0xff, z = 1;

x = y + z;
assert(x == 0);

to have the assertion succeed; I don't expect the compiler to decide
"you said 'unsigned char', but it'll actually behave like an 'unsigned
int'".

[I hope that gcc won't combine

double x,y,z,r;
r = x*y;
r = r+z;

into a fused multiply-add!]


Besides, I test these routines on PPC, and I make sure they do the
right thing :-).  I don't think anyone had tried running them on x86
before, because the 387 FPU has most of these routines in hardware.

--
Geoff Keating <Geoff.Keating@anu.edu.au>



More information about the Gcc mailing list