-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[MIPS] Implement llvm.fminimum and llvm.fmaximum with f32/f64 #89907
base: main
Are you sure you want to change the base?
Conversation
e765a8b
to
a3047c3
Compare
@Cyanoxygen the CI test fails. |
Let me examine the log. |
Maybe the problem is on this merge |
b8ae81f
to
07203b1
Compare
For |
07203b1
to
6c7457f
Compare
The implementation used various checks against signed zeroes and NaNs to ensure the correct value is returned.
6c7457f
to
f2b9290
Compare
I think that this logic may introduce better performance:
Can you have consider it? |
preliminary checks are essential since we do not know what value actually is in the operands, and since minnum and maxnum returns other operand if NaN exists, we have to check if there's any NaN in them. I have a “slightly better” version in mind, which might handle the edge case. Again, preliminary checks are essential:
Which roughly translates to:
|
Maybe it is better for R6, but not for pre-R6.
max.fmt in R6 can process +0/-0 as |
Oh yes you are right. min/max.fmt actually considers +0 > -0. |
Converting back to draft, while I working on the logic based on the discussion above. |
I figure out a pre-R6 asm code
I will feed back it to glibc. |
I just discovered that the logic above has a loophole. If X is a NaN, and Y is a real number, then the real number will be returned. As this gets way complicated to implement, I would like to keep the original implementation. But we can handle this specifically for R6. |
Depends on the following PR:
Closes #64207