From a18c2c5f9831b34d029ffe32014b40fa1c3cf02c Mon Sep 17 00:00:00 2001 From: John David Anglin <dave@hiauly1.hia.nrc.ca> Date: Thu, 11 Jul 2002 18:47:45 +0000 Subject: [PATCH] pa.md (adddi3): Change predicate of operand 2 to adddi3_operand and delete code to force... * pa.md (adddi3): Change predicate of operand 2 to adddi3_operand and delete code to force constant to register. * pa-protos.h (adddi3_operand): Add prototype. * pa.c (adddi3_operand): New function. From-SVN: r55400 --- gcc/ChangeLog | 7 +++++++ gcc/config/pa/pa-protos.h | 1 + gcc/config/pa/pa.c | 12 ++++++++++++ gcc/config/pa/pa.md | 10 ++-------- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4bd40857b37f..ff52771918fb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2002-07-11 John David Anglin <dave@hiauly1.hia.nrc.ca> + + * pa.md (adddi3): Change predicate of operand 2 to adddi3_operand + and delete code to force constant to register. + * pa-protos.h (adddi3_operand): Add prototype. + * pa.c (adddi3_operand): New function. + 2002-07-11 Roger Sayle <roger@eyesopen.com> * c-decl.c (duplicate_decls): Preserve the noreturn attribute on diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h index a21a383a47ba..8f1c330203aa 100644 --- a/gcc/config/pa/pa-protos.h +++ b/gcc/config/pa/pa-protos.h @@ -63,6 +63,7 @@ extern rtx legitimize_pic_address PARAMS ((rtx, enum machine_mode, rtx)); extern struct rtx_def *gen_cmp_fp PARAMS ((enum rtx_code, rtx, rtx)); extern void hppa_encode_label PARAMS ((rtx)); extern int arith11_operand PARAMS ((rtx, enum machine_mode)); +extern int adddi3_operand PARAMS ((rtx, enum machine_mode)); extern int symbolic_expression_p PARAMS ((rtx)); extern int hppa_address_cost PARAMS ((rtx)); extern int symbolic_memory_operand PARAMS ((rtx, enum machine_mode)); diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index c06a7b45215a..7619f2bd3631 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -578,6 +578,18 @@ arith11_operand (op, mode) || (GET_CODE (op) == CONST_INT && INT_11_BITS (op))); } +/* Return truth value of whether OP can be used as an operand in a + adddi3 insn. */ +int +adddi3_operand (op, mode) + rtx op; + enum machine_mode mode; +{ + return (register_operand (op, mode) + || (GET_CODE (op) == CONST_INT + && (TARGET_64BIT ? INT_14_BITS (op) : INT_11_BITS (op)))); +} + /* A constant integer suitable for use in a PRE_MODIFY memory reference. */ int diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 10c0462b4e46..73f2831c12d0 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -3813,15 +3813,9 @@ (define_expand "adddi3" [(set (match_operand:DI 0 "register_operand" "") (plus:DI (match_operand:DI 1 "register_operand" "") - (match_operand:DI 2 "arith_operand" "")))] + (match_operand:DI 2 "adddi3_operand" "")))] "" - " -{ - if (!TARGET_64BIT - && GET_CODE (operands[2]) == CONST_INT - && !VAL_11_BITS_P (INTVAL (operands[2]))) - operands[2] = force_reg (DImode, operands[2]); -}") + "") (define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") -- GitLab