Re: [PATCH][Combine] missed one ASHIFTRT opt opportunity

2014-07-30 Thread Richard Sandiford
Jiong Wang writes: > + /* If we have > + > +(ior (lshiftrt A imm1) (and (ashiftrt (A imm2)) mask)) > + > + where imm1 = imm2 + 1 > +mask = ((1 << imm1) - 1) << (mode_size (A) - imm1) > + > + then we may simplify this into > + > +(ashiftrt A imm1). > + > +

[PATCH][Combine] missed one ASHIFTRT opt opportunity

2014-07-29 Thread Jiong Wang
Suppose the following shift: T A = (T) B << C which met the following conditions: * T is a signed type with 2 x word_size. * B is with signed type with the size <= word_size. * C + sizeof (B) < word_size. |< T >| | high | low | | B shifted to | | E