aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <jlaw@ventanamicro.com>2024-11-14 09:26:11 -0700
committerJeff Law <jlaw@ventanamicro.com>2024-11-14 09:26:11 -0700
commit72677e1119dc40aa680755d009e079ad49446c46 (patch)
tree9cd16e74d87d09603ac7993d383882808c00358d
parent4bce1f71c9060e2077d81f24e482a0c4bc6623b0 (diff)
downloadgcc-72677e1119dc40aa680755d009e079ad49446c46.zip
gcc-72677e1119dc40aa680755d009e079ad49446c46.tar.gz
gcc-72677e1119dc40aa680755d009e079ad49446c46.tar.bz2
Revert "Reapply "[PATCH v2] RISC-V: zero_extend(not) -> xor optimization [PR112398]""
This reverts commit 10d76b7f1e5b63ad6d2b92940c39007913ced037.
-rw-r--r--gcc/simplify-rtx.cc22
-rw-r--r--gcc/testsuite/gcc.target/riscv/pr112398.c14
2 files changed, 0 insertions, 36 deletions
diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc
index d05efac..893c5f6 100644
--- a/gcc/simplify-rtx.cc
+++ b/gcc/simplify-rtx.cc
@@ -1842,28 +1842,6 @@ simplify_context::simplify_unary_operation_1 (rtx_code code, machine_mode mode,
& ~GET_MODE_MASK (op_mode)) == 0)
return SUBREG_REG (op);
- /* Trying to optimize:
- (zero_extend:M (subreg:N (not:M (X:M)))) ->
- (xor:M (zero_extend:M (subreg:N (X:M)), mask))
- where the mask is GET_MODE_MASK (N).
- For the cases when X:M doesn't have any non-zero bits
- outside of mode N, (zero_extend:M (subreg:N (X:M))
- will be simplified to just (X:M)
- and whole optimization will be -> (xor:M (X:M, mask)). */
- if (SUBREG_P (op)
- && GET_CODE (XEXP (op, 0)) == NOT
- && GET_MODE (XEXP (op, 0)) == mode
- && subreg_lowpart_p (op)
- && GET_MODE_SIZE (GET_MODE (op)).is_constant ()
- && (nonzero_bits (XEXP (XEXP (op, 0), 0), mode)
- & ~GET_MODE_MASK (mode)) == 0)
- {
- const uint64_t mask = GET_MODE_MASK (GET_MODE (op));
- return simplify_gen_binary (XOR, mode,
- XEXP (XEXP (op, 0), 0),
- gen_int_mode (mask, mode));
- }
-
#if defined(POINTERS_EXTEND_UNSIGNED)
/* As we do not know which address space the pointer is referring to,
we can do this only if the target does not support different pointer
diff --git a/gcc/testsuite/gcc.target/riscv/pr112398.c b/gcc/testsuite/gcc.target/riscv/pr112398.c
deleted file mode 100644
index 624a665..0000000
--- a/gcc/testsuite/gcc.target/riscv/pr112398.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-march=rv64gc -mabi=lp64d" } */
-/* { dg-skip-if "" { *-*-* } { "-O0" "-Og" } } */
-
-#include <stdint.h>
-
-uint8_t neg_u8 (const uint8_t src)
-{
- return ~src;
-}
-
-/* { dg-final { scan-assembler-times "xori\t" 1 } } */
-/* { dg-final { scan-assembler-not "not\t" } } */
-/* { dg-final { scan-assembler-not "andi\t" } } */