On 17/03/14 10:27, Richard Earnshaw wrote:
On 16/03/14 12:30, Renlin Li wrote:
Hi all,

Thank you for your suggestions, Richard. I have updated the patch
accordingly.

This is an optimization patch which will combine  "ubfiz" and "orr"
insns with a single "bfi" when certain conditions meet.

tmp = (x & m) | ( (y & n) << lsb) can be presented using

      and tmp, x, m
      bfi tmp, y, #lsb, #width

if ((n+1) == 2^width) && (m & n << lsb) == 0.

A small test case is also added to verify it.

Is this Okay for stage-1?

Kind regards,
Renlin Li

This looks to me more like a 3 into two split operation where combine
needs some help to do the split, since the transformation is
non-trivial.  As such, I think you just need a define_split rather than
a define_insn_and_split (there's also no obvious reason why we would
want to defer this split until after register allocation).

Furthermore, you have an early-clobber situation here: it's important
that y and tmp aren't in the same register.  You appear to try to cater
for this by using an operand tie, but that's unnecessary in general (the
AND operation can write any usable register) and won't work in the
specific case where x = y.

R.

Hi Richard,

You are right, thank you for the suggestion. I will further consider and refine it.

Regards,
Renlin Li

Reply via email to