-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
SPU LLVM: Improve approximate FCEQ/FCMEQ #8729
Conversation
any update? |
Kick this to master branch please... |
Pending a change + rebase that Whatcookie will push |
Rebased and added a simple optimization for comparisons against safe constants. |
} | ||
} | ||
|
||
if (safe_float_compare.any()) |
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.
Int comparison is preferred over float.
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.
There may be extra latency when switching between floating point and integer execution domains. It may be faster regardless on intel where floating comparisons are 4 cycle latency and int comparisons are 1 cycle, but on zen they're both 1 cycle so I think it's ideal to use the float comparison first since future intel cpus may also have fast floating comparisons like zen.
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.
Should be fine either way, it barely matters in practice.
- It's 100% accurate, but will sit under approx xfloat anyways - Attempts to use a single instruction when 1 value is constant
Accurately emulate SPU floating compare equals by using integer comparisons when the floating value will be interpreted as NAN by x86 hardware.