diff options
author | Kyrylo Tkachov <kyrylo.tkachov@arm.com> | 2023-06-12 11:42:29 +0100 |
---|---|---|
committer | Kyrylo Tkachov <kyrylo.tkachov@arm.com> | 2023-06-12 13:25:45 +0100 |
commit | 921b841350c4fc298d09f6c5674663e0f4208610 (patch) | |
tree | 34aa08c16e904b547ae8d898d66d723a5ccfb102 /libcpp/charset.cc | |
parent | 84cbf560ff62a57432374d8a878251234ffcb99a (diff) | |
download | gcc-921b841350c4fc298d09f6c5674663e0f4208610.zip gcc-921b841350c4fc298d09f6c5674663e0f4208610.tar.gz gcc-921b841350c4fc298d09f6c5674663e0f4208610.tar.bz2 |
simplify-rtx: Implement constant folding of SS_TRUNCATE, US_TRUNCATE
This patch implements RTL constant-folding for the SS_TRUNCATE and US_TRUNCATE codes.
The semantics are a clamping operation on the argument with the min and max of the narrow mode,
followed by a truncation. The signedness of the clamp and the min/max extrema is derived from
the signedness of the saturating operation.
We have a number of instructions in aarch64 that use SS_TRUNCATE and US_TRUNCATE to represent
their operations and we have pretty thorough runtime tests in gcc.target/aarch64/advsimd-intrinsics/vqmovn*.c.
With this patch the instructions are folded away at optimisation levels and the correctness checks still
pass.
Bootstrapped and tested on aarch64-none-linux-gnu and aarch64_be-none-elf.
gcc/ChangeLog:
* simplify-rtx.cc (simplify_const_unary_operation):
Handle US_TRUNCATE, SS_TRUNCATE.
Diffstat (limited to 'libcpp/charset.cc')
0 files changed, 0 insertions, 0 deletions