]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
optabs.c (expand_abs_nojump): Use SCALAR_FLOAT_MODE_P instead of explicitly testing...
authorBen Elliston <bje@au.ibm.com>
Mon, 21 Nov 2005 20:53:27 +0000 (20:53 +0000)
committerBen Elliston <bje@gcc.gnu.org>
Mon, 21 Nov 2005 20:53:27 +0000 (07:53 +1100)
* optabs.c (expand_abs_nojump): Use SCALAR_FLOAT_MODE_P instead of
explicitly testing GET_MODE_CLASS (x) == MODE_FLOAT.
* genopinit.c (gen_insn): Likewise.
* reload.c (find_equiv_reg): Likewise.
* loop.c (load_mems): Likewise.
* rtlanal.c (may_trap_p_1, canonicalize_condition): Likewise.
* cse.c (find_comparison_args, fold_rtx): Likewise.
* dwarf2out.c (add_const_value_attribute): Likewise.
* expr.c (convert_move): Likewise.
* recog.c (general_operand, register_operand): Likewise.
* reg-stack.c (replace_reg): Likewise.
* tree-vect-generic.c (type_for_widest_vector_mode): Likewise.
* c-common.c (handle_vector_size_attribute): Likewise.
* simplify-rtx.c (simplify_const_unary_operation): Likewise.
(simplify_binary_operation_1): Likewise.
(simplify_const_binary_operation): Likewise.
(simplify_relational_operation): Likewise.
(simplify_const_relational_operation): Likewise.
(simplify_immed_subreg): Likewise.
* emit-rtl.c (gen_lowpart_common): Likewise.
* expmed.c (expand_mult): Likewise.
* stor-layout.c (layout_type): Likewise.

From-SVN: r107322

17 files changed:
gcc/ChangeLog
gcc/c-common.c
gcc/cse.c
gcc/dwarf2out.c
gcc/emit-rtl.c
gcc/expmed.c
gcc/expr.c
gcc/genopinit.c
gcc/loop.c
gcc/optabs.c
gcc/recog.c
gcc/reg-stack.c
gcc/reload.c
gcc/rtlanal.c
gcc/simplify-rtx.c
gcc/stor-layout.c
gcc/tree-vect-generic.c

index 38726f706cf54ea3129ab376ea83bce75a847490..528e7a86638434be025b63ca3a7516d43e4daf85 100644 (file)
@@ -1,3 +1,28 @@
+2005-11-22  Ben Elliston  <bje@au.ibm.com>
+
+       * optabs.c (expand_abs_nojump): Use SCALAR_FLOAT_MODE_P instead of
+       explicitly testing GET_MODE_CLASS (x) == MODE_FLOAT.
+       * genopinit.c (gen_insn): Likewise.
+       * reload.c (find_equiv_reg): Likewise.
+       * loop.c (load_mems): Likewise.
+       * rtlanal.c (may_trap_p_1, canonicalize_condition): Likewise.
+       * cse.c (find_comparison_args, fold_rtx): Likewise.
+       * dwarf2out.c (add_const_value_attribute): Likewise.
+       * expr.c (convert_move): Likewise.
+       * recog.c (general_operand, register_operand): Likewise.
+       * reg-stack.c (replace_reg): Likewise.
+       * tree-vect-generic.c (type_for_widest_vector_mode): Likewise.
+       * c-common.c (handle_vector_size_attribute): Likewise.
+       * simplify-rtx.c (simplify_const_unary_operation): Likewise.
+       (simplify_binary_operation_1): Likewise.
+       (simplify_const_binary_operation): Likewise.
+       (simplify_relational_operation): Likewise.
+       (simplify_const_relational_operation): Likewise.
+       (simplify_immed_subreg): Likewise.
+       * emit-rtl.c (gen_lowpart_common): Likewise.
+       * expmed.c (expand_mult): Likewise.
+       * stor-layout.c (layout_type): Likewise.
+
 2005-11-21  Paolo Bonzini  <bonzini@gnu.org>
 
        PR target/24951
index b54755da38b8ea191da3a2995c97fa4f23155210..bdaa9ccd460638297f95e1fee7f15a9f070ed4c8 100644 (file)
@@ -5164,7 +5164,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
   orig_mode = TYPE_MODE (type);
 
   if (TREE_CODE (type) == RECORD_TYPE
-      || (GET_MODE_CLASS (orig_mode) != MODE_FLOAT
+      || (!SCALAR_FLOAT_MODE_P (orig_mode)
          && GET_MODE_CLASS (orig_mode) != MODE_INT)
       || !host_integerp (TYPE_SIZE_UNIT (type), 1))
     {
index fdcbe19ba6551a1038df84654be81e7fada4834b..8ec610f48255bc28bed9209ea5e33b509b0a3ed4 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -3088,7 +3088,7 @@ find_comparison_args (enum rtx_code code, rtx *parg1, rtx *parg2,
              || (GET_MODE_CLASS (GET_MODE (arg1)) == MODE_INT
                  && code == LT && STORE_FLAG_VALUE == -1)
 #ifdef FLOAT_STORE_FLAG_VALUE
-             || (GET_MODE_CLASS (GET_MODE (arg1)) == MODE_FLOAT
+             || (SCALAR_FLOAT_MODE_P (arg1)
                  && (fsfv = FLOAT_STORE_FLAG_VALUE (GET_MODE (arg1)),
                      REAL_VALUE_NEGATIVE (fsfv)))
 #endif
@@ -3098,7 +3098,7 @@ find_comparison_args (enum rtx_code code, rtx *parg1, rtx *parg2,
                   || (GET_MODE_CLASS (GET_MODE (arg1)) == MODE_INT
                       && code == GE && STORE_FLAG_VALUE == -1)
 #ifdef FLOAT_STORE_FLAG_VALUE
-                  || (GET_MODE_CLASS (GET_MODE (arg1)) == MODE_FLOAT
+                  || (SCALAR_FLOAT_MODE_P (arg1)
                       && (fsfv = FLOAT_STORE_FLAG_VALUE (GET_MODE (arg1)),
                           REAL_VALUE_NEGATIVE (fsfv)))
 #endif
@@ -3161,7 +3161,7 @@ find_comparison_args (enum rtx_code code, rtx *parg1, rtx *parg2,
                              << (GET_MODE_BITSIZE (inner_mode) - 1))))
 #ifdef FLOAT_STORE_FLAG_VALUE
                   || (code == LT
-                      && GET_MODE_CLASS (inner_mode) == MODE_FLOAT
+                      && SCALAR_FLOAT_MODE_P (inner_mode)
                       && (fsfv = FLOAT_STORE_FLAG_VALUE (GET_MODE (arg1)),
                           REAL_VALUE_NEGATIVE (fsfv)))
 #endif
@@ -3181,7 +3181,7 @@ find_comparison_args (enum rtx_code code, rtx *parg1, rtx *parg2,
                               << (GET_MODE_BITSIZE (inner_mode) - 1))))
 #ifdef FLOAT_STORE_FLAG_VALUE
                    || (code == GE
-                       && GET_MODE_CLASS (inner_mode) == MODE_FLOAT
+                       && SCALAR_FLOAT_MODE_P (inner_mode)
                        && (fsfv = FLOAT_STORE_FLAG_VALUE (GET_MODE (arg1)),
                            REAL_VALUE_NEGATIVE (fsfv)))
 #endif
@@ -3946,7 +3946,7 @@ fold_rtx (rtx x, rtx insn)
          enum machine_mode mode_arg1;
 
 #ifdef FLOAT_STORE_FLAG_VALUE
-         if (GET_MODE_CLASS (mode) == MODE_FLOAT)
+         if (SCALAR_FLOAT_MODE (mode))
            {
              true_rtx = (CONST_DOUBLE_FROM_REAL_VALUE
                          (FLOAT_STORE_FLAG_VALUE (mode), mode));
@@ -4061,7 +4061,7 @@ fold_rtx (rtx x, rtx insn)
              rtx true_rtx = const_true_rtx, false_rtx = const0_rtx;
 
 #ifdef FLOAT_STORE_FLAG_VALUE
-             if (GET_MODE_CLASS (mode) == MODE_FLOAT)
+             if (SCALAR_FLOAT_MODE_P (mode))
                {
                  true_rtx = (CONST_DOUBLE_FROM_REAL_VALUE
                          (FLOAT_STORE_FLAG_VALUE (mode), mode));
index 60a7d558084fb3f75cb73ee7cdb61b2581012bc4..803898e03ed35209692a2c39d443c9aa233e844b 100644 (file)
@@ -9787,7 +9787,7 @@ add_const_value_attribute (dw_die_ref die, rtx rtl)
       {
        enum machine_mode mode = GET_MODE (rtl);
 
-       if (GET_MODE_CLASS (mode) == MODE_FLOAT)
+       if (SCALAR_FLOAT_MODE_P (mode))
          {
            unsigned int length = GET_MODE_SIZE (mode);
            unsigned char *array = ggc_alloc (length);
index 53bff455054b580bf34cc5857e105b985ed3e65a..d17258795fb4edbe5119094a61fdc2ce407b05a0 100644 (file)
@@ -1162,7 +1162,7 @@ gen_lowpart_common (enum machine_mode mode, rtx x)
     return 0;
 
   /* Don't allow generating paradoxical FLOAT_MODE subregs.  */
-  if (GET_MODE_CLASS (mode) == MODE_FLOAT && msize > xsize)
+  if (SCALAR_FLOAT_MODE_P (mode) && msize > xsize)
     return 0;
 
   offset = subreg_lowpart_offset (mode, innermode);
index 632f24ff53b2a6214cc389c61c2aa957ccd11079..58f179eacdc3b1fcba3025f6bb84b39be10c2994 100644 (file)
@@ -3155,7 +3155,7 @@ expand_mult (enum machine_mode mode, rtx op0, rtx op1, rtx target,
 
   /* Expand x*2.0 as x+x.  */
   if (GET_CODE (op1) == CONST_DOUBLE
-      && GET_MODE_CLASS (mode) == MODE_FLOAT)
+      && SCALAR_FLOAT_MODE_P (mode))
     {
       REAL_VALUE_TYPE d;
       REAL_VALUE_FROM_CONST_DOUBLE (d, op1);
index 60582c91db6c13c8cb0688cadc672612f74654e8..44ef18223f03d87bcf8d1074c7414605c66f068c 100644 (file)
@@ -349,8 +349,8 @@ convert_move (rtx to, rtx from, int unsignedp)
 {
   enum machine_mode to_mode = GET_MODE (to);
   enum machine_mode from_mode = GET_MODE (from);
-  int to_real = GET_MODE_CLASS (to_mode) == MODE_FLOAT;
-  int from_real = GET_MODE_CLASS (from_mode) == MODE_FLOAT;
+  int to_real = SCALAR_FLOAT_MODE_P (to_mode);
+  int from_real = SCALAR_FLOAT_MODE_P (from_mode);
   enum insn_code code;
   rtx libcall;
 
index c48d07979bd28b98a19f36b0853fa65217eafc39..0c4a397667ecc67f0d9e36ee97cbf85c692e9b9f 100644 (file)
@@ -354,7 +354,7 @@ gen_insn (rtx insn)
          case 'I':  case 'F':  case 'N':
            break;
          case 'V':
-            if (GET_MODE_CLASS (m1) == MODE_FLOAT)
+           if (SCALAR_FLOAT_MODE_P (m1))
               printf ("v");
             break;
          case 'a':
index 9efc84eff931df34b732d1fc8c496ecabb229a5b..0de77beab36278660b5c85f9aa63af44cb9226dc 100644 (file)
@@ -10816,7 +10816,7 @@ load_mems (const struct loop *loop)
        }
 
       if (flag_float_store && written
-         && GET_MODE_CLASS (GET_MODE (mem)) == MODE_FLOAT)
+         && SCALAR_FLOAT_MODE_P (GET_MODE (mem)))
        loop_info->mems[i].optimize = 0;
 
       /* If this MEM is written to, we must be sure that there
index b10dfa4b1319cbfedaf0c79b5083643bb1a71b1f..6b681a350c1242cfbef7b36f4543d7c2a3d4862c 100644 (file)
@@ -2641,7 +2641,7 @@ expand_abs_nojump (enum machine_mode mode, rtx op0, rtx target,
     return temp;
 
   /* For floating point modes, try clearing the sign bit.  */
-  if (GET_MODE_CLASS (mode) == MODE_FLOAT)
+  if (SCALAR_FLOAT_MODE_P (mode))
     {
       temp = expand_absneg_bit (ABS, mode, op0, target);
       if (temp)
index 16bb280d857cb0cab6b9c69ff08e9d8b3e5b60d3..ece44f792bdb522851c2bc495dae2544683dbb72 100644 (file)
@@ -1003,7 +1003,7 @@ general_operand (rtx op, enum machine_mode mode)
 
       /* FLOAT_MODE subregs can't be paradoxical.  Combine will occasionally
         create such rtl, and we must reject it.  */
-      if (GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT
+      if (SCALAR_FLOAT_MODE_P (GET_MODE (op))
          && GET_MODE_SIZE (GET_MODE (op)) > GET_MODE_SIZE (GET_MODE (sub)))
        return 0;
 
@@ -1087,7 +1087,7 @@ register_operand (rtx op, enum machine_mode mode)
 
       /* FLOAT_MODE subregs can't be paradoxical.  Combine will occasionally
         create such rtl, and we must reject it.  */
-      if (GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT
+      if (SCALAR_FLOAT_MODE_P (GET_MODE (op))
          && GET_MODE_SIZE (GET_MODE (op)) > GET_MODE_SIZE (GET_MODE (sub)))
        return 0;
 
index 665311c2b6be889cd15fbe415372ce865aab721a..2811a6b7d6074069b4568a60bb3fbfe23aa2b3a0 100644 (file)
@@ -690,7 +690,7 @@ replace_reg (rtx *reg, int regno)
   gcc_assert (regno <= LAST_STACK_REG);
   gcc_assert (STACK_REG_P (*reg));
 
-  gcc_assert (GET_MODE_CLASS (GET_MODE (*reg)) == MODE_FLOAT
+  gcc_assert (SCALAR_FLOAT_MODE_P (GET_MODE (*reg))
              || GET_MODE_CLASS (GET_MODE (*reg)) == MODE_COMPLEX_FLOAT);
 
   *reg = FP_MODE_REG (regno, GET_MODE (*reg));
index ed8aca5e86b4df38a0936b723889f4b2f5153d6b..1c1a441c345200e595c5d92647e39c933eaa3488 100644 (file)
@@ -6518,7 +6518,7 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other,
       enum rtx_code code = GET_CODE (XEXP (goal, 0));
       if (MEM_VOLATILE_P (goal))
        return 0;
-      if (flag_float_store && GET_MODE_CLASS (GET_MODE (goal)) == MODE_FLOAT)
+      if (flag_float_store && SCALAR_FLOAT_MODE_P (GET_MODE (goal)))
        return 0;
       /* An address with side effects must be reexecuted.  */
       switch (code)
@@ -6609,8 +6609,7 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other,
                               = true_regnum (valtry = SET_DEST (pat))) >= 0)
                          || (REG_P (SET_DEST (pat))
                              && GET_CODE (XEXP (tem, 0)) == CONST_DOUBLE
-                             && (GET_MODE_CLASS (GET_MODE (XEXP (tem, 0)))
-                                 == MODE_FLOAT)
+                             && SCALAR_FLOAT_MODE_P (GET_MODE (XEXP (tem, 0)))
                              && GET_CODE (goal) == CONST_INT
                              && 0 != (goaltry
                                       = operand_subword (XEXP (tem, 0), 0, 0,
@@ -6624,8 +6623,7 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other,
                                                          NULL_RTX))
                      && REG_P (SET_DEST (pat))
                      && GET_CODE (XEXP (tem, 0)) == CONST_DOUBLE
-                     && (GET_MODE_CLASS (GET_MODE (XEXP (tem, 0)))
-                         == MODE_FLOAT)
+                     && SCALAR_FLOAT_MODE_P (GET_MODE (XEXP (tem, 0)))
                      && GET_CODE (goal) == CONST_INT
                      && 0 != (goaltry = operand_subword (XEXP (tem, 0), 1, 0,
                                                          VOIDmode))
index 69488512f49320f25720208555a6ea6c1598f7ae..1248d470e33bb87f710d7a8ed1d126ab114a9564 100644 (file)
@@ -2155,7 +2155,7 @@ may_trap_p_1 (rtx x, bool unaligned_mems)
     case UMOD:
       if (HONOR_SNANS (GET_MODE (x)))
        return 1;
-      if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
+      if (SCALAR_FLOAT_MODE_P (GET_MODE (x)))
        return flag_trapping_math;
       if (!CONSTANT_P (XEXP (x, 1)) || (XEXP (x, 1) == const0_rtx))
        return 1;
@@ -2212,7 +2212,7 @@ may_trap_p_1 (rtx x, bool unaligned_mems)
 
     default:
       /* Any floating arithmetic may trap.  */
-      if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT
+      if (SCALAR_FLOAT_MODE_P (GET_MODE (x))
          && flag_trapping_math)
        return 1;
     }
@@ -4683,7 +4683,7 @@ canonicalize_condition (rtx insn, rtx cond, int reverse, rtx *earliest,
                                << (GET_MODE_BITSIZE (inner_mode) - 1))))
 #ifdef FLOAT_STORE_FLAG_VALUE
                     || (code == LT
-                        && GET_MODE_CLASS (inner_mode) == MODE_FLOAT
+                        && SCALAR_FLOAT_MODE_P (inner_mode)
                         && (fsfv = FLOAT_STORE_FLAG_VALUE (inner_mode),
                             REAL_VALUE_NEGATIVE (fsfv)))
 #endif
@@ -4703,7 +4703,7 @@ canonicalize_condition (rtx insn, rtx cond, int reverse, rtx *earliest,
                                << (GET_MODE_BITSIZE (inner_mode) - 1))))
 #ifdef FLOAT_STORE_FLAG_VALUE
                     || (code == GE
-                        && GET_MODE_CLASS (inner_mode) == MODE_FLOAT
+                        && SCALAR_FLOAT_MODE_P (inner_mode)
                         && (fsfv = FLOAT_STORE_FLAG_VALUE (inner_mode),
                             REAL_VALUE_NEGATIVE (fsfv)))
 #endif
index 657b2b59c23f7df0c842c23d1d308b583ba030f9..e9a5d1af5585663c819b812881c379f6c6bf32a1 100644 (file)
@@ -983,7 +983,7 @@ simplify_const_unary_operation (enum rtx_code code, enum machine_mode mode,
     }
 
   else if (GET_CODE (op) == CONST_DOUBLE
-          && GET_MODE_CLASS (mode) == MODE_FLOAT)
+          && SCALAR_FLOAT_MODE_P (mode))
     {
       REAL_VALUE_TYPE d, t;
       REAL_VALUE_FROM_CONST_DOUBLE (d, op);
@@ -1029,7 +1029,7 @@ simplify_const_unary_operation (enum rtx_code code, enum machine_mode mode,
     }
 
   else if (GET_CODE (op) == CONST_DOUBLE
-          && GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT
+          && SCALAR_FLOAT_MODE_P (GET_MODE (op))
           && GET_MODE_CLASS (mode) == MODE_INT
           && width <= 2*HOST_BITS_PER_WIDE_INT && width > 0)
     {
@@ -1610,7 +1610,7 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
 
       /* x*2 is x+x and x*(-1) is -x */
       if (GET_CODE (trueop1) == CONST_DOUBLE
-         && GET_MODE_CLASS (GET_MODE (trueop1)) == MODE_FLOAT
+         && SCALAR_FLOAT_MODE_P (GET_MODE (trueop1))
          && GET_MODE (op0) == mode)
        {
          REAL_VALUE_TYPE d;
@@ -1792,7 +1792,7 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
 
     case DIV:
       /* Handle floating point and integers separately.  */
-      if (GET_MODE_CLASS (mode) == MODE_FLOAT)
+      if (SCALAR_FLOAT_MODE_P (mode))
        {
          /* Maybe change 0.0 / x to 0.0.  This transformation isn't
             safe for modes with NaNs, since 0.0 / 0.0 will then be
@@ -2146,7 +2146,7 @@ simplify_const_binary_operation (enum rtx_code code, enum machine_mode mode,
       return gen_rtx_CONST_VECTOR (mode, v);
     }
 
-  if (GET_MODE_CLASS (mode) == MODE_FLOAT
+  if (SCALAR_FLOAT_MODE_P (mode)
       && GET_CODE (op0) == CONST_DOUBLE
       && GET_CODE (op1) == CONST_DOUBLE
       && mode == GET_MODE (op0) && mode == GET_MODE (op1))
@@ -2890,7 +2890,7 @@ simplify_relational_operation (enum rtx_code code, enum machine_mode mode,
   tem = simplify_const_relational_operation (code, cmp_mode, op0, op1);
   if (tem)
     {
-      if (GET_MODE_CLASS (mode) == MODE_FLOAT)
+      if (SCALAR_FLOAT_MODE_P (mode))
        {
           if (tem == const0_rtx)
             return CONST0_RTX (mode);
@@ -3108,7 +3108,7 @@ simplify_const_relational_operation (enum rtx_code code,
      the result.  */
   else if (GET_CODE (trueop0) == CONST_DOUBLE
           && GET_CODE (trueop1) == CONST_DOUBLE
-          && GET_MODE_CLASS (GET_MODE (trueop0)) == MODE_FLOAT)
+          && SCALAR_FLOAT_MODE_P (GET_MODE (trueop0)))
     {
       REAL_VALUE_TYPE d0, d1;
 
@@ -3642,7 +3642,7 @@ simplify_immed_subreg (enum machine_mode outermode, rtx op,
              long tmp[max_bitsize / 32];
              int bitsize = GET_MODE_BITSIZE (GET_MODE (el));
 
-             gcc_assert (GET_MODE_CLASS (GET_MODE (el)) == MODE_FLOAT);
+             gcc_assert (SCALAR_FLOAT_MODE_P (GET_MODE (el)));
              gcc_assert (bitsize <= elem_bitsize);
              gcc_assert (bitsize % value_bit == 0);
 
index 7b81abf5aee474f4091ec6b342561b0d9c77e112..97104d1af6ba06fd52c412ca89b42a35f24e90dd 100644 (file)
@@ -1645,7 +1645,7 @@ layout_type (tree type)
            enum machine_mode mode;
 
            /* First, look for a supported vector type.  */
-           if (GET_MODE_CLASS (innermode) == MODE_FLOAT)
+           if (SCALAR_FLOAT_MODE_P (innermode))
              mode = MIN_MODE_VECTOR_FLOAT;
            else
              mode = MIN_MODE_VECTOR_INT;
index 463b161a434cdb4285a34c796873e2ecdedbdaa9..cc834e4f23196d9234f5e76e47fefd359270970a 100644 (file)
@@ -348,7 +348,7 @@ type_for_widest_vector_mode (enum machine_mode inner_mode, optab op)
   enum machine_mode best_mode = VOIDmode, mode;
   int best_nunits = 0;
 
-  if (GET_MODE_CLASS (inner_mode) == MODE_FLOAT)
+  if (SCALAR_FLOAT_MODE_P (inner_mode))
     mode = MIN_MODE_VECTOR_FLOAT;
   else
     mode = MIN_MODE_VECTOR_INT;