-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Rounding issues on ARM #10127
Comments
On ARM:
but on x86,
|
It looks like a problem with |
Would we be using |
How do I use |
I don't have an ARM machine, so I can't try it, but maybe something like: function getfpscr()
Base.llvmcall("""%0 = call i32 @llvm.arm.get.fpscr()
ret i32 %0""", UInt32, ())
end It might throw "Failed to parse LLVM Assembly" the first time you run it: if so just run it again (this is due to #8740). See also my code for playing around with the SSE register on x86: |
I assume that this line means that we use the system |
That is what we did back then. Are we better off going through LLVM? |
I don't think LLVM offers |
That LLVM issue has been open for almost 5 years now! |
Yeah: it would be useful if we ever want floating-point exceptions to work correctly, but it doesn't seem like it is going to get fixed any time soon. It could be an interesting GSOC project, if you could find someone able to supervise it? |
The linux system manpage for
I also found the following in OpenBSD sources:
It appears that we are not going to have all the rounding modes anytime soon on ARM. The thing to do here would be to avoid running these tests on ARM, at least for now. |
Good catch. Trying to set rounding mode to anything other than round-to-nearest should probably result in an error or at least a warning on ARM then. |
To be fair, instruction specific rounding is much more useful. We could emulate a global mode, similar to how we do |
Probably we need to disable rounding for arm and just give an appropriate error message. This would be sufficient to close this for now. |
This is actually caused by the build not picking up the right constant for AFAICT what ARM and AArch64 have are
We don't require NEON on ARM (so no simd =( ) so the ARM generic binary should support rounding mode. Native arch ARM binaries may not but only in a vectorized loop or with fast math set in which case the rounding mode probably doesn't matter.... |
This evaluates to true on x86, but to false on ARM (from rounding.jl)
The text was updated successfully, but these errors were encountered: