diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-24 20:10:04 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-24 20:10:04 +0000 |
commit | a4110d9a66b1bfab2679b8b4774839bcfb1b3cba (patch) | |
tree | a9f7967b844ec94122754eade0945e4f551bf9f1 /gcc/c-common.c | |
parent | 8581412d5881e717bf3351f305d6b2e99dd64f96 (diff) | |
download | gcc-a4110d9a66b1bfab2679b8b4774839bcfb1b3cba.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31591 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 0ce1ff19a4f..6d9181094b4 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -3710,6 +3710,20 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins) builtin_function ("__builtin_trap", void_ftype, BUILT_IN_TRAP, BUILT_IN_NORMAL, NULL_PTR); + /* ISO C99 IEEE Unordered compares. */ + builtin_function ("__builtin_isgreater", default_function_type, + BUILT_IN_ISGREATER, BUILT_IN_NORMAL, NULL_PTR); + builtin_function ("__builtin_isgreaterequal", default_function_type, + BUILT_IN_ISGREATEREQUAL, BUILT_IN_NORMAL, NULL_PTR); + builtin_function ("__builtin_isless", default_function_type, + BUILT_IN_ISLESS, BUILT_IN_NORMAL, NULL_PTR); + builtin_function ("__builtin_islessequal", default_function_type, + BUILT_IN_ISLESSEQUAL, BUILT_IN_NORMAL, NULL_PTR); + builtin_function ("__builtin_islessgreater", default_function_type, + BUILT_IN_ISLESSGREATER, BUILT_IN_NORMAL, NULL_PTR); + builtin_function ("__builtin_isunordered", default_function_type, + BUILT_IN_ISUNORDERED, BUILT_IN_NORMAL, NULL_PTR); + /* Untyped call and return. */ builtin_function ("__builtin_apply_args", ptr_ftype, BUILT_IN_APPLY_ARGS, BUILT_IN_NORMAL, NULL_PTR); |