]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pa.md (adddi3): Change predicate of operand 2 to adddi3_operand.
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>
Thu, 11 Jul 2002 18:22:02 +0000 (18:22 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Thu, 11 Jul 2002 18:22:02 +0000 (18:22 +0000)
* pa.md (adddi3): Change predicate of operand 2 to adddi3_operand.
Remove comment.  Change predicate of 32-bit adddi3 insn pattern to
arith11_operand.
* pa-protos.h (adddi3_operand): Add prototype.
* pa.c (cint_ok_for_move): Fix comment.
(adddi3_operand): New function.
(emit_move_sequence):  Don't directly split DImode constants on
32-bit targets.

From-SVN: r55399

gcc/ChangeLog
gcc/config/pa/pa-protos.h
gcc/config/pa/pa.c
gcc/config/pa/pa.md

index 8309c8229aa4c47e5b7fa7b99c3c57790b1fd0c7..648b8bd2afb320b91a9766414aa15db42b183562 100644 (file)
@@ -1,3 +1,14 @@
+2002-07-11  John David Anglin  <dave@hiauly1.hia.nrc.ca>
+
+       * pa.md (adddi3): Change predicate of operand 2 to adddi3_operand.
+       Remove comment.  Change predicate of 32-bit adddi3 insn pattern to
+       arith11_operand.
+       * pa-protos.h (adddi3_operand): Add prototype.
+       * pa.c (cint_ok_for_move): Fix comment.
+       (adddi3_operand): New function.
+       (emit_move_sequence):  Don't directly split DImode constants on
+       32-bit targets.
+
 2002-07-05  Stephane Carrez  <stcarrez@nerim.fr>
 
        * config/m68hc11/m68hc11.md ("*movqi_68hc12"): Avoid allocating
index 0c81ae0681483820de1e30a41dcc03347dce9aa3..163cf28528fed4e0ce4c9c863dae2e02f7732c64 100644 (file)
@@ -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));
index 3d98898a2a8f1d6200319467e3f04fd9da544c30..c543c950c4ae96634dde8e2e6351f70eb8c52ee9 100644 (file)
@@ -393,7 +393,7 @@ reg_before_reload_operand (op, mode)
   return 0;
 }
 
-/* Accept any constant that can be moved in one instructions into a
+/* Accept any constant that can be moved in one instruction into a
    general register.  */
 int
 cint_ok_for_move (intval)
@@ -529,6 +529,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
@@ -1695,9 +1707,13 @@ emit_move_sequence (operands, mode, scratch_reg)
          else
            temp = gen_reg_rtx (mode);
 
-         if (GET_CODE (operand1) == CONST_INT)
+         /* We don't directly split DImode constants on 32-bit targets
+            because PLUS uses an 11-bit immediate and the insn sequence
+            generated is not as efficient as the one using HIGH/LO_SUM.  */
+         if (GET_CODE (operand1) == CONST_INT
+             && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT)
            {
-             /* Directly break constant into low and high parts.  This
+             /* Directly break constant into high and low parts.  This
                 provides better optimization opportunities because various
                 passes recognize constants split with PLUS but not LO_SUM.
                 We use a 14-bit signed low part except when the addition
index aa0c305d18f4221e0dc542094a2f8de5da21771e..a0e3d80e7eb9c68919d00c205df1d2bb7d87e654 100644 (file)
 (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" "")))]
   ""
   "")
 
-;; We allow arith_operand for operands2, even though strictly speaking it
-;; we would prefer to us arith11_operand since that's what the hardware
-;; can actually support.
-;;
-;; But the price of the extra reload in that case is worth the simplicity
-;; we get by allowing a trivial adddi3 expander to be used for both
-;; PA64 and PA32.
-
 (define_insn ""
   [(set (match_operand:DI 0 "register_operand" "=r")
        (plus:DI (match_operand:DI 1 "register_operand" "%r")
-                (match_operand:DI 2 "arith_operand" "rI")))]
+                (match_operand:DI 2 "arith11_operand" "rI")))]
   "!TARGET_64BIT"
   "*
 {