Commit 11598938 by Ulrich Weigand Committed by Ulrich Weigand

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
parent 2b22401b
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
......
......@@ -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;
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment