View Single Post
07-05-13, 04:30 PM   #13
watchout
A Fallenroot Satyr
Join Date: Mar 2008
Posts: 20
  • x86 32 Bit processors have 8 general purpose Registers
  • x86-64 processors have 16 general purpose Registers
  • x86-64 processors in 32 bit mode use only 8 of their 16 general purpose Registers
This difference alone makes 64 bit mode quite superior, as a compiler is able to generate more efficient object code with 16 registers available. Of course a compiler has to be changed to take advantage of the additional 8 registers, but all (or lets say "most" as I can't possibly know all) current compiler suites are. Anyway, Lua benefits quite a lot from those additional registers.

The guys from LuaJit took the time to make benchmarks for their variant of Lua, but you can also use their benchmark site to compare standard Lua with a 64 Bit compile: http://luajit.org/performance_x86.html

The media instructions are not bad either, but they can be used whether in 64 Bit mode or not, as they are from the various MMX/SSE/3Dnow instruction sets. However, in 64 Bit mode, the CPU also uses 8 additional XMM registers (for a total of 16). This also should affect performance positively. I can't imagine this benefiting Lua though, and well, I don't know. The general purpose registers are one thing, but I don't think the additional SSE registers get used that often. But best be on the safe side, you can never have too many registers

If you want, you can read up on most of that stuff here: http://developer.amd.com/resources/d...uides-manuals/ (yes, AMD was the one who designed x86-64), the "Manuals" section will probably be the most interesting at first
  Reply With Quote