On 09/09/14 19:45, Xinliang David Li wrote: > Richard, thanks for the review. The revised patch is attached. Is this > one OK (after testing is done)? > > David > >
OK, but ... > 2014-09-08 Xinliang David Li <davi...@google.com> > > PR target/63209 > * config/arm/arm.md (movcond_addsi): Handle case where source > and target operands are the same Full stop at end of sentence. > > 2014-09-08 Xinliang David Li <davi...@google.com> > > PR target/63209 > * gcc.c-torture/execute/pr63209.c: New test > Likewise. > pr63209.txt > > > Index: config/arm/arm.md > =================================================================== > --- config/arm/arm.md (revision 215039) > +++ config/arm/arm.md (working copy) > @@ -9328,10 +9328,16 @@ > enum machine_mode mode = SELECT_CC_MODE (GET_CODE (operands[5]), > operands[3], operands[4]); > enum rtx_code rc = GET_CODE (operands[5]); > - > operands[6] = gen_rtx_REG (mode, CC_REGNUM); > gcc_assert (!(mode == CCFPmode || mode == CCFPEmode)); > - rc = reverse_condition (rc); > + if (REGNO (operands[2]) != REGNO (operands[0])) > + rc = reverse_condition (rc); > + else > + { > + rtx tmp = operands[1]; > + operands[1] = operands[2]; > + operands[2] = tmp; Please use tabs and white space consistently (use tabs). Also, you seem to have some trailing white space at the end of some lines. > + } > > operands[6] = gen_rtx_fmt_ee (rc, VOIDmode, operands[6], const0_rtx); > } > Index: testsuite/gcc.c-torture/execute/pr63209.c > =================================================================== > --- testsuite/gcc.c-torture/execute/pr63209.c (revision 0) > +++ testsuite/gcc.c-torture/execute/pr63209.c (revision 0) > @@ -0,0 +1,27 @@ > +static int Sub(int a, int b) { > + return b -a; > +} > + > +static unsigned Select(unsigned a, unsigned b, unsigned c) { > + const int pa_minus_pb = > + Sub((a >> 8) & 0xff, (b >> 8) & 0xff) + > + Sub((a >> 0) & 0xff, (b >> 0) & 0xff); > + return (pa_minus_pb <= 0) ? a : b; > +} > + > +__attribute__((noinline)) unsigned Predictor(unsigned left, const unsigned* > const top) { > + const unsigned pred = Select(top[1], left, top[0]); > + return pred; > +} > + > +int main(void) { > + const unsigned top[2] = {0xff7a7a7a, 0xff7a7a7a}; > + const unsigned left = 0xff7b7b7b; > + const unsigned pred = Predictor(left, top /*+ 1*/); > + if (pred == left) > + return 0; > + return 1; > +} > + > + > + >