[cxx-abi-dev] Request for clarification: floating point literal mangling

Jim Dehnert dehnert at transmeta.com
Mon Jun 9 04:22:33 UTC 2003


Zack Weinberg wrote:
> The current text referring to the mangling of floating-point literals
> in template parameters has a number of ambiguities.  Here's what it
> says:
> 
>      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.
> 
> I see four problems:
> 
> 1) It is not clear what "internal representation" means.  The example
>    suggests that the intent is to use the bit pattern that the
>    processor would store in memory, considered as an integer.
>    However, it might also refer to the compiler's internal
>    representation of floating point numbers, which may or may not be
>    the same thing.

It was intended to mean the hardware memory representation.

> 2) "Fixed length" and "without leading zeroes" contradict each other.
> 
> 3) Assuming that "without leading zeroes means, e.g. that the mangling
>    of the denormalized single precision float 1.40129846e-45f is
>    "Lf 1 E", it is not clear whether 0.0f should be mangled as
>    "Lf 0 E" or "Lf E".

I don't know what the existing implementations have done, but I suspect
that this is a misstatement and that we meant without trailing zeroes,
which makes much more sense for FP.  But at this point, the confusion
should be resolved based on what the implementations do.

> 4) The example indicates that the "n" prefix is not used for negative
>    floating point literals, but the text doesn't make that clear.

Right.

Jim

-- 
-	    Jim Dehnert		dehnert at transmeta.com
	    (408)919-6984	dehnertj at acm.org




More information about the cxx-abi-dev mailing list