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
clang(trunk) with '--std=c++17 -O3 -march=native -ffast-math' flags for this code:
#include <cmath> double f(double a, double b) { return std::exp(a) * std::exp(b); }
generates this assembly:
f(double, double): # @f(double, double) sub rsp, 24 vmovsd qword ptr [rsp + 16], xmm1 # 8-byte Spill call exp vmovsd qword ptr [rsp + 8], xmm0 # 8-byte Spill vmovsd xmm0, qword ptr [rsp + 16] # 8-byte Reload call exp vmulsd xmm0, xmm0, qword ptr [rsp + 8] # 8-byte Folded Reload add rsp, 24 ret
GCC (trunk) with '--std=c++17 -O3 -march=native -ffast-math' flags generates more optimal code:
f(double, double): vaddsd xmm0, xmm0, xmm1 jmp __exp_finite
The text was updated successfully, but these errors were encountered:
This could also be in InstCombine.
Sorry, something went wrong.
See a lot of optimizations here: https://github.com/gcc-mirror/gcc/blob/07b69d3f1cd3dd8ebb0af1fbff95914daee477d2/gcc/match.pd
https://reviews.llvm.org/D41342
Commits: rL352613, rL352730
mentioned in issue #34959
No branches or pull requests
Extended Description
clang(trunk) with '--std=c++17 -O3 -march=native -ffast-math' flags for this code:
generates this assembly:
GCC (trunk) with '--std=c++17 -O3 -march=native -ffast-math' flags generates more optimal code:
The text was updated successfully, but these errors were encountered: