[committed] libffi patch for IA-64 denorms

James E Wilson wilson@specifix.com
Wed Apr 12 22:20:00 GMT 2006

This addresses a problem reported in PR 26483, where denorm values
passed through libffi were accidentally rounded, when they should have
been passed through unchanged.

The problem here is that the code was written to use long double values
as a generic FP type.  Since the IA-64 architecture holds FP values in
registers in the long double format always, this is fine normally,
except for denorms, which get rounded inappropriately.  This was fixed
by rewriting the code to use macros, and appropriately typed local
variables, to avoid any FP type conversions.

While working on this, I noticed that the HFA (homogeneous
floating-point aggregate) support was also broken, and had to be fixed. 
This this patch is a bit bigger than my original patch.

This was tested with an ia64-linux bootstrap and make check, with and
without the patch.  There were 4 fewer libffi failures with the patch,
for the testcase I checked in last Friday.  There were no other
changes.  I also verified this by disassembling libffi/src/ia64/ffi.o,
and looking for fnorm (FP type conversion) instructions.  There are 8
such instructions in the unpatched toolchain.  There are 0 such
instructions in the patched toolchain.

I have added the patch to mainline.
Jim Wilson, GNU Tools Support, http://www.specifix.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.denorm.spill.2
Type: text/x-troff-man
Size: 5270 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060412/843c0a21/attachment.bin>

More information about the Gcc-patches mailing list