aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjorn Granlund <tege@gnu.org>1993-03-03 14:48:17 +0000
committerTorbjorn Granlund <tege@gnu.org>1993-03-03 14:48:17 +0000
commitc8d6697caa95cb93f1105a904fbcf0bd8a3dc3ea (patch)
tree12a96d9403069176e3344a38866863c58f925a80
parent95246213bda1bccf642de0a858dec0f6da20193a (diff)
downloadgcc-c8d6697caa95cb93f1105a904fbcf0bd8a3dc3ea.zip
gcc-c8d6697caa95cb93f1105a904fbcf0bd8a3dc3ea.tar.gz
gcc-c8d6697caa95cb93f1105a904fbcf0bd8a3dc3ea.tar.bz2
(lhs_lshift_operand): New function.
(lhs_lshift_cint_operand): New function. (print_operand): Handle L and P for bit field instructions. From-SVN: r3623
-rw-r--r--gcc/config/pa/pa.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 011ae64..1ef694f 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -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);