mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-13 22:00:42 +02:00
This optimization was only written for Ampere1A where it showed a noticable performance improvement in #5321. On Cortex it didn't matter. Turns out this actually hits a bad case on Oryon CPUs where `dc zva` is actually dramatically slower in the face of memory barriers and overlapping stores in flight. So now just detect Ampere and only use the optimization on that hardware and send everyone else down the regular path. microbench A1A: ``` Cycle counter frequency: 1000000000 Cycle counter granularity: 20 ns in cycle: 1 suite: memory Test, Total Cycles, Iterations, Cycles Average, Iter Time Average, iterations/Second dc zva - vzeroupper, 723390880, 363855872, 1.99, 1.99 nanosecond, 502986534.75 dc zva - vzeroall, 571708060, 161742848, 3.53, 3.53 nanosecond, 282911610.52 dc zva (stp emu) - vzeroupper, 541543980, 107872256, 5.02, 5.02 nanosecond, 199193897.42 dc zva (stp emu) - vzeroall, 722548940, 71958528, 10.04, 10.04 nanosecond, 99589832.63 ``` microbench X2E: ``` Cycle counter frequency: 19200000 Cycle counter granularity: 1 ns in cycle: 52.083333333333336 suite: memory Test, Total Cycles, Iterations, Cycles Average, Iter Time Average, iterations/Second dc zva - memset 0, 12065162, 49, 246227.80, 12.82 millisecond, 77.98 dc zva - vzeroupper, 12098598, 4325376, 2.80, 145.68 nanosecond, 6864201.89 dc zva - vzeroall, 12031459, 4325376, 2.78, 144.87 nanosecond, 6902506.11 dc zva (stp emu) - vzeroupper, 13899441, 363855872, 0.04, 1.99 nanosecond, 502612496.60 dc zva (stp emu) - vzeroall, 12389283, 161742848, 0.08, 3.99 nanosecond, 250657175.37 ```