aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authorSoumya AR <soumyaa@nvidia.com>2024-11-12 09:26:24 +0530
committerSoumya AR <soumyaa@nvidia.com>2024-11-12 09:30:33 +0530
commite232dc3bb5c3e8f8a3749239135b7b859a204fc7 (patch)
treeecc252b98a270feeb90b1f19aee01497e1c39789 /gcc/tree-vectorizer.h
parent4b9bb1d687e77469b5926e89db3a34b32ed3194a (diff)
downloadgcc-e232dc3bb5c3e8f8a3749239135b7b859a204fc7.zip
gcc-e232dc3bb5c3e8f8a3749239135b7b859a204fc7.tar.gz
gcc-e232dc3bb5c3e8f8a3749239135b7b859a204fc7.tar.bz2
Match: Optimize log (x) CMP CST and exp (x) CMP CST operations
This patch implements transformations for the following optimizations. logN(x) CMP CST -> x CMP expN(CST) expN(x) CMP CST -> x CMP logN(CST) Where CMP expands to ge and le operations. For example: int foo (float x) { return __builtin_logf (x) <= 0.0f; } can just be: int foo (float x) { return x <= 1.0f; } The patch was bootstrapped and regtested on aarch64-linux-gnu, no regression. OK for mainline? Signed-off-by: Soumya AR <soumyaa@nvidia.com> gcc/ChangeLog: * match.pd: Fold logN(x) CMP CST -> x CMP expN(CST) and expN(x) CMP CST -> x CMP logN(CST) gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/log_exp.c: New test.
Diffstat (limited to 'gcc/tree-vectorizer.h')
0 files changed, 0 insertions, 0 deletions