IA64 TF->XFmode conversion: final

Zack Weinberg zack@codesourcery.com
Sat Oct 25 02:46:00 GMT 2003


Here is the final version of the patch to convert ia64.md from TFmode
to XFmode for 80-bit extended floating point, and therefore to enable
simultaneous use of 80-bit extended and 128-bit IEEE quad float in the
same code.  (GCC does not currently have an emulation library for IEEE
quad float.)

Relative to the previous version, this patch simply has a bunch of bug
fixes in machine-independent code.  The changes to the ia64 backend
are identical.  First, this being the first use of the runtime mode
adjustment logic, it exposed a serious problem: if XFmode's size
changes (for instance), XCmode has to change too, and so do all vector
modes that contain XFmode.  Size adjustments require the alignment to
be recalculated.  And they invalidate the mode_unit_size table;
instead of updating that I chose to eliminate it in favor or a
mode_nunits table, which is invariant under all acceptable
adjustments (this gets rid of some division) and have
GET_MODE_UNIT_SIZE be GET_MODE_SIZE (GET_MODE_INNER (mode)) with
additional bits and bobs (GET_MODE_INNER (mode) == VOIDmode for scalar
modes).

Second, expmed.c did not understand modes with padding bits
(GET_MODE_BITSIZE (mode) < GET_MODE_SIZE (mode) * BITS_PER_UNIT).  I
did the minimal tweak here.  I am not 100% sure of its correctness,
but it seems to work.

Third, varasm.c would pick the wrong mode for writing out XFmode tree
constants, becuase it tried to use mode_for_size instead of just
looking at TYPE_MODE.  Blech.  And it would also write out only
GET_MODE_BITSIZE bits of the converted value, which is wrong for a
mode with padding.  The fix for this requires that real_to_target
always include all padding bits in its output array.  This is true for
all existing real_to_target backends.

I would like to thank Andreas Schwab, Al Stone, and Jeff Bailey 
(in chronological order) for helping me test this patch.  It has been
bootstrapped without regression (C and C++ only) on ia64-hp-hpux11.23
and ia64-unknown-linux.

zw

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ChangeLog
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20031025/9176df2b/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: conversion.diff
Type: text/x-patch
Size: 101378 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20031025/9176df2b/attachment.bin>


More information about the Gcc-patches mailing list