aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1993-03-24 10:54:06 -0700
committerJeff Law <law@gcc.gnu.org>1993-03-24 10:54:06 -0700
commit4802a0d68185a5db2fb8e759045fbd90b7c188a1 (patch)
tree7768c1dc3b7d3189ccc3e65d246eaacf815ed285 /gcc
parentb8be8876caf6bd18a0f1088f78876a6b49ad2c52 (diff)
downloadgcc-4802a0d68185a5db2fb8e759045fbd90b7c188a1.zip
gcc-4802a0d68185a5db2fb8e759045fbd90b7c188a1.tar.gz
gcc-4802a0d68185a5db2fb8e759045fbd90b7c188a1.tar.bz2
pa.c (shadd_operand): New function.
* pa.c (shadd_operand): New function. (print_operand): Handle "%O" for shadd patterns. From-SVN: r3867
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/pa/pa.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index b99be99..0401201 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -2427,6 +2427,13 @@ print_operand (file, x, code)
return;
}
abort();
+ case 'O':
+ if (GET_CODE (x) == CONST_INT && exact_log2 (INTVAL (x)) >= 0)
+ {
+ fprintf (file, "%d", exact_log2 (INTVAL (x)));
+ return;
+ }
+ abort();
case 'P':
if (GET_CODE (x) == CONST_INT)
{
@@ -3038,3 +3045,13 @@ shadd_constant_p (val)
else
return 0;
}
+
+/* Return 1 if OP is a CONST_INT with the value 2, 4, or 8. These are
+ the valid constant for shadd instructions. */
+int
+shadd_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ return (GET_CODE (op) == CONST_INT && shadd_constant_p (INTVAL (op)));
+}