This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFC cond-optab] Never try conditional stores in wider modes if pattern fails
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 24 Mar 2009 11:51:38 +0100
- Subject: [RFC cond-optab] Never try conditional stores in wider modes if pattern fails
Hello, this patch comes from trying to convert Alpha to use cbranch and
cstore. It fixes assembly language differences for -mlong-double-128.
It goes like this. I'm testing this simple function
void branch_lt_flt (void) { if (flt < 5) f (g ()); }
with -mlong-double-128. For some reason I've not yet analyzed, the jump
is gimplified to "if (flt < 5.0e+0 != 0)" which requires a cstore. The
target is !TARGET_FIX, so it is not possible to emit a DFmode cstore.
My patched GCC finds no cstoresf4 pattern. Then it goes on to find a
cstoredf4 pattern, which is there but fails, and then finds a cstoretf4
pattern, which succeeds because the TFmode comparison libcall has a
DImode result.
Current GCC first looks for a cmpsf pattern and does not find it, then
for a cmpdf pattern and finds it. Then, since the slt pattern fails,
GCC does *not* go on with a cmptf pattern.
This sort of makes sense in this case, but I wonder if it should always
be like this.
Paolo
2009-03-24 Paolo Bonzini <bonzini@gnu.org>
* expmed.c (emit_store_flag): Don't try cstore optab further
if one existing pattern fails.
Index: gcc/expmed.c
===================================================================
--- gcc/expmed.c (branch cond-optab)
+++ gcc/expmed.c (working copy)
@@ -5316,6 +5316,7 @@ emit_store_flag (rtx target, enum rtx_co
}
delete_insns_since (last);
+ break;
}
}