Little-endian YDL?

Tim Seufert yellowdog-general@lists.terrasoftsolutions.com
Fri Nov 21 06:38:01 2003


On Nov 20, 2003, at 7:46 PM, Chris Gehlker wrote:

> I don't for sure know how the term 'pseudo little-endian mode' came to 
> be  applied to what the PPC spec calls simply 'little-endian mode'  or 
> what is 'pseudo' about it.

I called it pseudo because, well, it is.  It doesn't work even remotely 
like a little endian CPU, though the net result is that it (mostly) 
behaves like a LE CPU for the purposes of user software.  (The OS is 
another matter.)

Example: on a LE processor, if you store the 32-bit number 0x01020304 
to address 0, memory looks like this:

mem[0] = 0x04
mem[1] = 0x03
mem[2] = 0x02
mem[3] = 0x01

On a PPC with the LE bit set, you get instead:

mem[0] = (Not changed)
mem[1] = (Not changed)
mem[2] = (Not changed)
mem[3] = (Not changed)
mem[4] = 0x01
mem[5] = 0x02
mem[6] = 0x03
mem[7] = 0x04

No, I'm not making this up.  Really.  Honest!  Look in the PPC spec for 
the full details if you don't believe me.  You probably will not 
believe such a horrible hack ever made it into a CPU architecture 
definition.  (In fact, you probably won't believe it actually works.)