LWN.net Logo

Linux on PowerPC

Linux on PowerPC

Posted Jul 15, 2010 10:57 UTC (Thu) by Yorick (subscriber, #19241)
Parent article: Linux on PowerPC

This is because the 64-bit PowerPC processors have no "32-bit mode" like the Intel 64/AMD64 architecture. Hence, 64-bit PowerPC programs that do not need 64-bit mathematical functions will run somewhat slower than their 32-bit counterparts because 64-bit pointers and long integers consume twice as much memory, fill the CPU cache faster, and thus need more frequent memory accesses.

PowerPC processors do have 32 and 64 bit modes, but in contrast to x86, the 32-bit mode is not restricted to fewer or smaller registers, so the only benefit of running something in 64-bit mode is the larger address space. "64-bit mathematical functions" have nothing to do with it; a 32-bit process can use 64-bit operations and registers.


(Log in to post comments)

Linux on PowerPC

Posted Jul 15, 2010 14:29 UTC (Thu) by nix (subscriber, #2304) [Link]

In this it is just like SPARC64, MIPS64, and indeed every 64-bit processor other than x86-64, as they didn't have decades of horrific baggage to drop like x86 did.

Linux on PowerPC

Posted Jul 15, 2010 18:14 UTC (Thu) by klossner (subscriber, #30046) [Link]

There's no mode bit in the hardware. The 32-bit ISA is just a subset of the 64-bit. Code that restricts itself to the 32-bit ISA can access only the low 32 bits of the integer registers.

The conflict is between the two ABIs. An object file compiled to use the 32-bit ABI will not inter-operate with one for the 64-bit ABI because, for example, it passes 64-bit function arguments in two registers instead of one.

Linux on PowerPC

Posted Jul 15, 2010 18:52 UTC (Thu) by Yorick (subscriber, #19241) [Link]

There's no mode bit in the hardware.

Yes there is (MSR[SF]). It mainly masks the upper 32 bits of the effective address, but also affects certain overflow and carry calculations.

The 32-bit ISA is just a subset of the 64-bit. Code that restricts itself to the 32-bit ISA can access only the low 32 bits of the integer registers.

That is correct, in that the 32-bit subset cannot "see" the upper bits, but it can change them. And, of course, a process in 32-bit mode can use the full 64-bit instruction set.

Linux on PowerPC

Posted Jul 19, 2010 17:31 UTC (Mon) by jengelh (subscriber, #33263) [Link]

>That is correct, in that the 32-bit subset cannot "see" the upper bits, but it can change them. And, of course, a process in 32-bit mode can use the full 64-bit instruction set.

On RISCs perhaps (SPARC: ldx), but unlikely on x86, or how would you invoke movq rax, rbx from an ELF32 on Linux?

Linux on PowerPC

Posted Jul 20, 2010 22:26 UTC (Tue) by Yorick (subscriber, #19241) [Link]

On RISCs perhaps (SPARC: ldx), but unlikely on x86, or how would you invoke movq rax, rbx from an ELF32 on Linux?

It was PowerPC that was under discussion.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds