* config/alpha/alpha.c (alpha_legitimize_reload_address)
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 May 2015 15:09:09 +0000 (15:09 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 May 2015 15:09:09 +0000 (15:09 +0000)
(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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223371 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/alpha/alpha.c
gcc/config/alpha/alpha.md
gcc/config/alpha/constraints.md
gcc/config/alpha/predicates.md

index e261bc0..5b82a85 100644 (file)
@@ -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.
 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>
 
index 6865321..1ba99d0 100644 (file)
@@ -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",
index 81c2d4f..7626d3f 100644 (file)
   /* 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;
 
index f1e5333..6abba61 100644 (file)
@@ -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"
index 51a378e..30a0645 100644 (file)
@@ -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"
 
 ;; 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))
     {
 (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
 (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"