On Wed, Feb 24, 2016 at 5:57 PM, Segher Boessenkool <seg...@kernel.crashing.org> wrote: > Some DImode rotate-right-and-mask can be implemented best with a rlwinm > instruction: those that could be a lshiftrt instead of a rotatert, while > the mask is not right-aligned. Why the rotate in the testcase is not > optimised to a plain shift is another question, but we need to handle > it here anyway. We compute the shift amount for a 64-bit rotate. This > is 32 too high in this case; if we print using %h that is masked out (and > this doesn't silently let through invalid instructions, everything is > checked by rs6000_is_valid_shift_mask which is much more thorough). > > Built and tested on powerpc64-linux, -m32,-m64 and -mlra,-mno-lra. Also > tested the new test on powerpc64le-linux (where the test is skipped). > Is this okay for trunk? > > > Segher > > > 2016-02-24 Segher Boessenkool <seg...@kernel.crashing.org> > > PR target/69946 > * config/rs6000/rs6000.c (rs6000_insn_for_shift_mask): Print rlwinm > shift amount using %h. > > gcc/testsuite/ > * pr69946.c: New file.
Okay. Please add a short comment explaining why rs6000_insn_for_shift_mask doesn't need to match the logic in rs6000_is_valid_shift_mask converting rotates to simple shifts. Thanks, David