Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Proposed replacement for 14.4 and C6.2 (interchange encodings)



On Sun, 22 Jun 2014 20:12:21 -0700 (PDT) Dmitry Nadezhin wrote:
> What do you think about defining the signature as an ANSI string?
> It could explicitly specify:
> - order of octets ( lsb/msb ),
> - number of bits in floating-point format,
> - number of bits in decoration together with padding zero octets.
>
> For example
> p1788_bin64_msb_d8  - the plain format for decorated infsup_bin64
> p1788_bin64_lsb_d32 - useful on x86 machines format for decorated infsup_bin64
> ...

I had started to think in terms of a plain character string, but here
are several reasons why I changed to the mixed text/binary format:

(0)  In the above, 'p1788' is inappropriate; the 'p' (for Project) will
     go away if and when this actually becomes an IEEE standard.

(1)  I would have had to invent short names for the byte ordering.
     Dima's "MSB" is incomplete, it should be "MSBF" for "Most
     Significant Byte First", but may be better than "BE" or "LE".

(2)  I wanted a fixed-length signature, preferably a multiple of 4 bytes.
     That fits more easily into structure layouts in many languages.

(3)  I want to accomodate ALL 754-2008 formats, including the extendable
     ones that can have arbitrary size (in multiples of 32 bits).  Such
     sizes are better represented in binary than in a decimal character
     string.

(4)  The method of detecting Endianness by looking at a binary field of
     known content is quite general.  If in fact the application already
     knows the size (which is likely), this could even detect some messy
     mixed-endian formats, although there are values where all four bytes
     would be the same and hence useless as an indicator.  (That's why I
     mentioned 2**24 as a practical upper limit.)

Btw, I agree with Vincent's later comment that we should more clearly
state that the interchange format does not attempt to dictate memory
layout except for the purpose of exporting the data to another medium,
e.g. a network packet or file stream -- and that we should universally
use "octets" instead of "bytes", as Dima has started to do.

Michel.
---Sent: 2014-06-23 14:03:51 UTC