From c8d6697caa95cb93f1105a904fbcf0bd8a3dc3ea Mon Sep 17 00:00:00 2001 From: Torbjorn Granlund Date: Wed, 3 Mar 1993 14:48:17 +0000 Subject: [PATCH] (lhs_lshift_operand): New function. (lhs_lshift_cint_operand): New function. (print_operand): Handle L and P for bit field instructions. From-SVN: r3623 --- gcc/config/pa/pa.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 011ae64dc05..1ef694fc48e 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -387,6 +387,29 @@ ior_operand (op, mode) return (GET_CODE (op) == CONST_INT && ior_mask_p (INTVAL (op))); } +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; @@ -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); -- 2.30.2