mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-08 09:09:46 +00:00
asm: Avoid ALU instructions on busy wait cycles
This commit is contained in:
parent
940e726754
commit
0d9b1654ec
1 changed files with 2 additions and 2 deletions
|
@ -358,9 +358,9 @@ namespace utils
|
||||||
// Synchronization helper (cache-friendly busy waiting)
|
// Synchronization helper (cache-friendly busy waiting)
|
||||||
inline void busy_wait(usz cycles = 3000)
|
inline void busy_wait(usz cycles = 3000)
|
||||||
{
|
{
|
||||||
const u64 start = get_tsc();
|
const u64 stop = get_tsc() + cycles;
|
||||||
do pause();
|
do pause();
|
||||||
while (get_tsc() - start < cycles);
|
while (get_tsc() < stop);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Align to power of 2
|
// Align to power of 2
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue