On 05/10/2017 05:19 PM, Richard Henderson wrote:
On 05/10/2017 01:05 PM, Philippe Mathieu-Daudé wrote:
+-tcg_gen_shri_tl(ret, arg, ofs);
+-tcg_gen_andi_tl(ret, ret, len);
++tcg_gen_extract_tl(ret, arg, ofs, len);

You can't simply copy the and mask to the extract length.

You need to verify it's all low bits and convert that to a count of the
low bits.  E.g. 0xff -> 8.

Hey Richard, this pattern can be applied as long as len << ofs does not overflow target_long, regardless of low bits count, right?

Phil.

Reply via email to