Article View: gnu.gcc.bug
Article #1415BITS_PER_UNIT == 8 assumed in float machine mode definition
From: Andreas Luik
Date: Tue, 22 Dec 1992 19:47
Date: Tue, 22 Dec 1992 19:47
79 lines
3440 bytes
3440 bytes
Program: gcc
Version: 2.3.2
Host: sparc-sun-sunos4.1.3
Target: own
Area: cc1
Input file: all
gcc command: n.a.
Synopsis: BITS_PER_UNIT == 8 assumed in float machine mode definition
Description:
machmode.def is used to define the machine modes. The float machine
modes are defined using fixes sizes of 4, 8, 12 and 16 "bytes", but
these "bytes" are units in the size defined by BITS_PER_UNIT. If this
is defined as 16, then the smalles available float mode is 4 * 16 = 64
bits wide. That's too much. At least the sizes of the float modes
should depend on the BITS_PER_UNIT definition to simplify porting gcc
to a target machine with word addressing.
Fix:
Use a fix similar to the following:
*** machmode.def.ORIG Fri May 31 22:43:32 1991
--- machmode.def Mon Dec 21 01:36:57 1992
***************
*** 73,87 ****
DEF_MACHMODE (DImode, "DI", MODE_INT, 8, 8, TImode)
DEF_MACHMODE (TImode, "TI", MODE_INT, 16, 16, VOIDmode)
! DEF_MACHMODE (SFmode, "SF", MODE_FLOAT, 4, 4, DFmode)
! DEF_MACHMODE (DFmode, "DF", MODE_FLOAT, 8, 8, XFmode)
! DEF_MACHMODE (XFmode, "XF", MODE_FLOAT, 12, 12, TFmode) /* IEEE extended */
! DEF_MACHMODE (TFmode, "TF", MODE_FLOAT, 16, 16, VOIDmode)
! DEF_MACHMODE (SCmode, "SC", MODE_COMPLEX_FLOAT, 8, 4, DCmode)
! DEF_MACHMODE (DCmode, "DC", MODE_COMPLEX_FLOAT, 16, 8, XCmode)
! DEF_MACHMODE (XCmode, "XC", MODE_COMPLEX_FLOAT, 24, 12, TCmode)
! DEF_MACHMODE (TCmode, "TC", MODE_COMPLEX_FLOAT, 32, 16, VOIDmode)
/* BLKmode is used for structures, arrays, etc.
that fit no more specific mode. */
--- 73,91 ----
DEF_MACHMODE (DImode, "DI", MODE_INT, 8, 8, TImode)
DEF_MACHMODE (TImode, "TI", MODE_INT, 16, 16, VOIDmode)
! #define BYTES(B) ((B) * 8 / BITS_PER_UNIT)
! DEF_MACHMODE (SFmode, "SF", MODE_FLOAT, BYTES(4), BYTES(4), DFmode)
! DEF_MACHMODE (DFmode, "DF", MODE_FLOAT, BYTES(8), BYTES(8), XFmode)
! DEF_MACHMODE (XFmode, "XF", MODE_FLOAT, BYTES(12), BYTES(12), TFmode) /* IEEE extended */
! DEF_MACHMODE (TFmode, "TF", MODE_FLOAT, BYTES(16), BYTES(16), VOIDmode)
!
! DEF_MACHMODE (SCmode, "SC", MODE_COMPLEX_FLOAT, BYTES(8), BYTES(4), DCmode)
! DEF_MACHMODE (DCmode, "DC", MODE_COMPLEX_FLOAT, BYTES(16), BYTES(8), XCmode)
! DEF_MACHMODE (XCmode, "XC", MODE_COMPLEX_FLOAT, BYTES(24), BYTES(12), TCmode)
! DEF_MACHMODE (TCmode, "TC", MODE_COMPLEX_FLOAT, BYTES(32), BYTES(16), VOIDmode)
!
! #undef BYTES
/* BLKmode is used for structures, arrays, etc.
that fit no more specific mode. */
Comments:
gcc is really great: I had only very little problems getting it
running on this 16-bit processor with word addressing only. I know
that gcc was not designed for such exotic processors but will
nevertheless send you my bug reports and comments hoping they will
help improving gcc.
--
Andreas Luik E-Mail: luik@isa.de
(postmaster@isa.de) UUCP: ...!{uunet!unido,pyramid}!isaak!luik
Technical Details
Message-ID:
<9212221747.AA11912@einstein.isa.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!isa.DE!luikShow Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!isa.DE!luik From: luik@isa.DE (Andreas Luik) Subject: BITS_PER_UNIT == 8 assumed in float machine mode definition Message-ID: <9212221747.AA11912@einstein.isa.de> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Tue, 22 Dec 1992 19:47:57 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 80