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
This commit is contained in:
Roger Sayle 2004-07-04 14:57:34 +00:00 committed by Roger Sayle
parent a09d474429
commit b75941cbaa
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2004-07-04 Roger Sayle <roger@eyesopen.com>
* 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 <neil@duron.akihabara.co.uk>
* doc/cpp.texi: Don't document what we do for ill-formed expressions.

View File

@ -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;