This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
FLOAT_STORE_FLAG_VALUE change
- To: gcc-patches at gcc dot gnu dot org
- Subject: FLOAT_STORE_FLAG_VALUE change
- From: Richard Henderson <rth at cygnus dot com>
- Date: Mon, 17 Jan 2000 16:32:37 -0800
I've changed the definition of FLOAT_STORE_FLAG_VALUE to accept a
target mode. This so that I can use the real.h interface to build
the constants. This so that I can do 128-bit floats for Tru64 5.0.
r~
* combine.c (combine_simplify_rtx): Give FLOAT_STORE_FLAG_VALUE a mode.
* cse.c (find_comparison_args, fold_rtx): Likewise.
* integrate.c (subst_constants): Likewise.
* loop.c (get_condition): Likewise.
* tm.texi (FLOAT_STORE_FLAG_VALUE): Update docs.
* alpha.h (FLOAT_STORE_FLAG_VALUE): Use REAL_VALUE_ATOF.
Index: combine.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/combine.c,v
retrieving revision 1.110
diff -c -p -d -r1.110 combine.c
*** combine.c 2000/01/14 00:46:57 1.110
--- combine.c 2000/01/17 23:39:07
*************** combine_simplify_rtx (x, op0_mode, last,
*** 3555,3563 ****
temp = simplify_relational_operation (code, op0_mode,
XEXP (x, 0), XEXP (x, 1));
#ifdef FLOAT_STORE_FLAG_VALUE
! if (temp != 0 && GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
! temp = ((temp == const0_rtx) ? CONST0_RTX (GET_MODE (x))
! : immed_real_const_1 (FLOAT_STORE_FLAG_VALUE, GET_MODE (x)));
#endif
break;
case 'c':
--- 3555,3567 ----
temp = simplify_relational_operation (code, op0_mode,
XEXP (x, 0), XEXP (x, 1));
#ifdef FLOAT_STORE_FLAG_VALUE
! if (temp != 0 && GET_MODE_CLASS (mode) == MODE_FLOAT)
! {
! if (temp == const0_rtx)
! temp = CONST0_RTX (mode);
! else
! temp = immed_real_const_1 (FLOAT_STORE_FLAG_VALUE (mode), mode);
! }
#endif
break;
case 'c':
Index: cse.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cse.c,v
retrieving revision 1.126
diff -c -p -d -r1.126 cse.c
*** cse.c 2000/01/14 08:35:56 1.126
--- cse.c 2000/01/17 23:39:09
*************** find_comparison_args (code, parg1, parg2
*** 2899,2905 ****
&& code == LT && STORE_FLAG_VALUE == -1)
#ifdef FLOAT_STORE_FLAG_VALUE
|| (GET_MODE_CLASS (GET_MODE (arg1)) == MODE_FLOAT
! && FLOAT_STORE_FLAG_VALUE < 0)
#endif
)
x = arg1;
--- 2899,2906 ----
&& code == LT && STORE_FLAG_VALUE == -1)
#ifdef FLOAT_STORE_FLAG_VALUE
|| (GET_MODE_CLASS (GET_MODE (arg1)) == MODE_FLOAT
! && (REAL_VALUE_NEGATIVE
! (FLOAT_STORE_FLAG_VALUE (GET_MODE (arg1)))))
#endif
)
x = arg1;
*************** find_comparison_args (code, parg1, parg2
*** 2908,2914 ****
&& code == GE && STORE_FLAG_VALUE == -1)
#ifdef FLOAT_STORE_FLAG_VALUE
|| (GET_MODE_CLASS (GET_MODE (arg1)) == MODE_FLOAT
! && FLOAT_STORE_FLAG_VALUE < 0)
#endif
)
x = arg1, reverse_code = 1;
--- 2909,2916 ----
&& code == GE && STORE_FLAG_VALUE == -1)
#ifdef FLOAT_STORE_FLAG_VALUE
|| (GET_MODE_CLASS (GET_MODE (arg1)) == MODE_FLOAT
! && (REAL_VALUE_NEGATIVE
! (FLOAT_STORE_FLAG_VALUE (GET_MODE (arg1)))))
#endif
)
x = arg1, reverse_code = 1;
*************** find_comparison_args (code, parg1, parg2
*** 2954,2960 ****
#ifdef FLOAT_STORE_FLAG_VALUE
|| (code == LT
&& GET_MODE_CLASS (inner_mode) == MODE_FLOAT
! && FLOAT_STORE_FLAG_VALUE < 0)
#endif
)
&& GET_RTX_CLASS (GET_CODE (p->exp)) == '<'))
--- 2956,2963 ----
#ifdef FLOAT_STORE_FLAG_VALUE
|| (code == LT
&& GET_MODE_CLASS (inner_mode) == MODE_FLOAT
! && (REAL_VALUE_NEGATIVE
! (FLOAT_STORE_FLAG_VALUE (GET_MODE (arg1)))))
#endif
)
&& GET_RTX_CLASS (GET_CODE (p->exp)) == '<'))
*************** find_comparison_args (code, parg1, parg2
*** 2973,2979 ****
#ifdef FLOAT_STORE_FLAG_VALUE
|| (code == GE
&& GET_MODE_CLASS (inner_mode) == MODE_FLOAT
! && FLOAT_STORE_FLAG_VALUE < 0)
#endif
)
&& GET_RTX_CLASS (GET_CODE (p->exp)) == '<')
--- 2976,2983 ----
#ifdef FLOAT_STORE_FLAG_VALUE
|| (code == GE
&& GET_MODE_CLASS (inner_mode) == MODE_FLOAT
! && (REAL_VALUE_NEGATIVE
! (FLOAT_STORE_FLAG_VALUE (GET_MODE (arg1)))))
#endif
)
&& GET_RTX_CLASS (GET_CODE (p->exp)) == '<')
*************** fold_rtx (x, insn)
*** 3639,3646 ****
#ifdef FLOAT_STORE_FLAG_VALUE
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{
! true = CONST_DOUBLE_FROM_REAL_VALUE (FLOAT_STORE_FLAG_VALUE,
! mode);
false = CONST0_RTX (mode);
}
#endif
--- 3643,3650 ----
#ifdef FLOAT_STORE_FLAG_VALUE
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{
! true = (CONST_DOUBLE_FROM_REAL_VALUE
! (FLOAT_STORE_FLAG_VALUE (mode), mode));
false = CONST0_RTX (mode);
}
#endif
*************** fold_rtx (x, insn)
*** 3753,3760 ****
#ifdef FLOAT_STORE_FLAG_VALUE
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{
! true = CONST_DOUBLE_FROM_REAL_VALUE (FLOAT_STORE_FLAG_VALUE,
! mode);
false = CONST0_RTX (mode);
}
#endif
--- 3757,3764 ----
#ifdef FLOAT_STORE_FLAG_VALUE
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{
! true = (CONST_DOUBLE_FROM_REAL_VALUE
! (FLOAT_STORE_FLAG_VALUE (mode), mode));
false = CONST0_RTX (mode);
}
#endif
*************** fold_rtx (x, insn)
*** 3784,3791 ****
const_arg1 ? const_arg1 : folded_arg1);
#ifdef FLOAT_STORE_FLAG_VALUE
if (new != 0 && GET_MODE_CLASS (mode) == MODE_FLOAT)
! new = ((new == const0_rtx) ? CONST0_RTX (mode)
! : CONST_DOUBLE_FROM_REAL_VALUE (FLOAT_STORE_FLAG_VALUE, mode));
#endif
break;
--- 3788,3800 ----
const_arg1 ? const_arg1 : folded_arg1);
#ifdef FLOAT_STORE_FLAG_VALUE
if (new != 0 && GET_MODE_CLASS (mode) == MODE_FLOAT)
! {
! if (new == const0_rtx)
! new = CONST0_RTX (mode);
! else
! new = (CONST_DOUBLE_FROM_REAL_VALUE
! (FLOAT_STORE_FLAG_VALUE (mode), mode));
! }
#endif
break;
Index: integrate.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/integrate.c,v
retrieving revision 1.86
diff -c -p -d -r1.86 integrate.c
*** integrate.c 2000/01/17 15:28:04 1.86
--- integrate.c 2000/01/17 23:39:09
*************** subst_constants (loc, insn, map, memonly
*** 2384,2392 ****
XEXP (x, 0), XEXP (x, 1));
#ifdef FLOAT_STORE_FLAG_VALUE
if (new != 0 && GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
! new = ((new == const0_rtx) ? CONST0_RTX (GET_MODE (x))
! : CONST_DOUBLE_FROM_REAL_VALUE (FLOAT_STORE_FLAG_VALUE,
! GET_MODE (x)));
#endif
break;
}
--- 2384,2399 ----
XEXP (x, 0), XEXP (x, 1));
#ifdef FLOAT_STORE_FLAG_VALUE
if (new != 0 && GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
! {
! enum machine_mode mode = GET_MODE (x);
! if (new == const0_rtx)
! new = CONST0_RTX (mode);
! else
! {
! REAL_VALUE_TYPE val = FLOAT_STORE_FLAG_VALUE (mode);
! new = CONST_DOUBLE_FROM_REAL_VALUE (val, mode);
! }
! }
#endif
break;
}
Index: loop.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/loop.c,v
retrieving revision 1.218
diff -c -p -d -r1.218 loop.c
*** loop.c 2000/01/17 15:28:05 1.218
--- loop.c 2000/01/17 23:39:10
*************** get_condition (jump, earliest)
*** 9103,9109 ****
#ifdef FLOAT_STORE_FLAG_VALUE
|| (code == LT
&& GET_MODE_CLASS (inner_mode) == MODE_FLOAT
! && FLOAT_STORE_FLAG_VALUE < 0)
#endif
))
&& GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<'))
--- 9103,9110 ----
#ifdef FLOAT_STORE_FLAG_VALUE
|| (code == LT
&& GET_MODE_CLASS (inner_mode) == MODE_FLOAT
! && (REAL_VALUE_NEGATIVE
! (FLOAT_STORE_FLAG_VALUE (inner_mode))))
#endif
))
&& GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<'))
*************** get_condition (jump, earliest)
*** 9122,9128 ****
#ifdef FLOAT_STORE_FLAG_VALUE
|| (code == GE
&& GET_MODE_CLASS (inner_mode) == MODE_FLOAT
! && FLOAT_STORE_FLAG_VALUE < 0)
#endif
))
&& GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<'
--- 9123,9130 ----
#ifdef FLOAT_STORE_FLAG_VALUE
|| (code == GE
&& GET_MODE_CLASS (inner_mode) == MODE_FLOAT
! && (REAL_VALUE_NEGATIVE
! (FLOAT_STORE_FLAG_VALUE (inner_mode))))
#endif
))
&& GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<'
Index: tm.texi
===================================================================
RCS file: /cvs/gcc/egcs/gcc/tm.texi,v
retrieving revision 1.105
diff -c -p -d -r1.105 tm.texi
*** tm.texi 2000/01/14 21:19:51 1.105
--- tm.texi 2000/01/17 23:39:11
*************** You need not define @code{STORE_FLAG_VAL
*** 7485,7492 ****
instructions.
@findex FLOAT_STORE_FLAG_VALUE
! @item FLOAT_STORE_FLAG_VALUE
! A C expression that gives a non-zero floating point value that is
returned when comparison operators with floating-point results are true.
Define this macro on machine that have comparison operations that return
floating-point values. If there are no such operations, do not define
--- 7485,7492 ----
instructions.
@findex FLOAT_STORE_FLAG_VALUE
! @item FLOAT_STORE_FLAG_VALUE (@var{mode})
! A C expression that gives a non-zero @code{REAL_VALUE_TYPE} value that is
returned when comparison operators with floating-point results are true.
Define this macro on machine that have comparison operations that return
floating-point values. If there are no such operations, do not define
Index: alpha.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/alpha/alpha.h,v
retrieving revision 1.85
diff -c -p -d -r1.85 alpha.h
*** alpha.h 2000/01/04 20:09:18 1.85
--- alpha.h 2000/01/17 23:41:07
*************** do { \
*** 1674,1680 ****
/* Define the value returned by a floating-point comparison instruction. */
! #define FLOAT_STORE_FLAG_VALUE (TARGET_FLOAT_VAX ? 0.5 : 2.0)
/* Canonicalize a comparison from one we don't have to one we do have. */
--- 1674,1681 ----
/* Define the value returned by a floating-point comparison instruction. */
! #define FLOAT_STORE_FLAG_VALUE(MODE) \
! REAL_VALUE_ATOF ((TARGET_FLOAT_VAX ? "0.5" : "2.0"), (MODE))
/* Canonicalize a comparison from one we don't have to one we do have. */