This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
QFmode float support missing from optabs?
- From: Alan Lehotsky <apl at alum dot mit dot edu>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 20 Feb 2002 11:41:41 -0500
- Subject: QFmode float support missing from optabs?
I've got a machine with 32 bit bytes and want to support software single-precision FP
(it's only got 4k words of control-store ANYWAY).
"int" maps onto QImode, so float should map to QFmode. But there are SEVERAL problems, and
I'm wondering if my solution is acceptable as a patch.
Right now in optabs.c, there are checks for HFmode, SFmode, DFmode, XFmode, etc. but no corresponding
checks for QFmode (this is in places that do conversions between float and int). Similarly, there are no
entries in the libfuncs.h enumeration for QF compare routines, viz LTI_equqf2.
I've patched these in, and had to make one or two other changes (for example, there's code that wants to
hard-wire extending any GET_MODE_SIZE(mode) argument that's smaller than GET_MODE_SIZE(SImode) to
an SImode argument before calling certain library functions - but SImode is a 128-bit mode on my machine.
Specifically, in expand_float() and expand_fix() (in optabs.c), there's a line
if (GET_MODE_SIZE (GET_MODE (from)) < GET_MODE_SIZE (SImode))
that I think should be
if (GET_MODE_BITSIZE (GET_MODE (from)) < INT_TYPE_SIZE)
There aren't a lot of machines with BITS_PER_UNIT of 32, and the C4X seems to have double-precision
FP (their floats are HFmode) So, I can only really test the patch with my developmental port and
"confirm" that it doesn't break anything in a vanilla port like the SPARC or x86.
--
------------------------------------------------------------------------
Quality Software Management
http://home.earthlink.net/~qsmgmt
apl@alum.mit.edu
(978)287-0435 Voice
(978)808-6836 Cell
(978)287-0436 Fax
Software Process Improvement and Management Consulting
Language Design and Compiler Implementation