summaryrefslogtreecommitdiff
path: root/gcc/dojump.c
diff options
context:
space:
mode:
authorbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-28 17:03:03 +0000
committerbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-28 17:03:03 +0000
commitfb425e71a977225ec35b747f154904ec65592468 (patch)
tree6cb46c8b1432e5b2682ebbe1c480966ef11ded79 /gcc/dojump.c
parent80e1bfa19e430fa42f5c02972ac55c8dfc10d8c1 (diff)
downloadgcc-fb425e71a977225ec35b747f154904ec65592468.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149033 138bc75d-0d04-0410-961f-82ee72b054a4
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 131aaed977f..3685ff513d0 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);