aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/h8300/h8300.md44
2 files changed, 39 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5266fc0..374324c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2002-01-23 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/h8300.md: Fix xorqi and xorqi so that they will
+ accept to accept 0x80 as operands[2].
+
2002-01-24 Alexandre Oliva <aoliva@redhat.com>
* config/sparc/sparc.md (fix_trunctfdi2): Correct typo in mode.
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index ab05d49..d4937bf 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -1109,11 +1109,23 @@
(define_insn ""
[(set (match_operand:QI 0 "bit_operand" "=r,U")
(ior:QI (match_operand:QI 1 "bit_operand" "%0,0")
- (match_operand:QI 2 "nonmemory_operand" "rn,P")))]
- "register_operand (operands[0], QImode) || p_operand (operands[2], QImode)"
- "@
- or %X2,%X0
- bset %V2,%R0"
+ (match_operand:QI 2 "nonmemory_operand" "rn,n")))]
+ "register_operand (operands[0], QImode)
+ || (GET_CODE (operands[2]) == CONST_INT
+ && exact_log2 (INTVAL (operands[2]) & 0xff) != -1)"
+ "*
+{
+ switch (which_alternative)
+ {
+ case 0:
+ return \"or\t%X2,%X0\";
+ case 1:
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0xff);
+ return \"bset\t%V2,%R0\";
+ default:
+ abort ();
+ }
+}"
[(set_attr "length" "2,8")
(set_attr "adjust_length" "no")
(set_attr "cc" "set_znv,none_0hit")])
@@ -1186,11 +1198,23 @@
(define_insn ""
[(set (match_operand:QI 0 "bit_operand" "=r,U")
(xor:QI (match_operand:QI 1 "bit_operand" "%0,0")
- (match_operand:QI 2 "nonmemory_operand" "rn,P")))]
- "register_operand (operands[0], QImode) || p_operand (operands[2], QImode)"
- "@
- xor %X2,%X0
- bnot %V2,%R0"
+ (match_operand:QI 2 "nonmemory_operand" "rn,n")))]
+ "register_operand (operands[0], QImode)
+ || (GET_CODE (operands[2]) == CONST_INT
+ && exact_log2 (INTVAL (operands[2]) & 0xff) != -1)"
+ "*
+{
+ switch (which_alternative)
+ {
+ case 0:
+ return \"xor\t%X2,%X0\";
+ case 1:
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0xff);
+ return \"bnot\t%V2,%R0\";
+ default:
+ abort ();
+ }
+}"
[(set_attr "length" "2,8")
(set_attr "adjust_length" "no")
(set_attr "cc" "set_znv,none_0hit")])