Author Topic: Branch Misprediction  (Read 1207 times)

Siekmanski

  • Member
  • *****
  • Posts: 1756
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.
:t

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.

etc.
Creative coders use backward thinking techniques as a strategy.

LordAdef

  • Member
  • ****
  • Posts: 627
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 ...

daydreamer

  • Member
  • ****
  • Posts: 658
  • watch Chebyshev on the backside of the Moon
Re: Branch Misprediction
« Reply #17 on: January 12, 2019, 07:58:07 PM »

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.

etc.
I look forward to test timers for synchronize several threads working together
LOCK prefix maybe needs to be used?
rdrand vs simplest randomgenerator used in perlin noise would be interesting to test against each other
I think we should add D nobranch test:SIMD comparisions so we know how much worth the time spending on getting nonbranch code right and how much gain/loss?
Quote from Flashdance
Nick  :  When you give up your dream, you die.m
*wears a flameproof asbestos suit*
I have no idea how to compare beauty of two real8 women with SSE
If you switch to C++, x86 means 086h, which is wrong cpu
So don't switch to C++   p: