mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-29 00:33:01 +00:00
asm: Avoid ALU instructions on busy wait cycles
This commit is contained in:
parent
940e726754
commit
0d9b1654ec
@ -358,9 +358,9 @@ namespace utils
|
||||
// Synchronization helper (cache-friendly busy waiting)
|
||||
inline void busy_wait(usz cycles = 3000)
|
||||
{
|
||||
const u64 start = get_tsc();
|
||||
const u64 stop = get_tsc() + cycles;
|
||||
do pause();
|
||||
while (get_tsc() - start < cycles);
|
||||
while (get_tsc() < stop);
|
||||
}
|
||||
|
||||
// Align to power of 2
|
||||
|
Loading…
x
Reference in New Issue
Block a user