aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJ"orn Rennecke <joern.rennecke@superh.com>2002-10-31 12:53:06 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2002-10-31 12:53:06 +0000
commitff881d522904fd2d31d320e0c123a50979617479 (patch)
treed503c78a995cd6c96064902035ad21801537af7b /gcc
parente8e4c876bcf67039d8f9a8694a4cac4c82f1fb55 (diff)
downloadgcc-ff881d522904fd2d31d320e0c123a50979617479.zip
gcc-ff881d522904fd2d31d320e0c123a50979617479.tar.gz
gcc-ff881d522904fd2d31d320e0c123a50979617479.tar.bz2
sh.h (binary_logical_operator): Declare.
* sh.h (binary_logical_operator): Declare. * sh.c (binary_logical_operator): New function. * sh.md (xordi3+1): New combiner splitter pattern. From-SVN: r58675
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/sh/sh.c19
-rw-r--r--gcc/config/sh/sh.h1
-rw-r--r--gcc/config/sh/sh.md27
4 files changed, 53 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 15eaa39..95b754a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+Thu Oct 31 12:45:55 2002 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.h (binary_logical_operator): Declare.
+ * sh.c (binary_logical_operator): New function.
+ * sh.md (xordi3+1): New combiner splitter pattern.
+
2002-10-31 David O'Brien <obrien@FreeBSD.org>
* config/sparc/freebsd.h (TRANSFER_FROM_TRAMPOLINE): Define
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 3521c47..4e6981b 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -6177,6 +6177,25 @@ binary_float_operator (op, mode)
}
int
+binary_logical_operator (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (GET_MODE (op) != mode)
+ return 0;
+ switch (GET_CODE (op))
+ {
+ case IOR:
+ case AND:
+ case XOR:
+ return 1;
+ default:
+ break;
+ }
+ return 0;
+}
+
+int
equality_comparison_operator (op, mode)
rtx op;
enum machine_mode mode;
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 64a0f2a..d0bbbdf 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -3225,6 +3225,7 @@ extern int rtx_equal_function_value_matters;
{"arith_reg_operand", {SUBREG, REG}}, \
{"arith_reg_or_0_operand", {SUBREG, REG, CONST_INT, CONST_VECTOR}}, \
{"binary_float_operator", {PLUS, MINUS, MULT, DIV}}, \
+ {"binary_logical_operator", {AND, IOR, XOR}}, \
{"commutative_float_operator", {PLUS, MULT}}, \
{"equality_comparison_operator", {EQ,NE}}, \
{"extend_reg_operand", {SUBREG, REG, TRUNCATE}}, \
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 00a91df..95b1406 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -2038,6 +2038,33 @@
xor %1, %2, %0
xori %1, %2, %0"
[(set_attr "type" "arith_media")])
+
+;; Combiner bridge pattern for 2 * sign extend -> logical op -> truncate.
+;; converts 2 * sign extend -> logical op into logical op -> sign extend
+(define_split
+ [(set (match_operand:DI 0 "arith_reg_operand" "")
+ (sign_extend:DI (match_operator 4 "binary_logical_operator"
+ [(match_operand 1 "any_register_operand" "")
+ (match_operand 2 "any_register_operand" "")])))]
+ "TARGET_SHMEDIA"
+ [(set (match_dup 5) (match_dup 4))
+ (set (match_dup 0) (sign_extend:DI (match_dup 5)))]
+"
+{
+ enum machine_mode inmode = GET_MODE (operands[1]);
+ int regno, offset = 0;
+
+ if (GET_CODE (operands[0]) == SUBREG)
+ {
+ offset = SUBREG_BYTE (operands[0]);
+ operands[0] = SUBREG_REG (operands[0]);
+ }
+ if (GET_CODE (operands[0]) != REG)
+ abort ();
+ if (! TARGET_LITTLE_ENDIAN)
+ offset += 8 - GET_MODE_SIZE (inmode);
+ operands[5] = gen_rtx_SUBREG (inmode, operands[0], offset);
+}")
;; -------------------------------------------------------------------------
;; Shifts and rotates