aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.h
diff options
context:
space:
mode:
authorRichard Henderson <rth@gcc.gnu.org>2000-01-24 12:10:04 -0800
committerRichard Henderson <rth@gcc.gnu.org>2000-01-24 12:10:04 -0800
commit1eb8759b1bc0fd2a74ddbd83db1f01df1a35df69 (patch)
treea9f7967b844ec94122754eade0945e4f551bf9f1 /gcc/expr.h
parentd6cde8451a650824fcf971d56978b50d949aa3a2 (diff)
downloadgcc-1eb8759b1bc0fd2a74ddbd83db1f01df1a35df69.zip
gcc-1eb8759b1bc0fd2a74ddbd83db1f01df1a35df69.tar.gz
gcc-1eb8759b1bc0fd2a74ddbd83db1f01df1a35df69.tar.bz2
rtl.def: Add unordered fp comparisions.
* rtl.def: Add unordered fp comparisions. * tree.def: Likewise. * tree.h: Add ISO C 9x unordered fp comparision builtins. * builtins.c (expand_tree_builtin): New function. * c-typeck.c (build_function_call): Use it. (build_binary_op): Support unordered compares. * c-common.c (c_common_nodes_and_builtins): Add unordered compares. * combine.c (known_cond): Handle reverse_condition returning UNKNOWN. (reversible_comparison_p): Allow UNORDERED/ORDERED to be reversed. * cse.c (fold_rtx): Check FLOAT_MODE_P before reversing. (record_jump_equiv): Handle reverse_condition returning UNKNOWN. * jump.c (reverse_condition): Don't abort for UNLE etc, but return UNKNOWN. (swap_condition): Handle unordered compares. (thread_jumps): Check can_reverse before reversing. * loop.c (get_condition): Likewise. Allow UNORERED/ORDERED to be reversed for FP. * optabs.c (can_compare_p): New argument CODE. Verify branch or setcc is present before acking for cmp_optab. Update all callers. (prepare_float_lib_cmp, init_optabs): Handle UNORDERED. * expmed.c (do_cmp_and_jump): Update for can_compare_p. * expr.c (expand_expr): Likewise. Support unordered compares. (do_jump, do_store_flag): Likewise. * expr.h (enum libfunc_index): Add unordered compares. * Makefile.in (FPBIT_FUNCS): Add _unord_sf. (DPBIT_FUNCS): Add _unord_df. * config/fp-bit.c (_unord_f2): New. * fp-test.c (main): Try unordered compare builtins. * alpha-protos.h (alpha_fp_comparison_operator): Declare. * alpha.c (alpha_comparison_operator): Check mode properly. (alpha_swapped_comparison_operator): Likewise. (signed_comparison_operator): Likewise. (alpha_fp_comparison_operator): New. (alpha_emit_conditional_branch): Handle unordered compares. * alpha.h (PREDICATE_CODES): Update. * alpha.md (fp compares): Use alpha_fp_comparison_operator. (bunordered, bordered): New. * cp/call.c (build_over_call): Use expand_tree_builtin. * cp/typeck.c (build_function_call_real): Likewise. (build_binary_op_nodefault): Handle unordered compares. * gcc.c-torture/execute/ieee/fp-cmp-4.c: New. From-SVN: r31591
Diffstat (limited to 'gcc/expr.h')
-rw-r--r--gcc/expr.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/expr.h b/gcc/expr.h
index 9442f0f..95c6942 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -499,6 +499,7 @@ enum libfunc_index
LTI_gehf2,
LTI_lthf2,
LTI_lehf2,
+ LTI_unordhf2,
LTI_eqsf2,
LTI_nesf2,
@@ -506,6 +507,7 @@ enum libfunc_index
LTI_gesf2,
LTI_ltsf2,
LTI_lesf2,
+ LTI_unordsf2,
LTI_eqdf2,
LTI_nedf2,
@@ -513,6 +515,7 @@ enum libfunc_index
LTI_gedf2,
LTI_ltdf2,
LTI_ledf2,
+ LTI_unorddf2,
LTI_eqxf2,
LTI_nexf2,
@@ -520,6 +523,7 @@ enum libfunc_index
LTI_gexf2,
LTI_ltxf2,
LTI_lexf2,
+ LTI_unordxf2,
LTI_eqtf2,
LTI_netf2,
@@ -527,6 +531,7 @@ enum libfunc_index
LTI_getf2,
LTI_lttf2,
LTI_letf2,
+ LTI_unordtf2,
LTI_floatsisf,
LTI_floatdisf,
@@ -627,6 +632,7 @@ extern rtx libfunc_table[LTI_MAX];
#define gehf2_libfunc (libfunc_table[LTI_gehf2])
#define lthf2_libfunc (libfunc_table[LTI_lthf2])
#define lehf2_libfunc (libfunc_table[LTI_lehf2])
+#define unordhf2_libfunc (libfunc_table[LTI_unordhf2])
#define eqsf2_libfunc (libfunc_table[LTI_eqsf2])
#define nesf2_libfunc (libfunc_table[LTI_nesf2])
@@ -634,6 +640,7 @@ extern rtx libfunc_table[LTI_MAX];
#define gesf2_libfunc (libfunc_table[LTI_gesf2])
#define ltsf2_libfunc (libfunc_table[LTI_ltsf2])
#define lesf2_libfunc (libfunc_table[LTI_lesf2])
+#define unordsf2_libfunc (libfunc_table[LTI_unordsf2])
#define eqdf2_libfunc (libfunc_table[LTI_eqdf2])
#define nedf2_libfunc (libfunc_table[LTI_nedf2])
@@ -641,6 +648,7 @@ extern rtx libfunc_table[LTI_MAX];
#define gedf2_libfunc (libfunc_table[LTI_gedf2])
#define ltdf2_libfunc (libfunc_table[LTI_ltdf2])
#define ledf2_libfunc (libfunc_table[LTI_ledf2])
+#define unorddf2_libfunc (libfunc_table[LTI_unorddf2])
#define eqxf2_libfunc (libfunc_table[LTI_eqxf2])
#define nexf2_libfunc (libfunc_table[LTI_nexf2])
@@ -648,6 +656,7 @@ extern rtx libfunc_table[LTI_MAX];
#define gexf2_libfunc (libfunc_table[LTI_gexf2])
#define ltxf2_libfunc (libfunc_table[LTI_ltxf2])
#define lexf2_libfunc (libfunc_table[LTI_lexf2])
+#define unordxf2_libfunc (libfunc_table[LTI_unordxf2])
#define eqtf2_libfunc (libfunc_table[LTI_eqtf2])
#define netf2_libfunc (libfunc_table[LTI_netf2])
@@ -655,6 +664,7 @@ extern rtx libfunc_table[LTI_MAX];
#define getf2_libfunc (libfunc_table[LTI_getf2])
#define lttf2_libfunc (libfunc_table[LTI_lttf2])
#define letf2_libfunc (libfunc_table[LTI_letf2])
+#define unordtf2_libfunc (libfunc_table[LTI_unordtf2])
#define floatsisf_libfunc (libfunc_table[LTI_floatsisf])
#define floatdisf_libfunc (libfunc_table[LTI_floatdisf])
@@ -795,9 +805,11 @@ enum can_compare_purpose
ccp_cmov,
ccp_store_flag
};
+
/* Nonzero if a compare of mode MODE can be done straightforwardly
(without splitting it into pieces). */
-extern int can_compare_p PARAMS ((enum machine_mode, enum can_compare_purpose));
+extern int can_compare_p PARAMS ((enum rtx_code, enum machine_mode,
+ enum can_compare_purpose));
extern void prepare_cmp_insn PARAMS ((rtx *, rtx *, enum rtx_code *, rtx,
enum machine_mode *, int *, int,
@@ -885,6 +897,7 @@ extern rtx gen_cond_trap PARAMS ((enum rtx_code, rtx, rtx, rtx));
/* Functions from builtins.c: */
#ifdef TREE_CODE
extern rtx expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int));
+extern tree expand_tree_builtin PARAMS ((tree, tree, tree));
extern void std_expand_builtin_va_start PARAMS ((int, tree, rtx));
extern rtx std_expand_builtin_va_arg PARAMS ((tree, tree));
extern rtx expand_builtin_va_arg PARAMS ((tree, tree));