This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[cond-optab] use emit_store_flag when possible
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 11 Mar 2009 16:25:14 +0100
- Subject: [cond-optab] use emit_store_flag when possible
I found one place where expand was trying to outsmart itself by open
coding an invocation of emit_store_flag. This patch just uses
emit_store_flag.
I tried disabling the extendsidi2 pattern on i386 to see what happens
and there was no code change on simple testcases going through the
affected path.
Bootstrapped/regtested i686-pc-linux-gnu, but the path is never reached
during the bootstrap.
This will be resubmitted formally for 4.5, but reviews are welcome now too.
Paolo
2009-03-12 Paolo Bonzini <bonzini@gnu.org>
* expr.c (convert_move): Use emit_store_flag instead of
"emulating" it.
Index: gcc/expr.c
===================================================================
--- gcc/expr.c (branch cond-optab)
+++ gcc/expr.c (working copy)
@@ -588,27 +588,9 @@ convert_move (rtx to, rtx from, int unsi
if (unsignedp)
fill_value = const0_rtx;
else
- {
-#ifdef HAVE_slt
- if (HAVE_slt
- && insn_data[(int) CODE_FOR_slt].operand[0].mode == word_mode
- && STORE_FLAG_VALUE == -1)
- {
- emit_cmp_insn (lowfrom, const0_rtx, NE, NULL_RTX,
- lowpart_mode, 0);
- fill_value = gen_reg_rtx (word_mode);
- emit_insn (gen_slt (fill_value));
- }
- else
-#endif
- {
- fill_value
- = expand_shift (RSHIFT_EXPR, lowpart_mode, lowfrom,
- size_int (GET_MODE_BITSIZE (lowpart_mode) - 1),
- NULL_RTX, 0);
- fill_value = convert_to_mode (word_mode, fill_value, 1);
- }
- }
+ fill_value = emit_store_flag (gen_reg_rtx (word_mode),
+ LT, lowfrom, const0_rtx,
+ VOIDmode, 0, -1);
/* Fill the remaining words. */
for (i = GET_MODE_SIZE (lowpart_mode) / UNITS_PER_WORD; i < nwords; i++)