diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2005-08-14 23:13:58 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@gcc.gnu.org> | 2005-08-14 23:13:58 +0000 |
commit | 11598938f4989b238895062ff517862d0897cad8 (patch) | |
tree | b4e57599ad6c9969fea8d967030b6c4c2aab76ea | |
parent | 2b22401b5adc55029fb08feeb725058aa8020bb0 (diff) | |
download | gcc-11598938f4989b238895062ff517862d0897cad8.zip gcc-11598938f4989b238895062ff517862d0897cad8.tar.gz gcc-11598938f4989b238895062ff517862d0897cad8.tar.bz2 |
s390.c (s390_const_ok_for_constraint_p): Add 'P' constraint.
* 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.
From-SVN: r103088
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/config/s390/s390.c | 18 | ||||
-rw-r--r-- | gcc/config/s390/s390.md | 7 |
3 files changed, 30 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9b8f86c..f7ef0ce 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 1814ed0..ca32040 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 85e0b60..dcbd1a0 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 |