diff options
author | Kyrylo Tkachov <ktkachov@nvidia.com> | 2025-07-03 10:09:47 -0700 |
---|---|---|
committer | Kyrylo Tkachov <ktkachov@nvidia.com> | 2025-07-11 16:10:03 +0200 |
commit | cfa827188dc236ba905b12ef06ccc517b9f2de39 (patch) | |
tree | 76126dc22713194caaa671757ea3f94d60aa660d /gcc/testsuite | |
parent | 1b7bcac0327ccd84f1966c748f4d1aedef64a9c5 (diff) | |
download | gcc-cfa827188dc236ba905b12ef06ccc517b9f2de39.zip gcc-cfa827188dc236ba905b12ef06ccc517b9f2de39.tar.gz gcc-cfa827188dc236ba905b12ef06ccc517b9f2de39.tar.bz2 |
aarch64: Use EOR3 for DImode values
Similar to BCAX, we can use EOR3 for DImode, but we have to be careful
not to force GP<->SIMD moves unnecessarily, so add a splitter for that case.
So for input:
uint64_t eor3_d_gp (uint64_t a, uint64_t b, uint64_t c) { return EOR3 (a, b, c); }
uint64x1_t eor3_d (uint64x1_t a, uint64x1_t b, uint64x1_t c) { return EOR3 (a, b, c); }
We generate the desired:
eor3_d_gp:
eor x1, x1, x2
eor x0, x1, x0
ret
eor3_d:
eor3 v0.16b, v0.16b, v1.16b, v2.16b
ret
Bootstrapped and tested on aarch64-none-linux-gnu.
Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com>
gcc/
* config/aarch64/aarch64-simd.md (*eor3qdi4): New
define_insn_and_split.
gcc/testsuite/
* gcc.target/aarch64/simd/eor3_d.c: Add tests for DImode operands.
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/gcc.target/aarch64/simd/eor3_d.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.target/aarch64/simd/eor3_d.c b/gcc/testsuite/gcc.target/aarch64/simd/eor3_d.c index 7f2b2b4..6c9595b 100644 --- a/gcc/testsuite/gcc.target/aarch64/simd/eor3_d.c +++ b/gcc/testsuite/gcc.target/aarch64/simd/eor3_d.c @@ -7,9 +7,13 @@ #define EOR3(x,y,z) ((x) ^ (y) ^ (z)) +/* Should not use EOR3 when inputs come from GP regs. */ +uint64_t eor3_d_gp (uint64_t a, uint64_t b, uint64_t c) { return EOR3 (a, b, c); } + +uint64x1_t eor3_d (uint64x1_t a, uint64x1_t b, uint64x1_t c) { return EOR3 (a, b, c); } uint32x2_t bcax_s (uint32x2_t a, uint32x2_t b, uint32x2_t c) { return EOR3 (a, b, c); } uint16x4_t bcax_h (uint16x4_t a, uint16x4_t b, uint16x4_t c) { return EOR3 (a, b, c); } uint8x8_t bcax_b (uint8x8_t a, uint8x8_t b, uint8x8_t c) { return EOR3 (a, b, c); } -/* { dg-final { scan-assembler-times {eor3\tv0.16b, v[0-9]+.16b, v[0-9]+.16b, v[0-9]+.16b} 3 } } */ +/* { dg-final { scan-assembler-times {eor3\tv0.16b, v[0-9]+.16b, v[0-9]+.16b, v[0-9]+.16b} 4 } } */ |