-
Notifications
You must be signed in to change notification settings - Fork 98
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
Creation of basic quantities is not zero-cost #143
Comments
Thanks for such a detailed report, especially the LLVM-IR. My guess is that Lines 291 to 305 in c02d306
As an aside you don't need to explicitly reference the system and storage type all the time. Type aliases in the |
Thank you, I'm familiar with
|
Use a default constant of `-0.0` to allow for floating point optimizations. For a value, `v: Float`, adding `-0.0` is a no-op while adding `0.0` will change the sign if `v` is `-0.0`. Resolves #143. v 0.0 + -0.0 = 0.0 -0.0 + 0.0 = 0.0 # v + 0.0 != v -0.0 + -0.0 = -0.0
Use a default constant of `-0.0` to allow for floating point optimizations. For a value, `v: Float`, adding `-0.0` is a no-op while adding `0.0` will change the sign if `v` is `-0.0`. Resolves #143. v 0.0 + -0.0 = 0.0 -0.0 + 0.0 = 0.0 # v + 0.0 != v -0.0 + -0.0 = -0.0
Compiling the following program produces an extra
0.0f + value
operation in everyAngle::new()
call:The pertaining LLVM-IR output is:
I even tried compiling with
-ffast-math
but had no success.The text was updated successfully, but these errors were encountered: