-
-
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
make @fastmath mirror how lowering applies literal_pow #53819
Conversation
Per CONTRIBUTING.md, please provide a good description of what the PR does:
It's very cumbersome to have to go through three layers of indirection when looking at the history of a file (the change itself, this PR, and finally the issue itself) to figure out what exactly was broken with |
Sorry for the inconvenience - I wanted to avoid repeating the error description for the issue. I added a description of what has been changed. |
Thank you! |
LGTM, although it would probably be good to add performance results to the PR, and ideally an example to the base benchmarks so we can see if this regresses. |
No performance changes are expected during runtime, because only the macro logic is changed. The cases, which behave different do not exhibit changed performance figures. The 4th example in the changed For the cases, which now create different runtime code: NEW: Version 1.12.0-DEV.233 (2024-03-22) krc/fastmath-literalpow/8615c0bdff
OLD: Julia Version 1.12.0-DEV.225
|
Looks good to me. |
My only hesitation — both here and in #53713 is that this really seems to be a bug in the Julia-flisp interface that doesn't match the expected and documented behaviors. Ideally we'd fix that interface. But I don't know how to do that and this is better than nothing. |
As soon as the flisp part is fixed, the limits introduced in #53713 and here have to be removed. |
…ulia into krc/fastmath-literalpow
This PR is now finished and can be merged if no objections. |
The expressions
a^x
and@fastmath a^x
are now producing equivalent results (apart from floating point accuracy) in the case of literal integerx
.The logic in the
fastmath
macro, trying to mimic the behaviour of the compiler is fixed.Fixes #53817