summaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-04 14:57:34 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-04 14:57:34 +0000
commit29852f1d5ac8757447e463d069fc2ff2aefa0f52 (patch)
treeba38aba87ed659ac926481e89ea08559f6c2b97f /gcc/ifcvt.c
parentd80efa726fcb355ff6a45acc49b4142c87fe41b9 (diff)
downloadgcc-29852f1d5ac8757447e463d069fc2ff2aefa0f52.tar.gz
* ifcvt.c (noce_try_sign_mask): Call emit_store_flag to generate
a "sign mask" instead of using ashr_optab directly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84081 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c6
1 files changed, 4 insertions, 2 deletions
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;