mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-30 07:14:09 +08:00
flow.c (REVERSE_CONDEXEC_PREDICATES_P): Use the whole comparison, not just the codes, call reversed_comparison_code ().
* flow.c (REVERSE_CONDEXEC_PREDICATES_P): Use the whole comparison, not just the codes, call reversed_comparison_code (). (ior_reg_cond): Update arguments to REVERSE_CONDEXEC_PREDICATES_P. (not_reg_cond): Use reversed_comparison_code. (and_reg_cond): Likewise. * ifcvt.c (cond_exec_process_if_block): Likewise. * doc/tm.texi (REVERSE_CONDEXEC_PREDICATES_P): Update documentation. From-SVN: r86737
This commit is contained in:
parent
6903ecd491
commit
15dce8121c
@ -1,3 +1,13 @@
|
||||
2004-08-29 Richard Earnshaw <rearnsha@arm.com>
|
||||
|
||||
* flow.c (REVERSE_CONDEXEC_PREDICATES_P): Use the whole comparison, not
|
||||
just the codes, call reversed_comparison_code ().
|
||||
(ior_reg_cond): Update arguments to REVERSE_CONDEXEC_PREDICATES_P.
|
||||
(not_reg_cond): Use reversed_comparison_code.
|
||||
(and_reg_cond): Likewise.
|
||||
* ifcvt.c (cond_exec_process_if_block): Likewise.
|
||||
* doc/tm.texi (REVERSE_CONDEXEC_PREDICATES_P): Update documentation.
|
||||
|
||||
2004-08-29 Richard Earnshaw <rearnsha@arm.com>
|
||||
|
||||
* sched-deps.c (get_condition): Rewrite using jump support functions.
|
||||
|
@ -5240,16 +5240,17 @@ like:
|
||||
@end smallexample
|
||||
@end defmac
|
||||
|
||||
@defmac REVERSE_CONDEXEC_PREDICATES_P (@var{code1}, @var{code2})
|
||||
@defmac REVERSE_CONDEXEC_PREDICATES_P (@var{op1}, @var{op2})
|
||||
A C expression that returns true if the conditional execution predicate
|
||||
@var{code1} is the inverse of @var{code2} and vice versa. Define this to
|
||||
return 0 if the target has conditional execution predicates that cannot be
|
||||
reversed safely. If no expansion is specified, this macro is defined as
|
||||
follows:
|
||||
@var{op1}, a comparison operation, is the inverse of @var{op2} and vice
|
||||
versa. Define this to return 0 if the target has conditional execution
|
||||
predicates that cannot be reversed safely. There is no need to validate
|
||||
that the arguments of op1 and op2 are the same, this is done separately.
|
||||
If no expansion is specified, this macro is defined as follows:
|
||||
|
||||
@smallexample
|
||||
#define REVERSE_CONDEXEC_PREDICATES_P (x, y) \
|
||||
((x) == reverse_condition (y))
|
||||
(GET_CODE ((x)) == reversed_comparison_code ((y), NULL))
|
||||
@end smallexample
|
||||
@end defmac
|
||||
|
||||
|
14
gcc/flow.c
14
gcc/flow.c
@ -160,7 +160,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
|
||||
#ifdef HAVE_conditional_execution
|
||||
#ifndef REVERSE_CONDEXEC_PREDICATES_P
|
||||
#define REVERSE_CONDEXEC_PREDICATES_P(x, y) ((x) == reverse_condition (y))
|
||||
#define REVERSE_CONDEXEC_PREDICATES_P(x, y) \
|
||||
(GET_CODE ((x)) == reversed_comparison_code ((y), NULL))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -2996,7 +2997,7 @@ ior_reg_cond (rtx old, rtx x, int add)
|
||||
if (COMPARISON_P (old))
|
||||
{
|
||||
if (COMPARISON_P (x)
|
||||
&& REVERSE_CONDEXEC_PREDICATES_P (GET_CODE (x), GET_CODE (old))
|
||||
&& REVERSE_CONDEXEC_PREDICATES_P (x, old)
|
||||
&& REGNO (XEXP (x, 0)) == REGNO (XEXP (old, 0)))
|
||||
return const1_rtx;
|
||||
if (GET_CODE (x) == GET_CODE (old)
|
||||
@ -3079,14 +3080,11 @@ ior_reg_cond (rtx old, rtx x, int add)
|
||||
static rtx
|
||||
not_reg_cond (rtx x)
|
||||
{
|
||||
enum rtx_code x_code;
|
||||
|
||||
if (x == const0_rtx)
|
||||
return const1_rtx;
|
||||
else if (x == const1_rtx)
|
||||
return const0_rtx;
|
||||
x_code = GET_CODE (x);
|
||||
if (x_code == NOT)
|
||||
if (GET_CODE (x) == NOT)
|
||||
return XEXP (x, 0);
|
||||
if (COMPARISON_P (x)
|
||||
&& REG_P (XEXP (x, 0)))
|
||||
@ -3094,7 +3092,7 @@ not_reg_cond (rtx x)
|
||||
if (XEXP (x, 1) != const0_rtx)
|
||||
abort ();
|
||||
|
||||
return gen_rtx_fmt_ee (reverse_condition (x_code),
|
||||
return gen_rtx_fmt_ee (reversed_comparison_code (x, NULL),
|
||||
VOIDmode, XEXP (x, 0), const0_rtx);
|
||||
}
|
||||
return gen_rtx_NOT (0, x);
|
||||
@ -3108,7 +3106,7 @@ and_reg_cond (rtx old, rtx x, int add)
|
||||
if (COMPARISON_P (old))
|
||||
{
|
||||
if (COMPARISON_P (x)
|
||||
&& GET_CODE (x) == reverse_condition (GET_CODE (old))
|
||||
&& GET_CODE (x) == reversed_comparison_code (old, NULL)
|
||||
&& REGNO (XEXP (x, 0)) == REGNO (XEXP (old, 0)))
|
||||
return const0_rtx;
|
||||
if (GET_CODE (x) == GET_CODE (old)
|
||||
|
@ -491,6 +491,7 @@ cond_exec_process_if_block (ce_if_block_t * ce_info,
|
||||
{
|
||||
rtx start, end;
|
||||
rtx t, f;
|
||||
enum rtx_code f_code;
|
||||
|
||||
bb = block_fallthru (bb);
|
||||
start = first_active_insn (bb);
|
||||
@ -510,11 +511,11 @@ cond_exec_process_if_block (ce_if_block_t * ce_info,
|
||||
if (! t)
|
||||
goto fail;
|
||||
|
||||
f = gen_rtx_fmt_ee (reverse_condition (GET_CODE (t)),
|
||||
GET_MODE (t),
|
||||
XEXP (t, 0),
|
||||
XEXP (t, 1));
|
||||
f_code = reversed_comparison_code (t, BB_END (bb));
|
||||
if (f_code == UNKNOWN)
|
||||
goto fail;
|
||||
|
||||
f = gen_rtx_fmt_ee (f_code, GET_MODE (t), XEXP (t, 0), XEXP (t, 1));
|
||||
if (ce_info->and_and_p)
|
||||
{
|
||||
t = gen_rtx_AND (GET_MODE (t), true_expr, t);
|
||||
|
Loading…
Reference in New Issue
Block a user