personal research: non-x86 architectures
|
Author | Content |
---|---|
gus3 Apr 21, 2009 11:19 PM EDT |
As one of my personal curiosities, I like to study the differences among CPU programming philosophies, e.g. the stack-based x86 vs. the window-based Sparc. As a testbed, I use a Collatz generator in C. I build it, then disassemble it using 'objdump -d' and capture the output. I have already looked at x86 (32- and 64-bit) and Sparc. I have no direct access to the following: ARM MIPS Power Cell PA-RISC Itanium Motorola 680x0 If anyone has access to any of these, with a running Linux plus GCC, please let me know. I'll supply the source and I only ask to build the program and disassemble it; no execution of the Collatz program is required. Before someone brings it up: building a cross-compiler is not an option for me. I clobbered an old system with a mis-configured GCC build, to the point of requiring a /usr wipe and system re-install. Thanks in advance. |
jezuch Apr 22, 2009 2:02 AM EDT |
Quoting:stack-based x86 Just a small nit-pick that in x86 only the floating point unit (x87) is stack-based and it's de-facto abandoned by now (replaced by SSE). The rest is plain old fixed register file (with lots of curiosities). But you probably knew that :) |
Sander_Marechal Apr 22, 2009 2:10 AM EDT |
@gus3: I have an iMac Indigo with a Power G3/400 processor running Debian Lenny. |
gus3 Apr 22, 2009 2:12 AM EDT |
A nit to pick back: If the x86 general architecture isn't stack-based, why did the 8086 designers add the BP register, and base it on SS by default rather than DS, but for stack-frame manipulation? Same goes for the ENTER and LEAVE instructions in the 80186. |
jezuch Apr 22, 2009 2:14 AM EDT |
Ah, *that* stack :) Sorry, I was confused by the fact that Java Virtual Machine is stack-based instead of register-based and in addition to regular method call stack. You could also include this as well in your research :) |
gus3 Apr 22, 2009 2:29 AM EDT |
Actually, the Sparc has a stack as well, to handle register spillage, but it's generally hidden from application programs. And if you want to get super-picky about it, 80x87 register stack overflow/underflow could also be handled as a spillage issue. But a well-designed compiler with an infix-to-RPN translator probably won't have to deal with that. |
DiBosco Apr 22, 2009 3:47 AM EDT |
Gus, I'm on holiday abroad at the mo, but when I get back I can *possibly* try it on an ARM Cortex A8. It's certainly running Linux, but as it's an embedded system the compiling tends to be cross-compiled on a host PC so I don't know whether the gcc is on the board itself. (I can certainly compile for ARM on x86.) |
Sander_Marechal Apr 22, 2009 5:05 PM EDT |
gus: The results for PowerPC G3 are in your LXer private mail. A good friend of mine owns a Chumby which has an ARM 926EJ processor. Would you like the output for that as well? |
Steven_Rosenber Apr 22, 2009 5:15 PM EDT |
Off-topic, but related: Sander, how much RAM do you have in the G3, and how do you like Lenny on it. I'm running a G4/466 MHz single-processor with 640 MB RAM, and it runs pretty well, but I get the feeling 1 GHz of CPU would really improve things ... (have to get my hands on a dual 500 MHz). |
hkwint Apr 22, 2009 5:31 PM EDT |
Stupid remark, but is it not an option to use some sort of emulator? Frankly, I don't know # about differences between CPU-architectures, but I do remember there's a Cell-emulator because people needed to build code before the thing itself was released to those people. Don't know if it's of any help, but I'd suggest you look if this can serve any of you reeds (for Cell): http://www.alphaworks.ibm.com/tech/cellsystemsim |
Sander_Marechal Apr 22, 2009 5:53 PM EDT |
@Steven: It's a G3 500 Mhz with 384 MB of RAM on board and Lenny runs just fine. It's not very fast of course but very usable. In terms of snappiness I think it's comparable to a not-quite-new install of Win98 on comparable hardware. |
You cannot post until you login.