OSDN Git Service

(lhs_lshift_operand): New function.
authortege <tege@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 3 Mar 1993 14:48:17 +0000 (14:48 +0000)
committertege <tege@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 3 Mar 1993 14:48:17 +0000 (14:48 +0000)
(lhs_lshift_cint_operand): New function.
(print_operand): Handle L and P for bit field instructions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@3623 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/config/pa/pa.c

index 011ae64..1ef694f 100644 (file)
@@ -388,6 +388,29 @@ ior_operand (op, mode)
 }
 
 int
+lhs_lshift_operand (op, mode)
+     rtx op;
+     enum machine_mode mode;
+{
+  return register_operand (op, mode) || lhs_lshift_cint_operand (op, mode);
+}
+
+/* True iff OP is a CONST_INT of the forms 0...0xxxx or 0...01...1xxxx.
+   Such values can be the left hand side x in (x << r), using the zvdepi
+   instruction.  */
+int
+lhs_lshift_cint_operand (op, mode)
+     rtx op;
+     enum machine_mode mode;
+{
+  unsigned x;
+  if (GET_CODE (op) != CONST_INT)
+    return 0;
+  x = INTVAL (op) >> 4;
+  return (x & (x + 1)) == 0;
+}
+
+int
 arith32_operand (op, mode)
      rtx op;
      enum machine_mode mode;
@@ -2364,6 +2387,20 @@ print_operand (file, x, code)
          return;
        }
       abort();
+    case 'L':
+      if (GET_CODE (x) == CONST_INT)
+       {
+         fprintf (file, "%d", 32 - (INTVAL (x) & 31));
+         return;
+       }
+      abort();
+    case 'P':
+      if (GET_CODE (x) == CONST_INT)
+       {
+         fprintf (file, "%d", 31 - (INTVAL (x) & 31));
+         return;
+       }
+      abort();
     case 'I':
       if (GET_CODE (x) == CONST_INT)
        fputs ("i", file);