Author Topic: Branch Misprediction  (Read 799 times)


  • Member
  • *****
  • Posts: 1709
Re: Branch Misprediction
« Reply #15 on: November 10, 2018, 05:13:53 AM »
I usually follow the RDTSC route, today I followed the method inherited from the other thread which has also some advantages, in my opinion.

The timers are not to calculate routine execution times.
These timers are meant to run simultaneous in realtime to control multimedia events in games or demos.

for example:

- timer 1 controls the time to switch to the next scene.
- timer 2 controls when a flock of birds fly over.
- timer 3 controls the duration of a bullet salvo.
- timer 4 controls when an UFO enters the earth orbit.

Creative coders use backward thinking techniques as a strategy.


  • Member
  • ****
  • Posts: 606
Re: Branch Misprediction
« Reply #16 on: November 10, 2018, 09:37:49 AM »
Hi jose, Thanks for carrying the tourch!
Code: [Select]
Unpredictable Branching Performance Test using xorshift32 begins:

Test A (Branching):  1452.756573     esi: 100007857

Test B (No Branching/Using SETCC):  679.610210     esi: 99997780

Test C (No Branching/Using CMOV):  588.437494     esi: 100011413

Press any key to continue ...