Subscribe to
Posts
Comments
NSLog(); Header Image

64 Bits vs. 32 Bits

Many people seem to think that an entire OS needs to be rewritten when the processors on which it runs switch from 32 to 64 bit. From what (very little) I know about OS and software development, that's simply not true. The primary reason to move an OS to a 64-bit processor is to allow for addressable RAM. The secondary reason may be to speed up "core" functions like "copy this data" (like 2 MB of RAM, perhaps). A 64-bit chip will be able to do that twice as fast as a 32-bit chip, all other things being equal.

Usually, switching from 32 bits to 64 bits means new opcodes (CPU commands), so switching from a 32 bit PowerPC to a 64 bit PowerPC would be the same as switching from 32 bit PowerPC to 64 bit AMD. What's unique about the PowerPC 970 is that it provides 32-bit compatibility, easing the burden on those OS developers while providing ample avenue for gradual growth.

Keep in mind one thing: 95% (I'm making that number up - but it's quite high) of the calculations occurring on your computer's CPU(s) are quite simple. They're typically just integer math, and 32 bits is often too much space for that. You can address more memory - and that's good - but does adding 193 and 6943 take more than a few bits? Nah.

12 Responses to "64 Bits vs. 32 Bits"

  1. 64 bits also allows for a much greater floating point precision which can be of interest to those developing multimedia codecs.

    ooooh, pretty colors 🙂

  2. One thing I noticed that stood out.

    A technote at the ADC site (when did they redesign?) said that the address bus on the G5 was 42 bits, not 64.

    Anyone care to venture a guess on what effect that'll have? I'd think that would mean you'd not get the full addressability you'd get with 64 bits, but maybe there's some mojo I don't know.

  3. 42 bits is still a very big address bus..

    2^42 = 4398046511104 bytes = 4294967296 kilobytes = 4194304 megabytes = 4096 gigabytes

    so unless you were planning on putting more than 4096 gigabytes (aka 4 terabytes) in your new PowerMac, you won't have any problem. 🙂

    I doubt anyone will ever build a PowerPC with a 64 bit address bus. That would be absurd.

  4. Switching from 32-bit PowerPC to 64-bit PowerPC is I NO WAY similar to switching from 32-bit PPC to 64-bit AMD. Yes, 64-bit PPC adds new opcodes - but it also keeps all of the preexisting 32-bit opcodes. Switching to 64-bit AMD would involve a complete change in all opcodes, rendering current software completely incompatable and burdening Mac users with the same crap that PC users will probably have to deal with when x86-64 goes mainstream (Unless Intel really fixes x86/Itanic, it will never go mainstream).

    As for the memory addressing, you have to understand that there are a number of different memory addressing schemes used in modern operating systems. The 42-bit address bus is the physical address size - the address size that the CPU can address to the memory controller. The U3 memory controller on the G5 can access 16GB of RAM, while the G5 can access 4TB of RAM (as such, the CPU is typically at the mercy of the memory controller on how much RAM it can actually address). Physical addressing is all fine and dandy, but user programs typically ignore it completely. Instead, user programs operate in logical addresses. Logical addresses can extend over the complete 64-bit space offered by the hardware for far more memory than you will probably need for your lifetime (don't quote me on that). When a memory request is made, logical addresses are converted on the fly to physical addresses and the program is none the wiser.

  5. @Rincewind (32->64): maybe you should read the sentence that's following this statement.

    And the G4 processor can address 4GB, not 16GB of RAM without workarounds (like paging).

    @Tim: no one will ever need more than 640kBytes of RAM, right?

  6. Andreas: As far as I know, no one needed more than 640K of RAM with the then-current generation of processors. When 4096GB of RAM is cheap enough to realistically install in a consumer-level computer, I'm sure the G5 will be a distant memory. (Pun not intended! Really!)

  7. no offence, but you guys seem to be making comparisons between things you don't understand.

    point 1:

    switching from 32 bits to 64 bits needs an OS recompile so that your computer will actually be using 64 bit instructions... otherwise you might as well just keep using your 32-bit machines.

    point 2:

    AMD-64 has complete backwards compatibility to x86-32 so x86 users will feel no software loss in the transition... and can keep playing their new copy of half-life 2 on their new machine. if Rincewind was thinking of IA64 he might be a little more accurate, though the IA processor actually still have an x86-32 compatibility mode but IA-64 instructions are native. IA is by the way a mind bogglingly complex chip based on completly new architecture designs. PPC uses 10 registers, x86 uses 8, and IA uses 128. its a parallel instruction executing beast based on EPIC (VLIW to transmeta) architecture. for those not in the know ther is now CISC RISC and EPIC/VLIW for processor architectures.

    so lets not try and make this one of those my mac has so many less problems than the man's PC issues. they are all number crunching devices. they do the same thing. some people like one button some people like 3 buttons and a scrolly. its taken about 5 years for them to make the g5 work. the g5 core has been around since the mid 90s (if i rememebr correctly)... i am amazed they addapted it to PPC at all and managed to save the compatibility on top of that. its a rather freakish miracle compared to AMDs 64 bit roadmap which was a simple extention of their pre-existing athlon core.

    on a technical note, does anyone know how many registers the g5 has? did they double them to 20?

  8. Last time I wrote some PPC asm, it had 32 general use registers. I don't think they scaled that down since then.

  9. PPC uses 10 registers

    [...]

    on a technical note, does anyone know how many registers the g5 has? did they double them to 20?

    No, dobesov, the PowerPC architecture from day one has had 32 integer registers and 32 floating point registers. Where did you get your information?

    i am amazed they addapted it to PPC at all and managed to save the compatibility on top of that.

    The POWER4 is a descendant of the POWER architecture, which was where the PowerPC architecture was derived. They've always been related, so it's not a miracle like you say.

    Avi

  10. Ok, I got the G5 specification (available here, 9xx 64-bit Microprocessors: PowerPC 970, Programming Environments Manual).

    The G5 has 32 general use registers, 32 floating point registers and some special use registers (see pdf page 54).

  11. look liek i was wrong about those registers. pretty sure i hasd read that somewhere in an IA article guess i was wrong. i was speaking of general registers as well not that that makes anything less correct. you will have to forgive me, i have never ASM codded on a PPC, lol.

    But the one thing i do know is that i have been following the attempts by motorola to adapt the g5 logical core to ppc64 since about 98-99. i did a great deal of research into what exactly the whole Gx processors meant only to find that we are up to about G8 now. i could be wrong about that number. i was shocked to find the first stated use of the G3 as a CISC chip in IBM servers. i had to know more about the discontinuity between Gx and the PPC ISA. and discovered that the Gx processors were not made for PPC but addapted to it later. this is where i found out that motorola had been going through hell and high water trying to take the 64 bit G5 and apply PPC to it. their chips were unstable or didn't run backwards to 32 bit or they just couldn't achieve contemporary clock speeds. IBM actually made the starement that it had quit and was going to attempt to extend its G4 design (keep in mind that IBM and motorola actually fight each other for these things) so thats why i was rather shocked when out of the blue the G5 finally arrived.

  12. Actually, most of the good CPU developers at Motorola moved to AMD some time ago.