aboutsummaryrefslogtreecommitdiff
path: root/gcc/dojump.c
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2009-06-28 17:03:03 +0000
committerPaolo Bonzini <bonzini@gcc.gnu.org>2009-06-28 17:03:03 +0000
commit45475a3fb2c32ca082c07e633b2ded9ead70177e (patch)
tree6cb46c8b1432e5b2682ebbe1c480966ef11ded79 /gcc/dojump.c
parent495499daead6ed7050db2af715fabd4f472595cd (diff)
downloadgcc-45475a3fb2c32ca082c07e633b2ded9ead70177e.zip
gcc-45475a3fb2c32ca082c07e633b2ded9ead70177e.tar.gz
gcc-45475a3fb2c32ca082c07e633b2ded9ead70177e.tar.bz2
dojump.c (do_compare_rtx_and_jump): Try swapping the condition for floating point modes.
2009-06-28 Paolo Bonzini <bonzini@gnu.org> * dojump.c (do_compare_rtx_and_jump): Try swapping the condition for floating point modes. * expmed.c (emit_store_flag_1): Move here a bigger part of emit_store_flag. (emit_store_flag): Try swapping the condition for floating point modes. * optabs.c (emit_cmp_and_jump_insns): Cope with constant op0 better. From-SVN: r149033
Diffstat (limited to 'gcc/dojump.c')
-rw-r--r--gcc/dojump.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/gcc/dojump.c b/gcc/dojump.c
index 131aaed..3685ff5 100644
--- a/gcc/dojump.c
+++ b/gcc/dojump.c
@@ -920,16 +920,27 @@ do_compare_rtx_and_jump (rtx op0, rtx op1, enum rtx_code code, int unsignedp,
{
if (GET_MODE_CLASS (mode) == MODE_FLOAT
&& ! can_compare_p (code, mode, ccp_jump)
+ && can_compare_p (swap_condition (code), mode, ccp_jump))
+ {
+ rtx tmp;
+ code = swap_condition (code);
+ tmp = op0;
+ op0 = op1;
+ op1 = tmp;
+ }
+
+ else if (GET_MODE_CLASS (mode) == MODE_FLOAT
+ && ! can_compare_p (code, mode, ccp_jump)
- /* Never split ORDERED and UNORDERED. These must be implemented. */
- && (code != ORDERED && code != UNORDERED)
+ /* Never split ORDERED and UNORDERED. These must be implemented. */
+ && (code != ORDERED && code != UNORDERED)
- /* Split a floating-point comparison if we can jump on other
- conditions... */
- && (have_insn_for (COMPARE, mode)
+ /* Split a floating-point comparison if we can jump on other
+ conditions... */
+ && (have_insn_for (COMPARE, mode)
- /* ... or if there is no libcall for it. */
- || code_to_optab[code] == NULL))
+ /* ... or if there is no libcall for it. */
+ || code_to_optab[code] == NULL))
{
enum rtx_code first_code;
bool and_them = split_comparison (code, mode, &first_code, &code);