www.pegasos.org

Linux, BSD, Unix etc. - little Endian PPC ?

judas - Dec 23, 2006 - 11:25
Post subject: little Endian PPC ?
Hi,

maybe it's just a rumour, but I somewhere read that the PPC is able to do little Endian aswell.

Is it possible to have an application under linux use little endian in a big endian OS ?

.. the reason: I'm porting a programm which isn't endian-aware and it's very hard to find all the littel sins ...
Henriok - Dec 23, 2006 - 19:59
Post subject: Re: little Endian PPC ?
All Freescale's PowerPCs and IBM's PowerPC 400 family have robust little/big endian support. IBM's high end processors, like the RS64 series and POWER processors have limited support. The only PowerPCs that can't do little endian that are currently in production are the PowerPC 970 and the Cell. All others can be either big or little endian set at boot time, or have special byte swap instructions so one could use both with little overhead at execution time. I think you'll have to consult the documentation on the target CPU to learn what the deal is for that specific PowerPC processor.
Trizt - Dec 23, 2006 - 23:26
Post subject: Re: little Endian PPC ?
If I don't recall it wrongly, there is a option in the SmartFirmware to set the default endian.
ironfist - Dec 24, 2006 - 06:46
Post subject: Re: little Endian PPC ?
<i>Engrish, Engrish, Engrish..</i>
dholm - Dec 24, 2006 - 08:52
Post subject: Re: little Endian PPC ?
It's easier to just fix the software rather than to run the CPU in little endian mode since then the entire OS has to be in this mode as well.
judas - Dec 24, 2006 - 09:50
Post subject:
I hoped to switch the endianess per proccess under linux ... which seems impossible.

The problem of the code is, that I don't understand everything of it ... and as it is disk-encryption, writing can become a real dangerous testing job

Surprised
MajorTom - Dec 27, 2006 - 12:08
Post subject:
You certainly have to use a test partition.
Frek - Dec 31, 2006 - 12:40
Post subject: Re: little Endian PPC ?
Henriok wrote:
All Freescale's PowerPCs and IBM's PowerPC 400 family have robust little/big endian support. IBM's high end processors, like the RS64 series and POWER processors have limited support. The only PowerPCs that can't do little endian that are currently in production are the PowerPC 970 and the Cell. All others can be either big or little endian set at boot time, or have special byte swap instructions so one could use both with little overhead at execution time. I think you'll have to consult the documentation on the target CPU to learn what the deal is for that specific PowerPC processor.


As far as I know the PowerPC doesn't really have any robust little endian support at all. It has a little endian compatibility mode which is infact not true little endian but a mapping trick that's called munging- Which will make it appear to the processor that the environment is little endian as long as you're accessing aligned data, unaligned data however screwes up this trick pretty badly.
Other downsides with this mode- several instructions stop working when the MSR[LE] flag is set- and the only system ever to use the "little endian mode" as far as I know is the Windows NT/PPC release.
And the only Application I know that took adventage of the LE support was VirtualPC.
Apple and IBM later discussed the usefulness of this mode and with the PowerPC 970 support for little endian was dropped, the G5 don't support MSR[LE] at all.
dholm - Dec 31, 2006 - 13:55
Post subject: Re: little Endian PPC ?
All the (recent) PPC manuals from Freescale state that the little endian mode is deprecated and that you shouldn't build software depending on it. Besides, the ppc has some great instructions for doing endian conversion anyway.
ironfist - Dec 31, 2006 - 17:56
Post subject: Re: little Endian PPC ?
<b>dholm</b>:
What are the main differences between big and little endian?
Why chose one over the other?
Trizt - Jan 01, 2007 - 00:35
Post subject: Re: little Endian PPC ?
I's about how to store bytes, big endians advantage is that you can easilly see if it's possitive or negative, as it begins to store the highest byte in the first address. Little endian stores the smallest byte in the first address.

For a better description you can read this.
All times are GMT + 1 Hour
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits