aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorTamar Christina <tamar.christina@arm.com>2023-11-09 14:04:57 +0000
committerTamar Christina <tamar.christina@arm.com>2023-11-09 14:18:52 +0000
commited2e058c58ab064fe3a26bc4a47a5d0a47350f97 (patch)
tree0c807a80402401b3c3b222002239b66e356857b8 /libcpp
parentffd40d3b233d63c925cceb0dcd5a4fc8925e2993 (diff)
downloadgcc-ed2e058c58ab064fe3a26bc4a47a5d0a47350f97.zip
gcc-ed2e058c58ab064fe3a26bc4a47a5d0a47350f97.tar.gz
gcc-ed2e058c58ab064fe3a26bc4a47a5d0a47350f97.tar.bz2
AArch64: Handle copysign (x, -1) expansion efficiently
copysign (x, -1) is effectively fneg (abs (x)) which on AArch64 can be most efficiently done by doing an OR of the signbit. The middle-end will optimize fneg (abs (x)) now to copysign as the canonical form and so this optimizes the expansion. If the target has an inclusive-OR that takes an immediate, then the transformed instruction is both shorter and faster. For those that don't, the immediate has to be separately constructed, but this still ends up being faster as the immediate construction is not on the critical path. Note that this is part of another patch series, the additional testcases are mutually dependent on the match.pd patch. As such the tests are added there insteadof here. gcc/ChangeLog: PR tree-optimization/109154 * config/aarch64/aarch64.md (copysign<GPF:mode>3): Handle copysign (x, -1). * config/aarch64/aarch64-simd.md (copysign<mode>3): Likewise. * config/aarch64/aarch64-sve.md (copysign<mode>3): Likewise.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions