diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9b8f86cc5a58a2497d9f1e39d09ce262d6873bb8..f7ef0ce0474eccf0aeb021b7f6d46561dfe4f3fa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 1814ed0f1b5bf9dc41557aadcf5057e363c86f8b..ca32040a045ab8d388cfa2bbd6a096aa3cff36e7 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -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; } diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 85e0b60b30de4caec5d887dd015a6969daf12c42..dcbd1a025faebf60db79220b3899a1c56541a0e3 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -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. @@ -785,7 +786,7 @@ (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 @@ -938,7 +939,7 @@ (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 @@ -1400,7 +1401,7 @@ (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