Thread Links | Date Links | ||||
---|---|---|---|---|---|
Thread Prev | Thread Next | Thread Index | Date Prev | Date Next | Date Index |
John, Michel, P1788 Revision -r376 contains - Corresponding changes in C6.2. - §4.2 Definitions entries for "octet" & "octets-encoding". - Hyphen in beg-endian and little-endian (according to Wikipedia). -Dima ----- Original Message ----- From: j.d.pryce@xxxxxxxxxx To: dmitry.nadezhin@xxxxxxxxxx, mhack@xxxxxxx Cc: stds-1788@xxxxxxxxxxxxxxxxx Sent: Thursday, June 26, 2014 2:30:07 PM GMT +04:00 Abu Dhabi / Muscat Subject: Re: ... replacement for 14.4 and C6.2 (interchange encodings) Dmitry, Michel, P1788 On 2014 Jun 26, at 10:14, Dmitry Nadezhin wrote: > John, Michel, Ned, > > I tried to merge Michel's text with John's and mine changes. > The text is in -r372, thought you might want to change it more. > > My changes are: > 1) The word "octets-ecoding"; > 2) Decoration is a bit string; > 3) "Octets-encoding" might insert padding zero octets for alignment; > 4) Width of the floating-point interchange format is also a parameter; > 5) Example contains: > - one Level 3 representation; > - one Level 4 encoding; > - two octets-encodings of fields and of interval; > 6) Basic standard says about octets-encoding and omits Level 4 encodig for simplicity. I did minor edits in 14.4, mainly: - Changed "stream" to "sequence"; used the term "octet sequence"; introduced "octet" & "octets-encoding" as terms being defined. - Reworded the example slightly. - Moved the Note earlier, where it better belongs. Dima, if you approve these, please - Do corresponding changes in C6.2. - Add §4.2 Definitions entries for "octet" & "octets-encoding". This is revision 373. FYI I append the result of svn diff. John %svn diff *.tex Index: P1788G_level3.tex =================================================================== --- P1788G_level3.tex (revision 372) +++ P1788G_level3.tex (working copy) @@ -118,9 +118,7 @@ %----- Interchange Level 4 encoding of an interval datum is a bit string that comprises, in the order defined above, the 754-2008 interchange -encodings of the two floating-datums, and, for decorated intervals, of the decoration represented -as a bit string of length 8, as follows: -%as a small integer, as follows: +encodings of the two floating-datums, and, for decorated intervals, of the decoration represented as an {\bf octet} (bit string of length 8, equivalently 8-bit byte) as follows: \bc \begin{tabular}{cc} \Dill & 00000000 \\ @@ -129,24 +127,22 @@ \Ddac & 00001100 \\ \Dcom & 00010000 \end{tabular} -%\begin{tabular}{cc} -% \Dill & 0 \\ -% \Dtrv & 4 \\ -% \Ddef & 8 \\ -% \Ddac & 12 \\ -% \Dcom & 16 -%\end{tabular} \ec This encoding permits future refinement without disturbing the propagation order of the decorations. -% , and fits within the range of a C signed char, namely $0..127$. -Export and import of interchange formats normally occurs as a stream -of octets (8-bit bytes), e.g. in a file or a network packet. There -is therefore a need to define the mapping of the conceptual Level 4 +\note{The above rules imply that an interval has a unique interchange +representation if it is not \nai and in a binary format, but not +generally otherwise. The reason for the rules is that the sign of a +zero bound cannot convey any information relevant to intervals; +but an implementation may potentially use cohort information, or a +\nan payload.} + +\medskip +Export and import of interchange formats normally occurs as a sequence +of octets, e.g. in a file or a network packet. There is therefore a need to define the {\bf octets-encoding} that maps the conceptual Level 4 bit string encodings of floating-point datums (as specified by 754-2008) -and of decorations (not specified in 754-2008) into a sequence of -octets (octets-encoding). +and of decorations (not specified in 754-2008) into an octet sequence. Octets-encoding might optionally insert padding zero octets for alignment. % bit strings (as specified by 754-2008) and of the small integers used % to encode decorations (out of scope for 754-2008) into a sequence of @@ -158,24 +154,21 @@ representation of individual datums, and then only as conceptual Level 4 entities. Environments whose primary focus is universal portability (e.g. Java) may fully define the representation at the -level of a sequence of octets, even when this does not match the +level of an octet sequence, even when this does not match the natural in-memory layout of the platform. -This standard merely requires the parameters of the octets-encoding -%This standard takes the more lenient view that the parameters of the mapping to a stream of octets +The standard merely requires the parameters of the octets-encoding be communicated, which may avoid conversion costs when bulk -data are exchanged among similar systems. Those parameters -are\footnote{Those parameters describe the exported data, not necessarily -what the platform's native representation is. In other words, -the possibility of universally portable representations, e.g. -as used by Java, is included.}: +data are exchanged among similar systems. +Those parameters are% +\footnote{Those parameters describe the exported data, not necessarily +what the platform's native representation is. The possibility of universally portable representations, e.g., as used by Java, is included.}: \begin{itemize} -\item Width in bits of the floating-point interchange format (see 754 \S3.6). -\item For decimal formats, whether BID or DPD encoding is used. -\item Byte order (Endianness) of the floating-point datums: -Big Endian, Little Endian, or mixed (in which case -it might be useful to export a template). -\item Number of optional padding zero octets inserted before or after the decoration -(for alignment reasons). +\item width in bits of the floating-point interchange format (see 754 \S3.6); +\item for decimal formats, whether BID or DPD encoding is used; +\item byte order (Endianness) of the floating-point datums: +Big Endian, Little Endian, or mixed (in the last case +it might be useful to export a template); +\item number of padding zero octets inserted before or after the decoration for alignment. % Size (in octets) and possibly byte order of the decoration % (if not a single octet, e.g. for padding reasons, or % because the platform's small integer type is bigger) @@ -210,8 +203,7 @@ \Dcom & 00010000 \end{tabular} \] - -The Big-Endian interchange octets-encoding of the interval is a sequence of 9 octets: +and the interchange octets-encoding of the interval is (assuming no padding octets are inserted) a sequence of 9 octets: \[ \begin{tabular}{lllllllll} 10111111 & 10000000 & 00000000 & 00000000 & 01000000 & 01000000 & 00000000 & 00000000 & 00010000 . \\ @@ -226,8 +218,7 @@ \Dcom & 00010000 \end{tabular} \] - -The Lettle-Endian interchange octets-encoding of the interval is a sequence of 9 octets: +and the interchange octets-encoding of the interval is a sequence of 9 octets: \[ \begin{tabular}{lllllllll} 00000000 & 00000000 & 10000000 & 10111111 & 00000000 & 00000000 & 01000000 & 01000000 & 00010000 . \\ @@ -235,13 +226,6 @@ \] } -\note{The above rules imply that an interval has a unique interchange -representation if it is not \nai and in a binary format, but not -generally otherwise. The reason for the rules is that the sign of a -zero bound cannot convey any information relevant to intervals; -but an implementation may potentially use cohort information, or a -\nan payload.} - A 754-conforming implementation shall provide an interchange encoding for each supported 754 interval type. Interchange encodings for non-754 interval types, and on non-754 systems, are
Index: P1788C_defs.tex =================================================================== --- P1788C_defs.tex (revision 375) +++ P1788C_defs.tex (working copy) @@ -302,6 +302,12 @@ \subsubsection{\bf number format}\label{df:n-format} See {\bf format}. +\subsubsection{\bf octet}\label{df:octet} +\dAF Bit string of length 8, equivalently 8-bit byte. + +An {\bf octets-encoding} is a mapping from the conceptual Level bit string encodings of floating-point datums (as specified by 754-2008) +and of decorations (not specified in 754-2008) into an octet sequence. + \subsubsection{\bf operation}\label{df:operation} In a given flavor, synonymous with {\bf supported function}. Index: P1788G_level3_B.tex =================================================================== --- P1788G_level3_B.tex (revision 375) +++ P1788G_level3_B.tex (working copy) @@ -65,11 +65,13 @@ For example, the only representative of $\Emp_{\Dtrv}$ is the triple $(\pinf,\ninf,\Dtrv)$, and the only representative of \nai is the triple $(\nan,\nan,\Dill)$. -Interchange octets-encoding of an interval datum is a sequence of octets (8-bit bytes) +Export and import of interchange formats normally occurs as a sequence +of {\bf octets} (bit strings of length 8, equivalently 8-bit bytes), e.g. in a file or a network packet. +There is therefore a need to define the {\bf octets-encoding} that maps the conceptual Level 3 representation into an octet sequence +%Interchange octets-encoding of an interval datum is a sequence of octets (8-bit bytes) that comprises, in the order defined above, the interchange octets-encodings of the two \@b64@ datums, and, for decorated intervals, of the decoration represented as an octet, as follows: -%as a small integer, as follows: \bc \begin{tabular}{cc} \Dill & 00000000 \\ @@ -78,13 +80,6 @@ \Ddac & 00001100 \\ \Dcom & 00010000 \end{tabular} -%\begin{tabular}{cc} -% \Dill & 0 \\ -% \Dtrv & 4 \\ -% \Ddef & 8 \\ -% \Ddac & 12 \\ -% \Dcom & 16 -%\end{tabular} \ec This encoding permits future refinement without disturbing the propagation order of the decorations. Index: P1788G_level3.tex =================================================================== --- P1788G_level3.tex (revision 375) +++ P1788G_level3.tex (working copy) @@ -166,7 +166,7 @@ \item width in bits of the floating-point interchange format (see 754 \S3.6); \item for decimal formats, whether BID or DPD encoding is used; \item byte order (Endianness) of the floating-point datums: -Big Endian, Little Endian, or mixed (in the last case +Big-Endian, Little-Endian, or mixed (in the last case it might be useful to export a template); \item number of padding zero octets inserted before or after the decoration for alignment. % Size (in octets) and possibly byte order of the decoration
Attachment:
octets3.pdf
Description: Adobe PDF document