Board index » delphi » Id software Pentium optimization..?

Id software Pentium optimization..?


2006-03-17 06:03:21 PM
delphi93
I found this on Slashdot:
ask.slashdot.org/comments.pl
Quote:
" With the Quake series, idSoftware found the Intel 32-bit integer loads
from memory to 32-bit general-purpose register to be piss-poor slow. With a
little tinkering, they found that on the Pentium, loading two 32-bit
integers into a 64-bit floating point register, and then moving those
integers from register to register was much faster[...]"
Is it true that this way of doing things can be faster? And if so, is it
still true on newer prosessors ?
-Dag
 
 

Re:Id software Pentium optimization..?

"Dag Fjeld Edvardsen" <dfe who is located on byggforsk dot no>wrote in
message news:441a8969$XXXX@XXXXX.COM...
Quote
I found this on Slashdot:
ask.slashdot.org/comments.pl

Quote:
" With the Quake series, idSoftware found the Intel 32-bit integer loads
from memory to 32-bit general-purpose register to be piss-poor slow. With
a little tinkering, they found that on the Pentium, loading two 32-bit
integers into a 64-bit floating point register, and then moving those
integers from register to register was much faster[...]"

Is it true that this way of doing things can be faster? And if so, is it
still true on newer prosessors ?

-Dag
Moving large blocks of data is certainly faster using the FPU rather than
the 32-bit registers (mainly because there are half the number of moves).
For block moves, I can not understand why loading the FPU from two 32-bit
registers is even necessary. It is faster to just load the FPU register
directly from memory.
--
regards,
John
The Fastcode Project:
www.fastcodeproject.org/
 

Re:Id software Pentium optimization..?

Quote
>" With the Quake series, idSoftware found the Intel 32-bit integer loads
>from memory to 32-bit general-purpose register to be piss-poor slow. With
>a little tinkering, they found that on the Pentium, loading two 32-bit
>integers into a 64-bit floating point register, and then moving those
>integers from register to register was much faster[...]"
I can not understand why loading the FPU from two 32-bit registers is even
necessary. It is faster to just load the FPU register directly from
memory.
I'm not quite sure if I understand your answer in the context of the
original post? The above quote said (to rephase it): "It is faster to load
64-bit into an FPU register and then from there into 2 integer registers
then to load the 2 32-bit integers directly into 2 integer registers".
Cheers,
Thorsten
 

Re:Id software Pentium optimization..?

Quote
I'm not quite sure if I understand your answer in the context of the
original post? The above quote said (to rephase it): "It is faster to load
64-bit into an FPU register and then from there into 2 integer registers
then to load the 2 32-bit integers directly into 2 integer registers".
Yes, that was the intention of my question.
-Dag
 

Re:Id software Pentium optimization..?

Quote
Quote:
" With the Quake series, idSoftware found the Intel 32-bit integer
loads from memory to 32-bit general-purpose register to be piss-poor
slow. With a little tinkering, they found that on the Pentium,
loading two 32-bit integers into a 64-bit floating point register,
and then moving those integers from register to register was much
faster[...]"

Is it true that this way of doing things can be faster? And if so, is
it still true on newer prosessors ?
I could be wrong, but as far as i have seen there exists no instruction
that can move the data from floating point registers directly into
integer registers. FST(P) and even fist(P) and fistTP do not allow this.
MMX can do stuff like this, but Quake existed before MMX (1996 vs 1997).
With MMX you can try using the MOVD to get the low-order DWORD,
shifting using PSRLQ and then using MOVD again to get the high-order
DWORD.
--
The Fastcode Project: www.fastcodeproject.org/
 

Re:Id software Pentium optimization..?

Quote
MMX can do stuff like this, but Quake existed before MMX (1996 vs 1997).
Don't MMX registers map to the mantissa of FPU registers?
Eric
 

Re:Id software Pentium optimization..?

Quote
>MMX can do stuff like this, but Quake existed before MMX (1996 vs
>1997).

Don't MMX registers map to the mantissa of FPU registers?
Yes they do. However without any instructions to move FPU or MMX
registers directly into general purpose registers this would be no use.
AFAICS there are no FPU instructions which can do this and Quake
probably didn't use MMX (at least not from the start).
--
The Fastcode Project: www.fastcodeproject.org/