« Multicore in the Age of the Unthinkable Multicore – assimilating the new developments »

Big endian + Little endian byte order = biendian


Today, I wanted to share a bit on a project I’ve worked on for a couple of years now as we’ve had some recent success. 

 One fairly subtle issue in migrating code from one architecture to another is byte order.  For a more detailed summary of the issue, I encourage you to read Matassa’s paper on the subject: http://software.intel.com/en-us/articles/endianness-whitepaper.  Experienced developers know that it is very difficult to find and fix byte order issues in large code bases. 

The project is based upon the following patent:


A more layperson’s description:

Biendian Technology is a compiler feature that enables an application to execute with big endian semantics when executed on little endian processors or vice versa.  At the lowest level, the technology takes advantage of the bswap instruction which converts 16-bit, 32-bit, and 64-bit values from one byte order to the other.  The programmer modifies the original source code to designate the byte order of data in the application using command line options, pragmas, and attributes.  During compilation and where required, bswap instructions are inserted at the boundary between memory and registers.  In other words, if a region of code is designated to execute with big endian semantics, the data is stored in big endian format.  When a load of a value into a register occurs in preparation for an operation on the value, a bswap instruction reorders the value into little endian format.  If the resulting computation is then stored back to memory, a bswap instruction reorders the value into big endian format before the store. 

That’s really it for today.  I just wanted to provide a bit of detail on one of my day jobs at my employer that keeps me excited working on technology to help customers take advantage of multicore processors.

date Posted on: Wednesday, July 29, 2009 at 1:41 pm
Category Uncategorized.
You can follow any responses to this entry through the RSS 2.0 feed.

Both comments and pings are currently closed.

Comments are closed.

Domeika’s Dilemma is powered by WordPress
Theme is Coded&Designed by ricdes dot com