summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-21 20:53:27 +0000
committerbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-21 20:53:27 +0000
commitcee7491d23c19bbe3104115a4804075ab4df176e (patch)
treeb1c6ffb314a145e36beb4e77266fa8a7e304a015
parent7a0ef531a5387051c8c4d8eca9a1834d03cb7968 (diff)
downloadgcc-cee7491d23c19bbe3104115a4804075ab4df176e.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107322 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog25
-rw-r--r--gcc/c-common.c2
-rw-r--r--gcc/cse.c12
-rw-r--r--gcc/dwarf2out.c2
-rw-r--r--gcc/emit-rtl.c2
-rw-r--r--gcc/expmed.c2
-rw-r--r--gcc/expr.c4
-rw-r--r--gcc/genopinit.c2
-rw-r--r--gcc/loop.c2
-rw-r--r--gcc/optabs.c2
-rw-r--r--gcc/recog.c4
-rw-r--r--gcc/reg-stack.c2
-rw-r--r--gcc/reload.c8
-rw-r--r--gcc/rtlanal.c8
-rw-r--r--gcc/simplify-rtx.c16
-rw-r--r--gcc/stor-layout.c2
-rw-r--r--gcc/tree-vect-generic.c2
17 files changed, 60 insertions, 37 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 38726f706cf..528e7a86638 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/c-common.c b/gcc/c-common.c
index b54755da38b..bdaa9ccd460 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -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))
{
diff --git a/gcc/cse.c b/gcc/cse.c
index fdcbe19ba65..8ec610f4825 100644
--- 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));
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 60a7d558084..803898e03ed 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -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);
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 53bff455054..d17258795fb 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -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);
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 632f24ff53b..58f179eacdc 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -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);
diff --git a/gcc/expr.c b/gcc/expr.c
index 60582c91db6..44ef18223f0 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -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;
diff --git a/gcc/genopinit.c b/gcc/genopinit.c
index c48d07979bd..0c4a397667e 100644
--- a/gcc/genopinit.c
+++ b/gcc/genopinit.c
@@ -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':
diff --git a/gcc/loop.c b/gcc/loop.c
index 9efc84eff93..0de77beab36 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -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
diff --git a/gcc/optabs.c b/gcc/optabs.c
index b10dfa4b131..6b681a350c1 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -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)
diff --git a/gcc/recog.c b/gcc/recog.c
index 16bb280d857..ece44f792bd 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -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;
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 665311c2b6b..2811a6b7d60 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -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));
diff --git a/gcc/reload.c b/gcc/reload.c
index ed8aca5e86b..1c1a441c345 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -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))
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 69488512f49..1248d470e33 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -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
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 657b2b59c23..e9a5d1af558 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -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);
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 7b81abf5aee..97104d1af6b 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -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;
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index 463b161a434..cc834e4f231 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -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;