optabs.c: Use SCALAR_FLOAT_MODE_P instead of explicitly testing GET_MODE_CLASS (x...
authorBen Elliston <bje@au.ibm.com>
Tue, 22 Nov 2005 05:19:29 +0000 (05:19 +0000)
committerBen Elliston <bje@gcc.gnu.org>
Tue, 22 Nov 2005 05:19:29 +0000 (16:19 +1100)
* optabs.c: Use SCALAR_FLOAT_MODE_P instead of explicitly testing
GET_MODE_CLASS (x) == MODE_FLOAT.
* config/i386/i386.c: Likewise.
* config/rs6000/xcoff.h: Likewise.
* config/rs6000/linux64.h: Likewise.
* config/rs6000/rs6000.c: Likewise.
* config/rs6000/rs6000.h: Likewise.
* config/rs6000/predicates.md: Likewise.
* config/rs6000/sysv4.h: Likewise.

From-SVN: r107348

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/rs6000/linux64.h
gcc/config/rs6000/predicates.md
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h
gcc/config/rs6000/sysv4.h
gcc/config/rs6000/xcoff.h
gcc/optabs.c

index 1261f4843b774385125ea5216999ffc15771f4f4..fa6a35cba6f252768da91a5710caf5e85b820373 100644 (file)
@@ -1,3 +1,15 @@
+2005-11-22  Ben Elliston  <bje@au.ibm.com>
+
+       * optabs.c: Use SCALAR_FLOAT_MODE_P instead of explicitly testing
+       GET_MODE_CLASS (x) == MODE_FLOAT.
+       * config/i386/i386.c: Likewise.
+       * config/rs6000/xcoff.h: Likewise.
+       * config/rs6000/linux64.h: Likewise.
+       * config/rs6000/rs6000.c: Likewise.
+       * config/rs6000/rs6000.h: Likewise.
+       * config/rs6000/predicates.md: Likewise.
+       * config/rs6000/sysv4.h: Likewise.
+
 2005-11-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * c-cppbuiltin.c (c_cpp_builtins): Define __pic__ and __PIC__ when
index 8d26074ba2a63808f5002ed5f80152243ce64eab..e1684c29d4eb095cd1b87b23f4f9a3520852cd23 100644 (file)
@@ -3615,7 +3615,7 @@ ix86_value_regno (enum machine_mode mode, tree func, tree fntype)
     return FIRST_SSE_REG;
 
   /* Most things go in %eax, except (unless -mno-fp-ret-in-387) fp values.  */
-  if (GET_MODE_CLASS (mode) != MODE_FLOAT || !TARGET_FLOAT_RETURNS_IN_80387)
+  if (!SCALAR_FLOAT_MODE_P (mode) || !TARGET_FLOAT_RETURNS_IN_80387)
     return 0;
 
   /* Floating point return values in %st(0), except for local functions when
@@ -9103,7 +9103,7 @@ ix86_fp_compare_mode (enum rtx_code code ATTRIBUTE_UNUSED)
 enum machine_mode
 ix86_cc_mode (enum rtx_code code, rtx op0, rtx op1)
 {
-  if (GET_MODE_CLASS (GET_MODE (op0)) == MODE_FLOAT)
+  if (SCALAR_FLOAT_MODE_P (GET_MODE (op0)))
     return ix86_fp_compare_mode (code);
   switch (code)
     {
@@ -9684,7 +9684,7 @@ ix86_expand_compare (enum rtx_code code, rtx *second_test, rtx *bypass_test)
       ret = gen_rtx_fmt_ee (code, VOIDmode, ix86_compare_emitted, const0_rtx);
       ix86_compare_emitted = NULL_RTX;
     }
-  else if (GET_MODE_CLASS (GET_MODE (op0)) == MODE_FLOAT)
+  else if (SCALAR_FLOAT_MODE_P (GET_MODE (op0)))
     ret = ix86_expand_fp_compare (code, op0, op1, NULL_RTX,
                                  second_test, bypass_test);
   else
index 46ae2b9867dc97a46d18ef936f0ee4aa1455ad84..1555d2968a7f4ba547bfec23c1c9f0716d7f5b41 100644 (file)
@@ -457,12 +457,12 @@ extern int dot_symbols;
           && ((TARGET_64BIT                                            \
                && (TARGET_POWERPC64                                    \
                    || TARGET_MINIMAL_TOC                               \
-                   || (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT     \
+                   || (SCALAR_FLOAT_MODE_P (GET_MODE (X))              \
                        && ! TARGET_NO_FP_IN_TOC)))                     \
               || (!TARGET_64BIT                                        \
                   && !TARGET_NO_FP_IN_TOC                              \
                   && !TARGET_RELOCATABLE                               \
-                  && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT       \
+                  && SCALAR_FLOAT_MODE_P (GET_MODE (X))                \
                   && BITS_PER_WORD == HOST_BITS_PER_INT)))))
 
 /* This ABI cannot use DBX_LINES_FUNCTION_RELATIVE, nor can it use
index a76280d5ac895610859dd4305be000fe74f23acc..885ac2cf39e45635e4deffb3b373dfc99a1092f1 100644 (file)
   REAL_VALUE_TYPE rv;
 
   if (GET_MODE (op) != mode
-      || (GET_MODE_CLASS (mode) != MODE_FLOAT && mode != DImode))
+      || (!SCALAR_FLOAT_MODE_P (mode) && mode != DImode))
     return 0;
 
   /* Consider all constants with -msoft-float to be easy.  */
 ;; or non-special register register field no cr0
 (define_predicate "zero_fp_constant"
   (and (match_code "const_double")
-       (match_test "GET_MODE_CLASS (mode) == MODE_FLOAT
+       (match_test "SCALAR_FLOAT_MODE_P (mode)
                    && op == CONST0_RTX (mode)")))
 
 ;; Return 1 if the operand is in volatile memory.  Note that during the
     return 1;
 
   /* For floating-point, easy constants are valid.  */
-  if (GET_MODE_CLASS (mode) == MODE_FLOAT
+  if (SCALAR_FLOAT_MODE_P (mode)
       && CONSTANT_P (op)
       && easy_fp_constant (op, mode))
     return 1;
 
   /* For floating-point or multi-word mode, the only remaining valid type
      is a register.  */
-  if (GET_MODE_CLASS (mode) == MODE_FLOAT
+  if (SCALAR_FLOAT_MODE_P (mode)
       || GET_MODE_SIZE (mode) > UNITS_PER_WORD)
     return register_operand (op, mode);
 
index cc2d14bfab768b334ddce0bc76124c656eb0fc2f..c3e50a314737c4ee3d95769685c7ac7747ca16fc 100644 (file)
@@ -1028,7 +1028,7 @@ rs6000_hard_regno_mode_ok (int regno, enum machine_mode mode)
   /* The float registers can only hold floating modes and DImode.  */
   if (FP_REGNO_P (regno))
     return
-      (GET_MODE_CLASS (mode) == MODE_FLOAT
+      (SCALAR_FLOAT_MODE_P (mode)
        && FP_REGNO_P (regno + HARD_REGNO_NREGS (regno, mode) - 1))
       || (GET_MODE_CLASS (mode) == MODE_INT
          && GET_MODE_SIZE (mode) == UNITS_PER_FP_WORD);
@@ -4126,7 +4126,7 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode)
 \f
 /* Nonzero if we can use a floating-point register to pass this arg.  */
 #define USE_FP_FOR_ARG_P(CUM,MODE,TYPE)                \
-  (GET_MODE_CLASS (MODE) == MODE_FLOAT         \
+  (SCALAR_FLOAT_MODE_P (MODE)                  \
    && (CUM)->fregno <= FP_ARG_MAX_REG          \
    && TARGET_HARD_FLOAT && TARGET_FPRS)
 
@@ -4650,7 +4650,7 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
 
       cum->words = align_words + n_words;
 
-      if (GET_MODE_CLASS (mode) == MODE_FLOAT
+      if (SCALAR_FLOAT_MODE_P (mode)
          && TARGET_HARD_FLOAT && TARGET_FPRS)
        cum->fregno += (GET_MODE_SIZE (mode) + 7) >> 3;
 
@@ -11698,7 +11698,7 @@ rs6000_emit_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond)
       return 0;
     }
   else if (TARGET_E500 && TARGET_HARD_FLOAT && !TARGET_FPRS
-          && GET_MODE_CLASS (compare_mode) == MODE_FLOAT)
+          && SCALAR_FLOAT_MODE_P (compare_mode))
     return 0;
 
   is_against_zero = op1 == CONST0_RTX (compare_mode);
@@ -11708,7 +11708,7 @@ rs6000_emit_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond)
      can't be generated if we care about that.  It's safe if one side
      of the construct is zero, since then no subtract will be
      generated.  */
-  if (GET_MODE_CLASS (compare_mode) == MODE_FLOAT
+  if (SCALAR_FLOAT_MODE_P (compare_mode)
       && flag_trapping_math && ! is_against_zero)
     return 0;
 
@@ -15249,7 +15249,7 @@ rs6000_output_function_epilogue (FILE *file,
 
              if (GET_CODE (parameter) == REG)
                {
-                 if (GET_MODE_CLASS (mode) == MODE_FLOAT)
+                 if (SCALAR_FLOAT_MODE_P (mode))
                    {
                      int bits;
 
@@ -18909,7 +18909,7 @@ rs6000_libcall_value (enum machine_mode mode)
                                      GEN_INT (4))));
     }
 
-  if (GET_MODE_CLASS (mode) == MODE_FLOAT
+  if (SCALAR_FLOAT_MODE_P (mode)
           && TARGET_HARD_FLOAT && TARGET_FPRS)
     regno = FP_ARG_RETURN;
   else if (ALTIVEC_VECTOR_MODE (mode)
index d2b54916003dd9ea4bf95c07c20fc396d71189c2..15e8296582959bab309436e5ec38509ddf4b2c3b 100644 (file)
@@ -814,10 +814,10 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
    If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
    for any hard reg, then this must be 0 for correct output.  */
 #define MODES_TIEABLE_P(MODE1, MODE2) \
-  (GET_MODE_CLASS (MODE1) == MODE_FLOAT                \
-   ? GET_MODE_CLASS (MODE2) == MODE_FLOAT      \
-   : GET_MODE_CLASS (MODE2) == MODE_FLOAT      \
-   ? GET_MODE_CLASS (MODE1) == MODE_FLOAT      \
+  (SCALAR_FLOAT_MODE_P (MODE1)                 \
+   ? SCALAR_FLOAT_MODE_P (MODE2)               \
+   : SCALAR_FLOAT_MODE_P (MODE2)               \
+   ? SCALAR_FLOAT_MODE_P (MODE1)               \
    : GET_MODE_CLASS (MODE1) == MODE_CC         \
    ? GET_MODE_CLASS (MODE2) == MODE_CC         \
    : GET_MODE_CLASS (MODE2) == MODE_CC         \
@@ -1951,7 +1951,7 @@ do {                                                              \
    comparison.  CCmode should be used in all other cases.  */
 
 #define SELECT_CC_MODE(OP,X,Y) \
-  (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT ? CCFPmode      \
+  (SCALAR_FLOAT_MODE_P (GET_MODE (X)) ? CCFPmode       \
    : (OP) == GTU || (OP) == LTU || (OP) == GEU || (OP) == LEU ? CCUNSmode \
    : (((OP) == EQ || (OP) == NE) && COMPARISON_P (X)                     \
       ? CCEQmode : CCmode))
index 38d921a4692d4e7ebce645b3cd07d8f6239567fa..238b497250fe25ce1e0485e5cfa2338f90322109 100644 (file)
@@ -508,7 +508,7 @@ fini_section (void)                                                 \
        || (!TARGET_NO_FP_IN_TOC                                                \
           && !TARGET_RELOCATABLE                                       \
           && GET_CODE (X) == CONST_DOUBLE                              \
-          && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT               \
+          && SCALAR_FLOAT_MODE_P (GET_MODE (X))                        \
           && BITS_PER_WORD == HOST_BITS_PER_INT)))
 
 /* These macros generate the special .type and .size directives which
index e954705c347620cfdfde968511799251c6242cee..822b5a0de5e5a23142590f0681805077581c09ce 100644 (file)
@@ -164,7 +164,7 @@ toc_section (void)                                  \
        || (GET_CODE (X) == CONST_DOUBLE                                        \
           && (TARGET_POWERPC64                                         \
               || TARGET_MINIMAL_TOC                                    \
-              || (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT          \
+              || (SCALAR_FLOAT_MODE_P (GET_MODE (X))                   \
                   && ! TARGET_NO_FP_IN_TOC)))))
 
 #define TARGET_ASM_GLOBALIZE_LABEL  rs6000_xcoff_asm_globalize_label
index d764017a5d94ab213e4b4add2b45fe4e235118ac..219998bac875d45b539d7889a4f9ecbfa8cec8f1 100644 (file)
@@ -2489,7 +2489,7 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
   if (unoptab->code == NEG)
     {
       /* Try negating floating point values by flipping the sign bit.  */
-      if (class == MODE_FLOAT)
+      if (SCALAR_FLOAT_MODE_P (class))
        {
          temp = expand_absneg_bit (NEG, mode, op0, target);
          if (temp)
@@ -3552,7 +3552,7 @@ prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size,
       return;
     }
 
-  gcc_assert (class == MODE_FLOAT);
+  gcc_assert (SCALAR_FLOAT_MODE_P (class));
   prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp);
 }