From: Roger Sayle Date: Sun, 4 Jul 2004 14:57:34 +0000 (+0000) Subject: ifcvt.c (noce_try_sign_mask): Call emit_store_flag to generate a "sign mask" instead... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b75941cbaa3e704709f1985169405d3e6efd9392;p=gcc.git ifcvt.c (noce_try_sign_mask): Call emit_store_flag to generate a "sign mask" instead of using ashr_optab directly. * ifcvt.c (noce_try_sign_mask): Call emit_store_flag to generate a "sign mask" instead of using ashr_optab directly. From-SVN: r84081 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5f635ca21b9..5ab3fee2a13 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-07-04 Roger Sayle + + * ifcvt.c (noce_try_sign_mask): Call emit_store_flag to generate + a "sign mask" instead of using ashr_optab directly. + 2004-07-04 Neil Booth * doc/cpp.texi: Don't document what we do for ill-formed expressions. diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index bd4c30c00ac..0be64727d35 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -1735,8 +1735,10 @@ noce_try_sign_mask (struct noce_if_info *if_info) return FALSE; start_sequence (); - c = gen_int_mode (GET_MODE_BITSIZE (mode) - 1, mode); - m = expand_binop (mode, ashr_optab, m, c, NULL_RTX, 0, OPTAB_DIRECT); + /* Use emit_store_flag to generate "m < 0 ? -1 : 0" instead of expanding + "(signed) m >> 31" directly. This benefits targets with specialized + insns to obtain the signmask, but still uses ashr_optab otherwise. */ + m = emit_store_flag (gen_reg_rtx (mode), LT, m, const0_rtx, mode, 0, -1); t = m ? expand_binop (mode, and_optab, m, t, NULL_RTX, 0, OPTAB_DIRECT) : NULL_RTX;