Michael Collison <michael.colli...@arm.com> writes: > This patch improves additional cases of FP to integer conversions. > > Example 1: > > unsigned long > f7 (double x) > { > return (unsigned) y; > } > > > At -O2 > > Trunk generates: > > f7: > fcvtzu w0, d0 > uxtw x0, w0 > ret > > With the patch we can merge the zero-extend and reduce the sequence to one > instruction at -O2 > > f7: > fcvtzu x0, d0 > ret
Thanks for doing this, patch looks good to me FWIW. I think the patch actually uses "fcvtzu w0, d0", which unlike "fcvtzu x0, d0" preserves the rtl semantics exactly. > +/* { dg-final { scan-assembler "fcvtzu\\tw\[0-9\]+, d\[0-9\]+" } } */ > +/* { dg-final { scan-assembler "fcvtzu\\tw\[0-9\]+, s\[0-9\]+" } } */ Just wanted to plug curly-brace quoting, which avoids the extra backslashes: /* { dg-final { scan-assembler {fcvtzu\tw[0-9]+, d[0-9]+} } } */ /* { dg-final { scan-assembler {fcvtzu\tw[0-9]+, s[0-9]+} } } */ Either's fine though -- don't respin for that. :-) Richard