-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEXCore: Implements an efficient spin-loop API #3337
Conversation
e51a16a
to
ab26151
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went over this for a general first pass.
As usual newly added abstractions can be reviewed more effectively when there's code that actually uses them, so a follow-up draft PR for the adapted backpatching would help here.
FEXCore/Source/Utils/FutexSpinWait.h
Outdated
class FutexSpinWait final { | ||
public: | ||
#ifdef _M_ARM_64 | ||
template<typename T, typename TT> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need different integer-sizes for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the following idiom is the expected use-case and enforcing an integer literal on the second argument is a pita.
uint8_t *VariablePtr;
FEXCore::Utils::FutexSpinWait::Wait(VariablePtr, 0);
This will only be used internally inside of FEXCore for efficient shared codecach backpatch spin-loops.
ab26151
to
567666c
Compare
To show the usage of the efficient spin-loop API for FEX-Emu#3337 Doesn't guarantee any safety becuase currently code isn't shared between threads and that's going to take more time to implement.
#3338 |
Thanks, but there was no confusion on the intended usage of the new API. Before adding new code for a primitive, I think it's reasonable to have a concrete use case where it's demonstrably a better solution than the alternatives to justify its addition. |
This will only be used internally inside of FEXCore for efficient shared codecach backpatch spin-loops.