Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-05

PowerPC Linux and endian modes

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Seth Grover

Greetings!

Wikipedia (http://en.wikipedia.org/wiki/PowerPC#Endian_modes) states:

"Most PowerPC chips switch endianness via a bit in the MSR (Machine State Register), with a second bit provided to allow the OS to run with a different endianness."

So the way I am understanding this is that the PPC architecture is capable of running in little-endian mode depending on a register flag that can be set. And that's about the end of my knowledge on the subject.

My question is this: does anyone have any experience with running PPC in little endian mode? And would FPC-compiled programs (specifically I'm cross compiling to powerpc-linux from x86_64-linux) targeted at PPC work in a little endian mode setup?

Thanks,

-SG

This email is fiction. Any resemblance to actual events or persons living or dead is purely coincidental. Seth Grover
Henry Vermaak
to Seth Grover
Seth Grover wrote 17 lines
Greetings! Wikipedia (http://en.wikipedia.org/wiki/PowerPC#Endian_modes) states: "Most PowerPC chips switch endianness via a bit in the MSR (Machine State Register), with a second bit provided to allow the OS to run with a different endianness." So the way I am understanding this is that the PPC architecture is capable of running in little-endian mode depending on a register flag that can be set. And that's about the end of my knowledge on the subject. My question is this: does anyone have any experience with running PPC in little endian mode? And would FPC-compiled programs (specifically I'm cross compiling to powerpc-linux from x86_64-linux) targeted at PPC work in a little endian mode setup?

Sorry, I don't. You definitely have to fiddle with the endian settings under the relevant section of compiler/systems/i_linux.pas before you build your cross compiler, though.

Henry

Jonas Maebe
to Seth Grover: Greetings! Wikipedia (http://en.wikipedia.org/wiki/PowerPC#Endian_modes) states: "Most…
Seth Grover wrote
And would FPC-compiled programs (specifically I'm cross compiling to powerpc-linux from x86_64-linux) targeted at PPC work in a little endian mode setup?

As Henry indicated, you'd have to modify the compiler to get it to generate little endian code for a PowerPC target. But little endian PowerPC has not been tested, so it's quite possible that it wouldn't work (e.g., some assembler helpers in the system unit will probably require modifications or disabling, because changing the endianess changes a.o. the layout of set-type variables).

Jonas

Seth Grover
to Seth Grover: Greetings! Wikipedia (http://en.wikipedia.org/wiki/PowerPC#Endian_modes) states: "Most…

Henry and Jonas, thanks a lot for your responses and giving me an idea of at least where I'd want to start looking if that were the case. Honestly it's something of a pipe dream at the moment, so who knows if I'll even go down that path, but you've given me a place to begin if I do.

Have a good weekend,

-SG

This email is fiction. Any resemblance to actual events or persons living or dead is purely coincidental. Seth Grover On Thu, May 19, 2011 at 4:39 PM, Seth Grover wrote: > Greetings! > > Wikipedia (http://en.wikipedia.org/wiki/PowerPC#Endian_modes) states: > > "Most PowerPC chips switch endianness via a bit in the MSR (Machine > State Register), with a second bit provided to allow the OS to run > with a different endianness." > > So the way I am understanding this is that the PPC architecture is > capable of running in little-endian mode depending on a register flag > that can be set. And that's about the end of my knowledge on the > subject. > > My question is this: does anyone have any experience with running PPC > in little endian mode? And would FPC-compiled programs (specifically > I'm cross compiling to powerpc-linux from x86_64-linux) targeted at > PPC work in a little endian mode setup? > > Thanks, > > -SG > > -- > This email is fiction. Any resemblance to actual events > or persons living or dead is purely coincidental. > > Seth Grover >