[Pdx-pm] PowerPC and little-endian

Eric Wilhelm scratchcomputing at gmail.com
Tue Feb 28 18:37:46 PST 2006

Hi all,

Since I'm in the minority of non-mac owners around here, maybe you all 
can fill me in on this whole dual-mode software-switched rumor about 
the powerpc being able to run in either big or little endian mode.  I 
need to unpack some floats and doubles in a cross-platform way and yeah 
I could do that in pure perl with some of the portable pack/unpack 
commands and some byte twiddling, but that's going to be slow and so 
I'll then end up maintaining two pieces of code, so I was thinking I 
could compile perl to run in little-endian mode.


Is this nuts?  Maybe.  I wouldn't be asking except that I ran across a 
guy that said his ruby was behaving in a little-endian manner and his 
perl was big and then another guy had a big perl and a big ruby.  Maybe 
I got some bad data, but this is just going beyond healthy curiosity at 
this point.  I suspect a gcc switch, but others suggest that it's 
emulation or some other trickery.  Can anyone here elucidate?

"Beware of bugs in the above code; I have only proved it correct, not
tried it."
--Donald Knuth

More information about the Pdx-pm-list mailing list