aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/pa/pa.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2015-05-21 06:44:35 -0600
committerJeff Law <law@gcc.gnu.org>2015-05-21 06:44:35 -0600
commitb47fbc5307fe0f03ff302627d8977c402e34feff (patch)
tree33e14240d1aea93da7c0d3d7c5748f572def94a0 /gcc/config/pa/pa.c
parent0daff5e0c87a619093f4718c0ec212b1b461bfde (diff)
downloadgcc-b47fbc5307fe0f03ff302627d8977c402e34feff.zip
gcc-b47fbc5307fe0f03ff302627d8977c402e34feff.tar.gz
gcc-b47fbc5307fe0f03ff302627d8977c402e34feff.tar.bz2
pa.c (pa_print_operand): New 'o' output modifier.
2015-05-20 Jeff Law <law@redhat.com> * config/pa/pa.c (pa_print_operand): New 'o' output modifier. (pa_mem_shadd_constant_p): Renamed from pa_shadd_constant_p. (pa_shadd_constant_p): Allow constants for shadd insns rather than valid scaling constants for memory addresses. * config/pa/pa-protos.h (pa_mem_shadd_constant_p): Add prototype. * config/pa/predicates.md (mem_shadd_operand): New predicate. * config/pa/pa.md (shift-add insns using MULT): Use mem_shadd_operand. (shift-add insns using ASHIFT): New patterns. * gcc.target/hppa/hppa.exp: New target test driver. * gcc.target/hppa/shadd-1.c: New test. From-SVN: r223480
Diffstat (limited to 'gcc/config/pa/pa.c')
-rw-r--r--gcc/config/pa/pa.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index cfdafa6..f99cf33 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -5242,6 +5242,11 @@ pa_print_operand (FILE *file, rtx x, int code)
gcc_assert (GET_CODE (x) == CONST_INT);
fprintf (file, HOST_WIDE_INT_PRINT_DEC, 32 - (INTVAL (x) & 31));
return;
+ case 'o':
+ gcc_assert (GET_CODE (x) == CONST_INT
+ && (INTVAL (x) == 1 || INTVAL (x) == 2 || INTVAL (x) == 3));
+ fprintf (file, "%d", INTVAL (x));
+ return;
case 'O':
gcc_assert (GET_CODE (x) == CONST_INT && exact_log2 (INTVAL (x)) >= 0);
fprintf (file, "%d", exact_log2 (INTVAL (x)));
@@ -8729,11 +8734,22 @@ pa_fmpysuboperands (rtx *operands)
}
/* Return 1 if the given constant is 2, 4, or 8. These are the valid
+ constants for a MULT embedded inside a memory address. */
+int
+pa_mem_shadd_constant_p (int val)
+{
+ if (val == 2 || val == 4 || val == 8)
+ return 1;
+ else
+ return 0;
+}
+
+/* Return 1 if the given constant is 1, 2, or 3. These are the valid
constants for shadd instructions. */
int
pa_shadd_constant_p (int val)
{
- if (val == 2 || val == 4 || val == 8)
+ if (val == 1 || val == 2 || val == 3)
return 1;
else
return 0;