Changing Mantissa's Width in Non-IEEE Floating Point implementation

Sheheryar Qazi sherry1.sherry1@gmail.com
Thu Sep 11 01:31:00 GMT 2014


Hi,
I have a gcc cross compiler on an 18 bit soft-core processor target
that has the following datatypes defined:
Integer 18 bit, Long 36 bit and float 36-bit(single precision).
Right now my focus is on floating point operation. Since the width is
non-standard(36 bit), I have the following scheme: 27 bits for
Mantissa(significand), 8 bits for Exponents and 1 Sign bit.
I can see the widths are defined in the float.h file. of interest to
me are the following:
FLT_MANT_DIG  and FLT_DIG.
They are defined as:

FLT_MANT_DIG 24
FLT_DIG 6

I have changed them to

FLT_MANT_DIG 28
 FLT_DIG 9

As per my requirements in float.h and then build the gcc compiler. But
still I get 32 bit floating point output.Do anyone has any experience
implementing non-standard single precision floating point numbers
and/or know wat changes are needed please let me know.
Sincerely
Sheheryar



More information about the Gcc-help mailing list