Author Topic: using 32bit reg and memory move faster even in 16bit mode?  (Read 353 times)

daydreamer

  • Member
  • *****
  • Posts: 1150
  • I also want a stargate
using 32bit reg and memory move faster even in 16bit mode?
« on: January 11, 2020, 10:20:20 PM »
I read that 32bit cpu are optimised, to run 32bit instructions
In 32bit mode,so you should avoid run old 16bit code
Is it the same if you run 16bit mode with or without emulator
Code mov eax,mem. Mul ebx, div ebx, memory move with use 32bit chunks faster even if larger opcodes+ prefix?
Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
Gone serverside programming p:  :D
I love assembly,because its legal to write
princess:lea eax,luke
:)

FORTRANS

  • Member
  • *****
  • Posts: 1064
Re: using 32bit reg and memory move faster even in 16bit mode?
« Reply #1 on: January 12, 2020, 12:22:24 AM »
Hi,

   The original Pentium Pro processor was optimized
to run 32-bit code at some expense to running 16-bit
code.  This is when you compare it to the original
Pentium family of processors.  As the Pentium Pro
usually had a faster clock, it rarely ran 16-bit code
slower than a Pentium.  But its 32-bit performance
was so much better that it was a topic of discussion
at the time.

   Running 32-bit code in a 16-bit execution mode
seems to work okay, though I have only done so in
a few cases.  To know relative speeds of 16-bit and
32-bit code in a 16-bit mode, you would have to run
your own benchmarks to test your particular CPU or
emulator.  There are too many CPU generations since
the Pentium and Pentium Pro to make a blanket
statement about absolute performance.  It seems
logical that loading or storing 32-bit values using 32-bit
code would be faster than the equivalent 16-bit code.
But how much faster?  you would have to run a test.

Regards,

Steve N.

daydreamer

  • Member
  • *****
  • Posts: 1150
  • I also want a stargate
Re: using 32bit reg and memory move faster even in 16bit mode?
« Reply #2 on: January 12, 2020, 01:46:36 AM »
I think I try time big loops with different functions and change from old int's(16bit) to old long's(32bit) to see if there is any difference
but need to set a fixed freqency energy mode,to not get timings disturbed by turbo varying clock freqency
my old game programming book from PII's and PIII's time tell use 32bit for modern
could as well test modern built in fpu speed too

but it makes sense that AMD and Intel dont waste money/time to improve obsolete 16bit,that is even way too fast,for old retrogames anyway,dont know if they stopped improvement on 32bit in favour of 64bit mode only?

 
Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
Gone serverside programming p:  :D
I love assembly,because its legal to write
princess:lea eax,luke
:)

jj2007

  • Member
  • *****
  • Posts: 10092
  • Assembler is fun ;-)
    • MasmBasic
Re: using 32bit reg and memory move faster even in 16bit mode?
« Reply #3 on: January 12, 2020, 02:47:31 AM »
Back in the old days when I had a 32-bit OS I made several broad tests, and while I cannot find the results any more, it was pretty clear that 32-bit code runs a factor 6-7 faster than equivalent 16-bit executables. Which is btw one reason why I don't care about 64-bit code - it's sometimes 6-7% faster, but often even a bit slower than the 32-bit equivalent.

daydreamer

  • Member
  • *****
  • Posts: 1150
  • I also want a stargate
Re: using 32bit reg and memory move faster even in 16bit mode?
« Reply #4 on: January 12, 2020, 03:51:34 AM »
Back in the old days when I had a 32-bit OS I made several broad tests, and while I cannot find the results any more, it was pretty clear that 32-bit code runs a factor 6-7 faster than equivalent 16-bit executables. Which is btw one reason why I don't care about 64-bit code - it's sometimes 6-7% faster, but often even a bit slower than the 32-bit equivalent.
thanks
anyway real4's,real8's ,even real10's is worth testing too against 64bit integer,interesting to see if there is much or little speed advantage to switch from more versatile floating point on modern cpu vs 64bit integer,when huge numbers are needed

 
Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
Gone serverside programming p:  :D
I love assembly,because its legal to write
princess:lea eax,luke
:)