We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Consider the following code under -ffast-math.
-ffast-math
#include <math.h> float f1(float x) { return tanf(x) * cosf(x); } float f2(float x) { return sinf(x) / tanf(x); }
GCC
f1: b sinf f2: b cosf
Clang
f1: // @f1 stp d9, d8, [sp, #-32]! // 16-byte Folded Spill stp x29, x30, [sp, #16] // 16-byte Folded Spill add x29, sp, #16 fmov s8, s0 bl tanf fmov s9, s0 fmov s0, s8 bl cosf fmul s0, s9, s0 ldp x29, x30, [sp, #16] // 16-byte Folded Reload ldp d9, d8, [sp], #32 // 16-byte Folded Reload ret f2: // @f2 stp d9, d8, [sp, #-32]! // 16-byte Folded Spill stp x29, x30, [sp, #16] // 16-byte Folded Spill add x29, sp, #16 fmov s8, s0 bl sinf fmov s9, s0 fmov s0, s8 bl tanf fdiv s0, s9, s0 ldp x29, x30, [sp, #16] // 16-byte Folded Reload ldp d9, d8, [sp], #32 // 16-byte Folded Reload ret
https://godbolt.org/z/Kf9r1aPj7
This difference is not specific to AArch64.
The text was updated successfully, but these errors were encountered:
We do a few trig combines already (see InstCombinerImpl::visitFDiv), but we're missing a Intrinsic::tan which should be dealt with first
Sorry, something went wrong.
See: Issue #34950
Thank you for your explanation. I understand that this issue is a duplicate.
No branches or pull requests
Consider the following code under
-ffast-math
.GCC
Clang
https://godbolt.org/z/Kf9r1aPj7
This difference is not specific to AArch64.
The text was updated successfully, but these errors were encountered: