(logic_operand): New function.
authorTorbjorn Granlund <tege@gnu.org>
Thu, 14 Dec 1995 23:16:23 +0000 (23:16 +0000)
committerTorbjorn Granlund <tege@gnu.org>
Thu, 14 Dec 1995 23:16:23 +0000 (23:16 +0000)
(i960_print_operand): Handle code `C'.

From-SVN: r10726

gcc/config/i960/i960.c

index fde2e43e7869cc3d710f6656149dc88c8a30f35e..cdd591396c4decfffc672c42b17f6d43b3ad8bb4 100644 (file)
@@ -215,6 +215,19 @@ arith_operand (op, mode)
   return (register_operand (op, mode) || literal (op, mode));
 }
 
+/* Return truth value of whether OP can be used as an operands in a three
+   address logic insn, possibly complementing OP, of mode MODE.  */
+
+int
+logic_operand (op, mode)
+     rtx op;
+     enum machine_mode mode;
+{
+  return (register_operand (op, mode)
+         || (GET_CODE (op) == CONST_INT
+             && INTVAL(op) >= -32 && INTVAL(op) < 32));
+}
+
 /* Return true if OP is a register or a valid floating point literal.  */
 
 int
@@ -1638,10 +1651,13 @@ i960_print_operand (file, x, code)
     }
   else if (rtxcode == CONST_INT)
     {
-      if (INTVAL (x) > 9999 || INTVAL (x) < -999)
-       fprintf (file, "0x%x", INTVAL (x));
+      HOST_WIDE_INT val = INTVAL (x);
+      if (code == 'C')
+       val = ~val;
+      if (val > 9999 || val < -999)
+       fprintf (file, "0x%x", val);
       else
-       fprintf (file, "%d", INTVAL (x));
+       fprintf (file, "%d", val);
       return;
     }
   else if (rtxcode == CONST_DOUBLE)