37

Obviously, a 64-bit processor has a 64-bit address space, so you have more than 4 GB of RAM at your disposal. Does compiling the same program as 64-bit and running on a 64-bit CPU have any other advantages that might actually benefit programs that aren't enormous memory hogs?

I'm asking about CPUs in general, and Intel-compatible CPUs in particular.

Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477

7 Answers7

34

There's a great article on Wikipedia about the differences and benefits of 64bit Intel/AMD cpus over their 32 bit versions. It should have all the information you need.

Some on the key differences are:

  • 16 general purpose registers instead of 8
  • Additional SSE registers
  • A no execute (NX) bit to prevent buffer overrun attacks
Sean
  • 60,939
  • 11
  • 97
  • 136
  • The no execute bit exists on 32-bit architectures too. – flodin Mar 03 '09 at 17:47
  • 4
    Yes, but it only works at the segment level. Most OSs use a flat model, so they can't turn it on or they'd no-execute the entire address space! The 64 bit chips allow you to set it on a page level. Take a look at http://en.wikipedia.org/wiki/NX_bit for more info. – Sean Mar 03 '09 at 17:54
  • Sweet - I never knew that before – Joshua McKinnon Mar 03 '09 at 18:21
  • 4
    @Sean, no it **used** to be at a segment level, But current 32-bit procs with PAE enabled have regular page level NX support. – Evan Teran Mar 03 '09 at 18:26
  • To quote: x86 processors, since the 80286, included a similar capability implemented at the segment level. However, current operating systems implementing the flat memory model, do not use this capability. (note that it says "included" not "includes"). – Evan Teran Mar 03 '09 at 18:27
  • Further more, from the same Wikipedia article: "After AMD's decision to include this functionality in its AMD64 instruction set, Intel implemented a similar feature in x86 processors beginning with the Pentium 4 processors based on later iterations of the Prescott core." – Evan Teran Mar 03 '09 at 18:28
  • 7
    On a general non-Intel point, some 32 bit processors had 16 General Purpose Registers and a bunch of Floating Point registers back in the 1970's. Intel and co are catching up! – Simon Knights Mar 03 '09 at 22:13
  • 3
    * Can move RIP to a register. Important for PIC * new baseline for minimal support. x86 extensions like SSE2 and cmov are now guaranteed there. – Marco van de Voort May 02 '09 at 14:59
  • You are talking about advantages of AMD64 over x64. But the qusetion doesn't mention any specific architecture. – CITBL Dec 26 '19 at 10:36
25

The main advantage of a 64-bit CPU is the ability to have 64-bit pointer types that allow virtual address ranges greater than 4GB in size. On a 32-bit CPU, the pointer size is (typically) 32 bits wide, allowing a pointer to refer to one of 2^32 (4,294,967,296) discrete addresses. This allows a program to make a data structure in memory up to 4GB in size and resolve any data item in it by simply de-referencing a pointer. Reality is slightly more complex than this, but for the purposes of this discussion it's a good enough view.

A 64-bit CPU has 64-bit pointer types that can refer to any address with a space with 2^64 (18,446,744,073,709,551,616) discrete addresses, or 16 Exabytes. A process on a CPU like this can (theoretically) construct and logically address any part of a data structure up to 16 Exabytes in size by simply de-referencing a pointer (looking up data at an address held in the pointer).

This allows a process on a 64-bit CPU to work with a larger set of data (constrained by physical memory) than a process on a 32 bit CPU could. From the point of view of most users of 64-bit systems, the principal advantage is the ability for applications to work with larger data sets in memory.

Aside from that, you may get a native 64-bit integer type. A 64 bit integer makes arithmetic or logical operations using 64 bit types such as C's long long faster than one implemented as two 32-bit operations. Floating point arithmetic is unlikely to be significantly affected, as FPU's on most modern 32-bit CPU's natively support 64-bit double floating point types.

Any other performance advantages or enhanced feature sets are a function of specific chip implementations, rather than something inherent to a system having a 64 bit ALU.

ConcernedOfTunbridgeWells
  • 64,444
  • 15
  • 143
  • 197
3

This article may be helpful:

http://www.softwaretipsandtricks.com/windowsxp/articles/581/1/The-difference-between-64-and-32-bit-processors

This one is a bit off-topic, but might help if you plan to use Ubuntu:

http://ubuntuforums.org/showthread.php?t=368607

And this pdf below contains a detailed technical specification:

http://www.plmworld.org/access/tech_showcase/pdf/Advantage%20of%2064bit%20WS%20for%20NX.pdf

dincerm
  • 1,455
  • 1
  • 9
  • 9
  • Concerning the Ubuntu forums links: "The administrator may have required you to register before you can view this page." That's inconvenient. – leetNightshade Nov 25 '13 at 19:19
3

Slight correction. On 32-bit Windows, the limit is about 3GB of RAM. I believe the remaining 1GB of address space is reserved for hardware. You can still install 4GB, but only 3 will be accessable.

Personally I think anyone who hasn't happily lived with 16K on an 8-bit OS in a former life should be careful about casting aspersions against some of today's software starting to become porcine. The truth is that as our resources become more plentiful, so do our expectations. The day is not long off when 3GB will start to seem ridiculously small. Until that day, stick with your 32-bit OS and be happy.

cjs
  • 25,752
  • 9
  • 89
  • 101
T.E.D.
  • 44,016
  • 10
  • 73
  • 134
  • 1
    Hi from the future, 3GB seems ridiculously small when I'm sitting here with 32GB. – CHollman82 Mar 25 '21 at 18:58
  • 1
    @CHollman82 - Kind of sad how little extra we here in the future are doing with all that extra RAM we need too. :-( – T.E.D. Mar 25 '21 at 19:03
1

Just wanted to add a little bit of information on the pros and cons of 64-bit CPUs. https://blogs.msdn.microsoft.com/joshwil/2006/07/18/should-i-choose-to-take-advantage-of-64-bit/

Nayuki
  • 17,911
  • 6
  • 53
  • 80
Wei Hu
  • 2,888
  • 2
  • 27
  • 28
1

About 1-3% of speed increase due to instruction level parallelism for 32-bit calculations.

vartec
  • 131,205
  • 36
  • 218
  • 244
-1

The main difference between 32-bit processors and 64-bit processors is the speed they operate. 64-bit processors can come in dual core, quad core, and six core versions for home computing (with eight core versions coming soon). Multiple cores allow for increase processing power and faster computer operation. Software programs that require many calculations to function operate faster on the multi-core 64-bit processors, for the most part. It is important to note that 64-bit computers can still use 32-bit based software programs, even when the Windows operating system is a 64-bit version.

Another big difference between 32-bit processors and 64-bit processors is the maximum amount of memory (RAM) that is supported. 32-bit computers support a maximum of 3-4GB of memory, whereas a 64-bit computer can support memory amounts over 4 GB. This is important for software programs that are used for graphical design, engineering design or video editing, where many calculations are performed to render images, drawings, and video footage.

One thing to note is that 3D graphic programs and games do not benefit much, if at all, from switching to a 64-bit computer, unless the program is a 64-bit program. A 32-bit processor is adequate for any program written for a 32-bit processor. In the case of computer games, you'll get a lot more performance by upgrading the video card instead of getting a 64-bit processor.

In the end, 64-bit processors are becoming more and more commonplace in home computers. Most manufacturers build computers with 64-bit processors due to cheaper prices and because more users are now using 64-bit operating systems and programs. Computer parts retailers are offering fewer and fewer 32-bit processors and soon may not offer any at all.

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
Kevin M
  • 5,436
  • 4
  • 44
  • 46
  • 64 bit processors are not inherently faster and nothing prevents you from making a 32 bit multicore processors. – CITBL Dec 26 '19 at 10:40