h8300.md: Fix xorqi and xorqi so that they will accept to accept 0x80 as operands[2].
authorKazu Hirata <kazu@hxi.com>
Thu, 24 Jan 2002 05:02:35 +0000 (05:02 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Thu, 24 Jan 2002 05:02:35 +0000 (05:02 +0000)
* config/h8300/h8300.md: Fix xorqi and xorqi so that they will
accept to accept 0x80 as operands[2].

From-SVN: r49168

gcc/ChangeLog
gcc/config/h8300/h8300.md

index 5266fc0..374324c 100644 (file)
@@ -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.
index ab05d49..d4937bf 100644 (file)
 (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")])
 (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")])