* config/s390/s390.c (s390_const_ok_for_constraint_p): Add 'P'
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 14 Aug 2005 23:13:58 +0000 (23:13 +0000)
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 14 Aug 2005 23:13:58 +0000 (23:13 +0000)
constraint.
(legitimate_reload_constant_p): Fix handling of lliXX operands.
Accept double-word constants that can be split.
* config/s390/s390.md ("movti"): Use 'P' constraint.
("*movdi_31", "*movdf_31"): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103088 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/s390/s390.c
gcc/config/s390/s390.md

index 9b8f86c..f7ef0ce 100644 (file)
@@ -1,3 +1,12 @@
+2005-08-14  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * config/s390/s390.c (s390_const_ok_for_constraint_p): Add 'P'
+       constraint.
+       (legitimate_reload_constant_p): Fix handling of lliXX operands.
+       Accept double-word constants that can be split.
+       * config/s390/s390.md ("movti"): Use 'P' constraint.
+       ("*movdi_31", "*movdf_31"): Likewise.
+
 2005-08-14  Daniel Berlin  <dberlin@dberlin.org>
 
        Fix PR tree-optimization/22615
index 1814ed0..ca32040 100644 (file)
@@ -1876,6 +1876,9 @@ s390_const_ok_for_constraint_p (HOST_WIDE_INT value,
 
       break;
 
+    case 'P':
+      return legitimate_reload_constant_p (GEN_INT (value));
+
     default:
       return 0;
     }
@@ -2311,7 +2314,9 @@ legitimate_reload_constant_p (rtx op)
 
   /* Accept lliXX operands.  */
   if (TARGET_ZARCH
-      && s390_single_part (op, DImode, HImode, 0) >= 0)
+      && GET_CODE (op) == CONST_INT
+      && trunc_int_for_mode (INTVAL (op), word_mode) == INTVAL (op)
+      && s390_single_part (op, word_mode, HImode, 0) >= 0)
   return true;
 
   /* Accept larl operands.  */
@@ -2324,6 +2329,17 @@ legitimate_reload_constant_p (rtx op)
       && CONST_DOUBLE_OK_FOR_CONSTRAINT_P (op, 'G', "G"))
     return true;
 
+  /* Accept double-word operands that can be split.  */
+  if (GET_CODE (op) == CONST_INT
+      && trunc_int_for_mode (INTVAL (op), word_mode) != INTVAL (op))
+    {
+      enum machine_mode dword_mode = word_mode == SImode ? DImode : TImode;
+      rtx hi = operand_subword (op, 0, 0, dword_mode);
+      rtx lo = operand_subword (op, 1, 0, dword_mode);
+      return legitimate_reload_constant_p (hi)
+            && legitimate_reload_constant_p (lo);
+    }
+
   /* Everything else cannot be handled without reload.  */
   return false;
 }
index 85e0b60..dcbd1a0 100644 (file)
@@ -47,6 +47,7 @@
 ;;         has a value different from its other parts.  If the letter x
 ;;         is specified instead of a part number, the constraint matches
 ;;         if there is any single part with non-default value.
+;;    P -- Any integer constant that can be loaded without literal pool.
 ;;    Q -- Memory reference without index register and with short displacement.
 ;;    R -- Memory reference with index register and short displacement.
 ;;    S -- Memory reference without index register but with long displacement.
 
 (define_insn "movti"
   [(set (match_operand:TI 0 "nonimmediate_operand" "=d,QS,d,o,Q")
-        (match_operand:TI 1 "general_operand" "QS,d,dKm,d,Q"))]
+        (match_operand:TI 1 "general_operand" "QS,d,dPm,d,Q"))]
   "TARGET_64BIT"
   "@
    lmg\t%0,%N0,%S1
 
 (define_insn "*movdi_31"
   [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,Q,S,d,o,!*f,!*f,!*f,!R,!T,Q")
-        (match_operand:DI 1 "general_operand" "Q,S,d,d,dKm,d,*f,R,T,*f,*f,Q"))]
+        (match_operand:DI 1 "general_operand" "Q,S,d,d,dPm,d,*f,R,T,*f,*f,Q"))]
   "!TARGET_64BIT"
   "@
    lm\t%0,%N0,%S1
 
 (define_insn "*movdf_31"
   [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,f,R,T,d,d,Q,S,d,o,Q")
-        (match_operand:DF 1 "general_operand" "G,f,R,T,f,f,Q,S,d,d,dKm,d,Q"))]
+        (match_operand:DF 1 "general_operand" "G,f,R,T,f,f,Q,S,d,d,dPm,d,Q"))]
   "!TARGET_64BIT"
   "@
    lzdr\t%0