Commit c799797d by Uros Bizjak

* config/alpha/alpha.c (alpha_legitimize_reload_address)

	(alpha_preferred_reload_class, alpha_legitimate_constant_p): Use
	CONST_INT_P, CONST_SCALAR_INT_P and CONST_DOUBLE_P predicates.
	(alpha_split_reload_pair) <case CONST_INT, case CONST_WIDE_INT>:
	Use CASE_CONST_SCALAR_INT.
	(print_operand) <case 'M'>: Use mode_width_operand to check the
	value of the constant.
	* config/alpha/alpha.md (movti): Use CONST_SCALAR_INT_P predicate.
	* config/alpha/predicates.md (input_operand): Use general_operand
	instead of match_code as operand check.
	(symbolic_operand): Use match_code with subexpression digits.
	* config/alpha/constraints.md (Q): Ditto.

From-SVN: r223371
parent a2780ddb
2015-05-19 Uros Bizjak <ubizjak@gmail.com>
* config/alpha/alpha.c (alpha_legitimize_reload_address)
(alpha_preferred_reload_class, alpha_legitimate_constant_p): Use
CONST_INT_P, CONST_SCALAR_INT_P and CONST_DOUBLE_P predicates.
(alpha_split_reload_pair) <case CONST_INT, case CONST_WIDE_INT>:
Use CASE_CONST_SCALAR_INT.
(print_operand) <case 'M'>: Use mode_width_operand to check the
value of the constant.
* config/alpha/alpha.md (movti): Use CONST_SCALAR_INT_P predicate.
* config/alpha/predicates.md (input_operand): Use general_operand
instead of match_code as operand check.
(symbolic_operand): Use match_code with subexpression digits.
* config/alpha/constraints.md (Q): Ditto.
2015-05-19 Andreas Krebbel <krebbel@linux.vnet.ibm.com> 2015-05-19 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* optabs.c (expand_vec_perm): Don't re-use SEL as target operand. * optabs.c (expand_vec_perm): Don't re-use SEL as target operand.
...@@ -363,8 +378,7 @@ ...@@ -363,8 +378,7 @@
2015-05-18 Martin Liska <mliska@suse.cz> 2015-05-18 Martin Liska <mliska@suse.cz>
* dbgcnt.def: Add new counter. * dbgcnt.def: Add new counter.
* ipa-icf.c (sem_item_optimizer::merge_classes): Use the * ipa-icf.c (sem_item_optimizer::merge_classes): Use the counter.
counter.
2015-05-18 Martin Liska <mliska@suse.cz> 2015-05-18 Martin Liska <mliska@suse.cz>
......
...@@ -1352,7 +1352,7 @@ alpha_legitimize_reload_address (rtx x, ...@@ -1352,7 +1352,7 @@ alpha_legitimize_reload_address (rtx x,
&& REG_P (XEXP (x, 0)) && REG_P (XEXP (x, 0))
&& REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER
&& REGNO_OK_FOR_BASE_P (REGNO (XEXP (x, 0))) && REGNO_OK_FOR_BASE_P (REGNO (XEXP (x, 0)))
&& GET_CODE (XEXP (x, 1)) == CONST_INT) && CONST_INT_P (XEXP (x, 1)))
{ {
HOST_WIDE_INT val = INTVAL (XEXP (x, 1)); HOST_WIDE_INT val = INTVAL (XEXP (x, 1));
HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000; HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000;
...@@ -1644,9 +1644,8 @@ alpha_preferred_reload_class(rtx x, enum reg_class rclass) ...@@ -1644,9 +1644,8 @@ alpha_preferred_reload_class(rtx x, enum reg_class rclass)
return rclass; return rclass;
/* These sorts of constants we can easily drop to memory. */ /* These sorts of constants we can easily drop to memory. */
if (CONST_INT_P (x) if (CONST_SCALAR_INT_P (x)
|| GET_CODE (x) == CONST_WIDE_INT || CONST_DOUBLE_P (x)
|| GET_CODE (x) == CONST_DOUBLE
|| GET_CODE (x) == CONST_VECTOR) || GET_CODE (x) == CONST_VECTOR)
{ {
if (rclass == FLOAT_REGS) if (rclass == FLOAT_REGS)
...@@ -2133,7 +2132,7 @@ alpha_legitimate_constant_p (machine_mode mode, rtx x) ...@@ -2133,7 +2132,7 @@ alpha_legitimate_constant_p (machine_mode mode, rtx x)
case CONST: case CONST:
if (GET_CODE (XEXP (x, 0)) == PLUS if (GET_CODE (XEXP (x, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT) && CONST_INT_P (XEXP (XEXP (x, 0), 1)))
x = XEXP (XEXP (x, 0), 0); x = XEXP (XEXP (x, 0), 0);
else else
return true; return true;
...@@ -3283,8 +3282,7 @@ alpha_split_tmode_pair (rtx operands[4], machine_mode mode, ...@@ -3283,8 +3282,7 @@ alpha_split_tmode_pair (rtx operands[4], machine_mode mode,
operands[2] = adjust_address (operands[1], DImode, 0); operands[2] = adjust_address (operands[1], DImode, 0);
break; break;
case CONST_INT: CASE_CONST_SCALAR_INT:
case CONST_WIDE_INT:
case CONST_DOUBLE: case CONST_DOUBLE:
gcc_assert (operands[1] == CONST0_RTX (mode)); gcc_assert (operands[1] == CONST0_RTX (mode));
operands[2] = operands[3] = const0_rtx; operands[2] = operands[3] = const0_rtx;
...@@ -5257,9 +5255,7 @@ print_operand (FILE *file, rtx x, int code) ...@@ -5257,9 +5255,7 @@ print_operand (FILE *file, rtx x, int code)
case 'M': case 'M':
/* 'b', 'w', 'l', or 'q' as the value of the constant. */ /* 'b', 'w', 'l', or 'q' as the value of the constant. */
if (!CONST_INT_P (x) if (!mode_width_operand (x, VOIDmode))
|| (INTVAL (x) != 8 && INTVAL (x) != 16
&& INTVAL (x) != 32 && INTVAL (x) != 64))
output_operand_lossage ("invalid %%M value"); output_operand_lossage ("invalid %%M value");
fprintf (file, "%s", fprintf (file, "%s",
......
...@@ -4153,8 +4153,7 @@ ...@@ -4153,8 +4153,7 @@
/* We must put 64-bit constants in memory. We could keep the /* We must put 64-bit constants in memory. We could keep the
32-bit constants in TImode and rely on the splitter, but 32-bit constants in TImode and rely on the splitter, but
this doesn't seem to be worth the pain. */ this doesn't seem to be worth the pain. */
else if (CONST_INT_P (operands[1]) else if (CONST_SCALAR_INT_P (operands[1]))
|| GET_CODE (operands[1]) == CONST_WIDE_INT)
{ {
rtx in[2], out[2], target; rtx in[2], out[2], target;
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
(define_memory_constraint "Q" (define_memory_constraint "Q"
"@internal A normal_memory_operand" "@internal A normal_memory_operand"
(and (match_code "mem") (and (match_code "mem")
(not (match_test "GET_CODE (XEXP (op, 0)) == AND")))) (not (match_code "and" "0"))))
(define_constraint "R" (define_constraint "R"
"@internal A direct_call_operand" "@internal A direct_call_operand"
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
;; Return 1 if the operand is a non-symbolic, nonzero constant operand. ;; Return 1 if the operand is a non-symbolic, nonzero constant operand.
(define_predicate "non_zero_const_operand" (define_predicate "non_zero_const_operand"
(and (match_code "const_int,const_wide_int,const_double,const_vector") (and (match_code "const_int,const_wide_int,const_double,const_vector")
(match_test "op != CONST0_RTX (mode)"))) (not (match_test "op == CONST0_RTX (mode)"))))
;; Return 1 if OP is the constant 4 or 8. ;; Return 1 if OP is the constant 4 or 8.
(define_predicate "const48_operand" (define_predicate "const48_operand"
...@@ -150,8 +150,7 @@ ...@@ -150,8 +150,7 @@
;; Return 1 if OP is a valid operand for the source of a move insn. ;; Return 1 if OP is a valid operand for the source of a move insn.
(define_predicate "input_operand" (define_predicate "input_operand"
(match_code "label_ref,symbol_ref,const,high,reg,subreg,mem, (match_operand 0 "general_operand")
const_double,const_vector,const_int,const_wide_int")
{ {
switch (GET_CODE (op)) switch (GET_CODE (op))
{ {
...@@ -273,8 +272,8 @@ ...@@ -273,8 +272,8 @@
(define_predicate "call_operand" (define_predicate "call_operand"
(ior (match_code "symbol_ref") (ior (match_code "symbol_ref")
(and (match_code "reg") (and (match_code "reg")
(ior (match_test "!TARGET_ABI_OSF") (ior (not (match_test "TARGET_ABI_OSF"))
(match_test "!HARD_REGISTER_P (op)") (not (match_test "HARD_REGISTER_P (op)"))
(match_test "REGNO (op) == R27_REG"))))) (match_test "REGNO (op) == R27_REG")))))
;; Return true if OP is a LABEL_REF, or SYMBOL_REF or CONST referencing ;; Return true if OP is a LABEL_REF, or SYMBOL_REF or CONST referencing
...@@ -371,10 +370,9 @@ ...@@ -371,10 +370,9 @@
(define_predicate "symbolic_operand" (define_predicate "symbolic_operand"
(ior (match_code "symbol_ref,label_ref") (ior (match_code "symbol_ref,label_ref")
(and (match_code "const") (and (match_code "const")
(match_test "GET_CODE (XEXP (op,0)) == PLUS (match_code "plus" "0")
&& (GET_CODE (XEXP (XEXP (op,0), 0)) == SYMBOL_REF (match_code "symbol_ref,label_ref" "00")
|| GET_CODE (XEXP (XEXP (op,0), 0)) == LABEL_REF) (match_code "const_int" "01"))))
&& CONST_INT_P (XEXP (XEXP (op,0), 1))"))))
;; Return true if OP is valid for 16-bit DTP relative relocations. ;; Return true if OP is valid for 16-bit DTP relative relocations.
(define_predicate "dtp16_symbolic_operand" (define_predicate "dtp16_symbolic_operand"
......
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