diff --git a/arithmetic.html b/arithmetic.html index be79f3c..848bf3c 100644 --- a/arithmetic.html +++ b/arithmetic.html @@ -1,4 +1,4 @@ - +
@@ -17,7 +17,7 @@+
+
Consider the following code:
@@ -166,20 +183,25 @@ integers. The types may be aligned.Boost Endian is a header-only library.
-The best approach to endianness depends on interaction between +
The best approach to endianness for a particular use case depends on interactions between the approach characteristics and 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 +to use, and your code will be easier to maintain.
-The characteristics that differentiate the approaches are the endianness +
The characteristics that differentiate the three approaches to endianness are the endianness invariants, conversion explicitness, arithmetic operations, sizes available, and alignment requirements.
-@@ -193,11 +215,11 @@ find bugs.-Endian buffer and arithmetic types hold values internally as arrays of characters with an invariant that the endianness of the array never changes. -That makes these types easy to use and programs easy to maintain.
+That makes these types easier to use and programs easier to maintain.
@@ -211,7 +233,7 @@ to hoist conversions out of inner loops can bring a performance penalty.-
@@ -228,7 +250,7 @@ are very easy to use if lots of arithmetic is involved.-
@@ -241,7 +263,7 @@ factor, using sizes tailored to application needs can be useful.-
@@ -272,9 +294,24 @@ needed they are often very useful and workarounds are painful. For example,@@ -727,7 +764,7 @@ and 16, 32, and 64-bit aligned integers.Use cases
-Program portability use case
+Porting endian unaware codebase
-An existing large codebase runs on little-endian Linux systems. It already +
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
orint16_t
tobig_int16_t
, and +int
orint32_t
tobif_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 Linux provided functions. Because of a business merger, the codebase has to be quickly @@ -282,12 +319,12 @@ modified for Windows and possibly other operating systems, while still supporting Linux. The codebase is reliable and the programmers are all well-aware of endian issues.
-These factors all argue for an endian conversion +
These factors all argue for an endian conversion approach that just mechanically changes the calls to
-htobe32
, etc. toboost::endian::native_to_big
, etc. and replaces<endian.h>
with<boost/endian/conversion.hpp>
.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 @@ -299,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 @@ -640,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.
The endian types have been decomposed into endian buffer types @@ -788,7 +825,7 @@ Blechmann, Tim Moore, tymofey, Tomas Puverle, Vincente Botet, Yuval Ronen and Vitaly Budovski,.
Last revised: -16 December, 2014
+17 December, 2014© Copyright Beman Dawes, 2011, 2013
Distributed under the Boost Software License, Version 1.0. See www.boost.org/ LICENSE_1_0.txt
diff --git a/mini_review_topics.html b/mini_review_topics.html index 286033b..340baed 100644 --- a/mini_review_topics.html +++ b/mini_review_topics.html @@ -3,7 +3,7 @@ - +Common use case scenarios should be developed.
-+
Done. See Use cases.
Example programs should be developed for the common use case scenarios.
@@ -29,9 +29,8 @@ integer/float type and endian conversion approaches to the common use case scenarios, and provide guidelines for choosing the most appropriate approach in user's applications.-Done. See Choosing between - endian types and - endian conversion functions.
+Done. See Choosing between endian conversion + functions, endian buffer types, and endian arithmetic types.
Conversion functions supplying results via return should be provided.
@@ -59,13 +58,14 @@ portable base implementations, and to compare endian integer approaches against endian conversion approaches for the common use case scenarios.Done. See Timings for Example 2. The
+ also contains several additional benchmark and speed test programs.endian/test
directory - also contains several addional benchmark and speed test programs.Float (32-bits) and double (64-bits) should be supported. IEEE 754 is the primary use case.
-Done. The endian types and - endian conversion functions now support 32-bit (
float)
+Done. The endian buffer types, + endian arithmetic types and + endian conversion functions now support 32-bit (
float)
and 64-bit(double)
floating point, as requested.Support for user defined types (UDTs) is desirable, and should be @@ -99,8 +99,8 @@ might used inadvertently or inappropriately. The impact of adding an endian_buff
Last revised: -05 December, 2014
-© Copyright Beman Dawes, 2014
+17 December, 2014 +© Copyright Beman Dawes, 2014
Distributed under the Boost Software License, Version 1.0. See www.boost.org/ LICENSE_1_0.txt
diff --git a/styles.css b/styles.css index 7bd2260..d1b8958 100644 --- a/styles.css +++ b/styles.css @@ -10,4 +10,10 @@ body pre {background-color: #D7EEFF; font-size: 100%;} code {font-size: 110%;} table{font-size: 100%;} + + /* + © Copyright Beman Dawes, 2014 + Distributed under the Boost Software License, Version 1.0. + See www.boost.org/LICENSE_1_0.txt + */ \ No newline at end of file diff --git a/todo_list.html b/todo_list.html index cbcef8d..b4f3241 100644 --- a/todo_list.html +++ b/todo_list.html @@ -4,7 +4,7 @@ - +Endian Library Do List @@ -13,7 +13,7 @@Endian Library TODO List
Last revised: -15 December, 2014
+17 December, 2014August 12, 2014: The many items that have been completed should be removed, after verifying that they are in fact taken care of.
@@ -224,7 +224,11 @@ types that mimic FP types is far beyond my knowledge of how to deal
with floating point's notorious arithmetic issues.Support IEEE754 format (32 bit, 64 bit) only.
-+
Last revised: +17 December, 2014
+© Copyright Beman Dawes, 2012
+Distributed under the Boost Software License, Version 1.0. See +www.boost.org/LICENSE_1_0.txt