[cxx-abi-dev] Clarification on floating point literal mangling

Dennis Handly dhandly at cup.hp.com
Wed Aug 4 05:35:48 UTC 2010


>From: Mike Herrick <mjh at edg.com>
>We recently ran across this seeming inconsistency with the description
>of mangling for floating point literals.  The current wording calls for
>both "fixed-length" and "without leading zeroes".  We think the "without
>leading zeroes" portion should be removed to match existing practice:

(Please ignore my previous reply, I didn't see this message first.)

And it seems to be contradictory.  (And "leading zero nibbles" would be better
wording.)
And in practice, there won't be many leading zero nibbles except for very
small numbers:
float  small zero nibble: 2.524355e-29
double small zero nibble: 1.288230e-231

(Of course if you assumed the numbers were distributed uniformly as bit
patterns, 1/16 of all floats would have at least one leading zero nibble.  :-)

Do we have something similar for Decimal floating point mangling?
Also do we care that there are two internal representation for Dec FP?
BID and DPD.

Do we expect that one compiler will want to have both at the same time?
Or just the natural one and the other is an opague type?
(HP plans to use BID and the other is a user defined opague type.)

And speaking of multiple types for decimal, if a compiler supports N
different binary floating point encodings, we have L x nibble-stream E, where
"x" can be the vendor defined type for alternate float formats?

I suppose this isn't important, if the compiler can only support one type
at the same time and just uses "f" for the float type.

*** abi.orig.html       Mon Aug  2 08:34:44 2010
  Floating-point literals are encoded using a fixed-length lowercase
  hexadecimal string corresponding to the internal representation (IEEE
! on Itanium), high-order bytes first, without leading zeroes.  For
  example: "Lf bf800000 E" is -1.0f on Itanium.



More information about the cxx-abi-dev mailing list