diff --git a/doc/index.html b/doc/index.html index 6cde0db..0ccac4e 100644 --- a/doc/index.html +++ b/doc/index.html @@ -39,17 +39,31 @@ - Abstract
- Introduction to endianness
- Introduction to the Boost.Endian library
- Choosing approaches
- Built-in support for Intrinsics
- Performance
-    Timings
-    Conclusions
- FAQ
- Release history
- Acknowledgements +Abstract
+Introduction to endianness
+Introduction to the Boost.Endian library
+Choosing between conversion, buffer types,
and arithmetic types
+   Characteristics
+      Endianness invariants
+      Conversion explicitness
+      Arithmetic operations
+      Sizes
+      Alignments
+   Use cases
+      Porting endian unaware codebase
+      Porting endian aware codebase
+      Reliability and arithmetic-speed
+      Reliability and ease-of-use
+Built-in support for Intrinsics
+Performance
+   Timings for Example 2
+   Conclusions
+Overall FAQ
+Release history
+   Changes since formal review
+Acknowledgements
+ @@ -77,7 +91,7 @@ floating point numbers, and user-defined types.

  • Program portability. POSIX-based and Windows-based operating systems traditionally supply libraries with non-portable functions to perform endian conversion. There are at least four - non-compatible sets of functions in common use. The Endian library is + incompatible sets of functions in common use. The Endian library is portable across all C++ platforms.
     
  • @@ -86,11 +100,14 @@ floating point numbers, and user-defined types.

  • Secondary use case: Minimizing data size via sizes and/or alignments not supported by the standard C++ arithmetic types.

  • -
  • Three approaches to dealing with endianness are provided. Each approach has a +
  • Three approaches to dealing with endianness are supported. Each has a long history of successful use, and each approach has use cases where it is preferred over the other approaches.
  • +

     

    +

     

    +

    Introduction to endianness

    Consider the following code:

    @@ -166,8 +183,8 @@ integers. The types may be aligned.

    Boost Endian is a header-only library.

    -

    Choosing between endian conversion functions, endian buffer types, -and endian arithmetic types

    +

    Choosing between conversion functions, buffer types, +and arithmetic types

    The best approach to endianness for a particular use case depends on interactions between the approach characteristics and @@ -175,16 +192,16 @@ the application needs.

    Recommendation: If you are uncertain, new to endianness, concerned about security, concerned about reliability, or don't want to invest time making -engineering trade-offs, use the endian arithmetic types. They are safer, easier +engineering trade-offs, use the endian arithmetic types. They are safer, easier to use, and your code will be easier to maintain.

    -

    Approach characteristics

    +

    Characteristics

    The characteristics that differentiate the three approaches to endianness are the endianness invariants, conversion explicitness, arithmetic operations, sizes available, and alignment requirements.

    -

    Endianness invariants

    +

    Endianness invariants

    @@ -202,7 +219,7 @@ That makes these types easier to use and programs easier to maintain.

    -

    Conversion explicitness

    +

    Conversion explicitness

    @@ -216,7 +233,7 @@ to hoist conversions out of inner loops can bring a performance penalty.

    -

    Arithmetic operations

    +

    Arithmetic operations

    @@ -233,7 +250,7 @@ are very easy to use if lots of arithmetic is involved.

    -

    Sizes available

    +

    Sizes

    @@ -246,7 +263,7 @@ factor, using sizes tailored to application needs can be useful.

    -

    Alignments available

    +

    Alignments

    @@ -277,7 +294,22 @@ needed they are often very useful and workarounds are painful. For example,

    Use cases

    -

    Porting endian aware codebase

    +

    Porting endian unaware codebase

    + +

    An existing codebase runs on big endian systems. It does not +currently deal with endianness. The codebase needs to be modified so it can run +on  little endian systems under various operating systems. To ease +transition and protect value of existing files, external data will continue to +be maintained as big endian.

    + +

    The endian +arithmetic approach is recommended to meet these needs. A relatively small +number of header files dealing with binary I/O layouts need to change types like +short or int16_t to big_int16_t, and +int or int32_t to bif_int32_t. No +changes are required for .cpp files.

    + +

    Porting endian aware codebase

    An existing codebase runs on little-endian Linux systems. It already deals with endianness via @@ -292,22 +324,7 @@ approach that just mechanically changes the calls to htobe32, etc. to boost::endian::native_to_big, etc. and replaces <endian.h> with <boost/endian/conversion.hpp>.

    -

    Porting endian unaware codebase

    - -

    An existing codebase runs on expensive big endian systems. It does not -currently deal with endianness. The codebase needs to be modified so it can run -on lower-cost little endian systems under various operating systems. To ease -transition and protect value of existing files, external data will continue to -be maintained as big endian.

    - -

    The endian -arithmetic approach is recommended to meet these needs. A relatively small -number of header files dealing with binary I/O layouts need to change types like -short or int16_t to little_int16_t, and -int or int32_t to little_int32_t. No -changes are required for .cpp files.

    - -

    Reliability and arithmetic-speed use case

    +

    Reliability and arithmetic-speed

    A new, complex, multi-threaded application is to be developed that must run on little endian machines, but do big endian network I/O. The developers believe @@ -319,7 +336,7 @@ slow conversions if full-blown endian arithmetic types are used.

    The endian buffers approach is made-to-order for this use case.

    -

    Reliability and ease-of-use use case

    +

    Reliability and ease-of-use

    A new, complex, multi-threaded application is to be developed that must run on little endian machines, but do big endian network I/O. The developers believe @@ -660,7 +677,7 @@ determine if some coding technique has significant impact on performance.

    Unaligned types are much slower that aligned types, regardless of endianness considerations. Instead of single instruction register loads and -stores, multiple instructions are required.

    +stores, multiple instructions are required on common platforms.

    @@ -747,7 +764,7 @@ and 16, 32, and 64-bit aligned integers.

    Release history

    -

    Changes since formal review

    +

    Changes since formal review