+Fri Jan 5 16:29:49 MET 2001 Jan Hubicka <jh@suse.cz>
+
+ * simplify-rtx.c (cfc_args): add "unordered" field.
+ (check_fold_consts): Set unordered field.
+ (simplify_relational_operation): Simplify the unordered
+ comparisons.
+
+ * reg-stack.c (swap_rtx_condition): Ensure that the transformation
+ is valid.
+
+ * emit-rtl.c (try_split): Fix code to mark labels.
+ * jump.c (mark_jump_label): Make global.
+ * rtl.h (mark_jump_label): Declare.
+
+ * predict.c (estimate_probability): Handle unordred comparisons.
+
2001-01-05 Neil Booth <neil@daikokuya.demon.co.uk>
* cpp.texi: Update for -MP. Clarify behaviour of -MT.
/* Emit RTL for the GNU C-Compiler expander.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
&& rtx_equal_p (PATTERN (XVECEXP (seq, 0, i)), pat))
return trial;
- /* If we are splitting a JUMP_INSN, look for the JUMP_INSN in
- SEQ and copy our JUMP_LABEL to it. If JUMP_LABEL is non-zero,
- increment the usage count so we don't delete the label. */
-
- if (GET_CODE (trial) == JUMP_INSN)
- for (i = XVECLEN (seq, 0) - 1; i >= 0; i--)
- if (GET_CODE (XVECEXP (seq, 0, i)) == JUMP_INSN)
- {
- JUMP_LABEL (XVECEXP (seq, 0, i)) = JUMP_LABEL (trial);
-
- if (JUMP_LABEL (trial))
- LABEL_NUSES (JUMP_LABEL (trial))++;
- }
+ /* Mark labels. */
+ for (i = XVECLEN (seq, 0) - 1; i >= 0; i--)
+ if (GET_CODE (XVECEXP (seq, 0, i)) == JUMP_INSN)
+ mark_jump_label (PATTERN (XVECEXP (seq, 0, i)),
+ XVECEXP (seq, 0, i), 0, 0);
/* If we are splitting a CALL_INSN, look for the CALL_INSN
in SEQ and copy our CALL_INSN_FUNCTION_USAGE to it. */
/* Optimize jump instructions, for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997
- 1998, 1999, 2000 Free Software Foundation, Inc.
+ 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
static void do_cross_jump PARAMS ((rtx, rtx, rtx));
static int jump_back_p PARAMS ((rtx, rtx));
static int tension_vector_labels PARAMS ((rtx, int));
-static void mark_jump_label PARAMS ((rtx, rtx, int, int));
static void delete_computation PARAMS ((rtx));
static void redirect_exp_1 PARAMS ((rtx *, rtx, rtx, rtx));
static int redirect_exp PARAMS ((rtx, rtx, rtx));
Once reload has completed (CROSS_JUMP non-zero), we need not consider
two labels distinct if they are separated by only USE or CLOBBER insns. */
-static void
+void
mark_jump_label (x, insn, cross_jump, in_mem)
register rtx x;
rtx insn;
/* Branch prediction routines for the GNU compiler.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
goto emitnote;
case EQ:
+ case UNEQ:
prob = PROB_UNLIKELY;
goto emitnote;
case NE:
+ case LTGT:
prob = PROB_LIKELY;
goto emitnote;
+ case ORDERED:
+ prob = PROB_LIKELY;
+ goto emitnote;
+ case UNORDERED:
+ prob = PROB_UNLIKELY;
+ goto emitnote;
case LE:
case LT:
if (XEXP (cond, 1) == const0_rtx)
/* Register to Stack convert for GNU compiler.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
pat = PATTERN (insn);
}
- return swap_rtx_condition_1 (pat);
+ if (swap_rtx_condition_1 (pat))
+ {
+ INSN_CODE (insn) = -1;
+ if (recog_memoized (insn) == -1)
+ {
+ swap_rtx_condition_1 (pat);
+ return 0;
+ }
+ return 1;
+ }
+ return 0;
}
/* Handle a comparison. Special care needs to be taken to avoid
/* Register Transfer Language (RTL) definitions for GNU C-Compiler
Copyright (C) 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
extern enum rtx_code swap_condition PARAMS ((enum rtx_code));
extern enum rtx_code unsigned_condition PARAMS ((enum rtx_code));
extern enum rtx_code signed_condition PARAMS ((enum rtx_code));
+extern void mark_jump_label PARAMS ((rtx, rtx, int, int));
/* In reload.c */
extern rtx find_equiv_reg PARAMS ((rtx, rtx, enum reg_class, int, short *, int, enum machine_mode));
/* RTL simplification functions for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
{
rtx op0, op1; /* Input */
int equal, op0lt, op1lt; /* Output */
+ int unordered;
};
static void
struct cfc_args *args = (struct cfc_args *) data;
REAL_VALUE_TYPE d0, d1;
+ /* We may possibly raise an exception while reading the value. */
+ args->unordered = 1;
REAL_VALUE_FROM_CONST_DOUBLE (d0, args->op0);
REAL_VALUE_FROM_CONST_DOUBLE (d1, args->op1);
+
+ /* Comparisons of Inf versus Inf are ordered. */
+ if (REAL_VALUE_ISNAN (d0)
+ || REAL_VALUE_ISNAN (d1))
+ return;
args->equal = REAL_VALUES_EQUAL (d0, d1);
args->op0lt = REAL_VALUES_LESS (d0, d1);
args->op1lt = REAL_VALUES_LESS (d1, d0);
+ args->unordered = 0;
}
/* Like simplify_binary_operation except used for relational operators.
args.op0 = op0;
args.op1 = op1;
- if (do_float_handler(check_fold_consts, (PTR) &args) == 0)
- /* We got an exception from check_fold_consts() */
- return 0;
+
+ if (!do_float_handler(check_fold_consts, (PTR) &args))
+ args.unordered = 1;
+
+ if (args.unordered)
+ switch (code)
+ {
+ case UNEQ:
+ case UNLT:
+ case UNGT:
+ case UNLE:
+ case UNGE:
+ case NE:
+ case UNORDERED:
+ return const_true_rtx;
+ case EQ:
+ case LT:
+ case GT:
+ case LE:
+ case GE:
+ case LTGT:
+ case ORDERED:
+ return const0_rtx;
+ default:
+ return 0;
+ }
/* Receive output from check_fold_consts() */
equal = args.equal;
switch (code)
{
case EQ:
+ case UNEQ:
return equal ? const_true_rtx : const0_rtx;
case NE:
+ case LTGT:
return ! equal ? const_true_rtx : const0_rtx;
case LT:
+ case UNLT:
return op0lt ? const_true_rtx : const0_rtx;
case GT:
+ case UNGT:
return op1lt ? const_true_rtx : const0_rtx;
case LTU:
return op0ltu ? const_true_rtx : const0_rtx;
return equal || op0ltu ? const_true_rtx : const0_rtx;
case GEU:
return equal || op1ltu ? const_true_rtx : const0_rtx;
+ case ORDERED:
+ return const_true_rtx;
+ case UNORDERED:
+ return const0_rtx;
default:
abort ();
}