64 bit optimizations

Started by
8 comments, last by DrPizza 19 years, 6 months ago
Hello, Following the news of the first game optimized for 64 bit processors (Shadow Ops: Red Mercury I think), it is told that it gains 20% (I think its more, but I can't remember the exact number) of performance increase. I wonder how can such gains be possible, from what I know, the increase is more memory and wider registers. Am I mistaken? I would like to know how 64 bit can give such performance gains. Thank you, JVFF
ThanQ, JVFF (Janito Vaqueiro Ferreira Filho)
Advertisement
and *more* registers :)
You get 16 general purpose registers, instead of the "usual" 8 on a 32 bit system.

I think that's the main reason for the performance gains.
Quote:wider registers

Yes, from what I've heard, the major performance gains come from the wider registers, sinc this is where information is handled the fastest.
[EDIT: Love it how a new post appears after I've written something down]
probably it's because 32-bit operations works slower on 64-bit processor or something, for example, alignment. I doubt they use 64-bit to add 2 32-bit values at once (and anyway 32-bit CPU can do that).
and yes,registers, but there's more registers not because it's 64 bit but for some other reason. _Most_ 32 bit CPUs have more registers, except 32bit x86.
The only reason is that you get double the registers, 64 bit alone would rather slow down, because you need to store 8 bytes, instead of 4 for every pointer.

There are a few special cases where wider registers also speed computations up, but that's hardly the case for games.
Thanks for your replys! So it is indeed just marketing of AMD, and the performance gains are the normal performance gains you get when optimizing for one single CPU (ie. having one target cpu). Thanks again,

JVFF
ThanQ, JVFF (Janito Vaqueiro Ferreira Filho)
Number of general purpose register is not that important nowadays when we have dynamic register renaming and fast L1 cache.
Quote:Original post by jvff
Thanks for your replys! So it is indeed just marketing of AMD, and the performance gains are the normal performance gains you get when optimizing for one single CPU (ie. having one target cpu). Thanks again,

JVFF


Why just AMD ? Intel trades the same technology as 'with 64 Bit Extensions'.

Quote:Number of general purpose register is not that important nowadays when we have dynamic register renaming and fast L1 cache.

Yes it is. Because you just can't rename anything and L1 is way slower than registers.

Quote:So it is indeed just marketing of AMD, and the performance gains are the normal performance gains you get when optimizing for one single CPU

No it's not. Hammers are normally faster in 64-bit Mode, EMT64T is _not_.
Quote:and L1 is way slower than registers

Rather an overstatement. Some L1 is accessible in a single cycle, which is not "way" slower, particularly when performing a multicycle operation.

Merely going 64-bit is, ceteris paribus, slower than 32-bit (assuming that in both cases you have ample virtual memory). Reason being, the larger pointers and integers create more cache/memory pressure.

But the abominable x86-64 also adds more architectural (i.e. directly usable) registers. Sure, rename registers can mitigate lack of architectural registers to a fair degree. But they're not as good as the real thing.
char a[99999],*p=a;int main(int c,char**V){char*v=c>0?1[V]:(char*)V;if(c>=0)for(;*v&&93!=*v;){62==*v&&++p||60==*v&&--p||43==*v&&++*p||45==*v&&--*p||44==*v&&(*p=getchar())||46==*v&&putchar(*p)||91==*v&&(*p&&main(0,(char**)(--v+2))||(v=(char*)main(-1,(char**)++v)-1));++v;}else for(c=1;c;c+=(91==*v)-(93==*v),++v);return(int)v;}  /*** drpizza@battleaxe.net ***/

This topic is closed to new replies.

Advertisement