diff options
author | Uros Bizjak <uros@gcc.gnu.org> | 2015-05-19 17:09:09 +0200 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2015-05-19 17:09:09 +0200 |
commit | c799797ddfe3b0d779dc0a9d9549067b0a6558cf (patch) | |
tree | 50bd8fb9ac79fb374b20ddad286efb3ed0791315 | |
parent | a2780ddb46556eac870f843df4dca394a48844bb (diff) | |
download | gcc-c799797ddfe3b0d779dc0a9d9549067b0a6558cf.zip gcc-c799797ddfe3b0d779dc0a9d9549067b0a6558cf.tar.gz gcc-c799797ddfe3b0d779dc0a9d9549067b0a6558cf.tar.bz2 |
* 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
-rw-r--r-- | gcc/ChangeLog | 18 | ||||
-rw-r--r-- | gcc/config/alpha/alpha.c | 16 | ||||
-rw-r--r-- | gcc/config/alpha/alpha.md | 3 | ||||
-rw-r--r-- | gcc/config/alpha/constraints.md | 2 | ||||
-rw-r--r-- | gcc/config/alpha/predicates.md | 16 |
5 files changed, 31 insertions, 24 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e261bc0..5b82a85 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +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> * optabs.c (expand_vec_perm): Don't re-use SEL as target operand. @@ -363,8 +378,7 @@ 2015-05-18 Martin Liska <mliska@suse.cz> * dbgcnt.def: Add new counter. - * ipa-icf.c (sem_item_optimizer::merge_classes): Use the - counter. + * ipa-icf.c (sem_item_optimizer::merge_classes): Use the counter. 2015-05-18 Martin Liska <mliska@suse.cz> diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 6865321..1ba99d0 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -1352,7 +1352,7 @@ alpha_legitimize_reload_address (rtx x, && REG_P (XEXP (x, 0)) && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER && 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 low = ((val & 0xffff) ^ 0x8000) - 0x8000; @@ -1644,9 +1644,8 @@ alpha_preferred_reload_class(rtx x, enum reg_class rclass) return rclass; /* These sorts of constants we can easily drop to memory. */ - if (CONST_INT_P (x) - || GET_CODE (x) == CONST_WIDE_INT - || GET_CODE (x) == CONST_DOUBLE + if (CONST_SCALAR_INT_P (x) + || CONST_DOUBLE_P (x) || GET_CODE (x) == CONST_VECTOR) { if (rclass == FLOAT_REGS) @@ -2133,7 +2132,7 @@ alpha_legitimate_constant_p (machine_mode mode, rtx x) case CONST: 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); else return true; @@ -3283,8 +3282,7 @@ alpha_split_tmode_pair (rtx operands[4], machine_mode mode, operands[2] = adjust_address (operands[1], DImode, 0); break; - case CONST_INT: - case CONST_WIDE_INT: + CASE_CONST_SCALAR_INT: case CONST_DOUBLE: gcc_assert (operands[1] == CONST0_RTX (mode)); operands[2] = operands[3] = const0_rtx; @@ -5257,9 +5255,7 @@ print_operand (FILE *file, rtx x, int code) case 'M': /* 'b', 'w', 'l', or 'q' as the value of the constant. */ - if (!CONST_INT_P (x) - || (INTVAL (x) != 8 && INTVAL (x) != 16 - && INTVAL (x) != 32 && INTVAL (x) != 64)) + if (!mode_width_operand (x, VOIDmode)) output_operand_lossage ("invalid %%M value"); fprintf (file, "%s", diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md index 81c2d4f..7626d3f 100644 --- a/gcc/config/alpha/alpha.md +++ b/gcc/config/alpha/alpha.md @@ -4153,8 +4153,7 @@ /* We must put 64-bit constants in memory. We could keep the 32-bit constants in TImode and rely on the splitter, but this doesn't seem to be worth the pain. */ - else if (CONST_INT_P (operands[1]) - || GET_CODE (operands[1]) == CONST_WIDE_INT) + else if (CONST_SCALAR_INT_P (operands[1])) { rtx in[2], out[2], target; diff --git a/gcc/config/alpha/constraints.md b/gcc/config/alpha/constraints.md index f1e5333..6abba61 100644 --- a/gcc/config/alpha/constraints.md +++ b/gcc/config/alpha/constraints.md @@ -97,7 +97,7 @@ (define_memory_constraint "Q" "@internal A normal_memory_operand" (and (match_code "mem") - (not (match_test "GET_CODE (XEXP (op, 0)) == AND")))) + (not (match_code "and" "0")))) (define_constraint "R" "@internal A direct_call_operand" diff --git a/gcc/config/alpha/predicates.md b/gcc/config/alpha/predicates.md index 51a378e..30a0645 100644 --- a/gcc/config/alpha/predicates.md +++ b/gcc/config/alpha/predicates.md @@ -72,7 +72,7 @@ ;; Return 1 if the operand is a non-symbolic, nonzero constant operand. (define_predicate "non_zero_const_operand" (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. (define_predicate "const48_operand" @@ -150,8 +150,7 @@ ;; Return 1 if OP is a valid operand for the source of a move insn. (define_predicate "input_operand" - (match_code "label_ref,symbol_ref,const,high,reg,subreg,mem, - const_double,const_vector,const_int,const_wide_int") + (match_operand 0 "general_operand") { switch (GET_CODE (op)) { @@ -273,8 +272,8 @@ (define_predicate "call_operand" (ior (match_code "symbol_ref") (and (match_code "reg") - (ior (match_test "!TARGET_ABI_OSF") - (match_test "!HARD_REGISTER_P (op)") + (ior (not (match_test "TARGET_ABI_OSF")) + (not (match_test "HARD_REGISTER_P (op)")) (match_test "REGNO (op) == R27_REG"))))) ;; Return true if OP is a LABEL_REF, or SYMBOL_REF or CONST referencing @@ -371,10 +370,9 @@ (define_predicate "symbolic_operand" (ior (match_code "symbol_ref,label_ref") (and (match_code "const") - (match_test "GET_CODE (XEXP (op,0)) == PLUS - && (GET_CODE (XEXP (XEXP (op,0), 0)) == SYMBOL_REF - || GET_CODE (XEXP (XEXP (op,0), 0)) == LABEL_REF) - && CONST_INT_P (XEXP (XEXP (op,0), 1))")))) + (match_code "plus" "0") + (match_code "symbol_ref,label_ref" "00") + (match_code "const_int" "01")))) ;; Return true if OP is valid for 16-bit DTP relative relocations. (define_predicate "dtp16_symbolic_operand" |