https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69946
--- Comment #3 from Segher Boessenkool <segher at gcc dot gnu.org> --- Author: segher Date: Fri Feb 26 18:49:18 2016 New Revision: 233755 URL: https://gcc.gnu.org/viewcvs?rev=233755&root=gcc&view=rev Log: powerpc: Handle DImode rotatert implemented with rlwinm (PR69946) 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). PR target/69946 * config/rs6000/rs6000.c (rs6000_insn_for_shift_mask): Print rlwinm shift amount using %h. Add comment. gcc/testsuite/ * gcc.target/powerpc/pr69946.c: New file. Added: trunk/gcc/testsuite/gcc.target/powerpc/pr69946.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/rs6000/rs6000.c trunk/gcc/testsuite/ChangeLog