Skip to content

Commit b6a97ea

Browse files
committed
refs #206: also handle the and masking variant
1 parent 76267f8 commit b6a97ea

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

gcc/bbb-opts.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5964,6 +5964,20 @@ opt_shift (void)
59645964
}
59655965
}
59665966
}
5967+
// there might be an AND
5968+
// and.l #255,dy
5969+
else if (jj->get_mode() == SImode && jj->get_src_op() == AND
5970+
&& !jj->is_src_mem())
5971+
{
5972+
int val = jj->get_src_intval();
5973+
if ((val == 255 && mode == QImode) || (val == 65535 && mode == HImode))
5974+
{
5975+
reduce = true;
5976+
if (srcop == ASHIFTRT)
5977+
srcop = LSHIFTRT;
5978+
SET_INSN_DELETED(jj->get_insn());
5979+
}
5980+
}
59675981
// move.b ..,dy or move.w ...,dy
59685982
else if (jj->get_mode() == mode)
59695983
{

0 commit comments

Comments
 (0)