On Sun, Jul 12, 2015 at 04:18:31PM -0400, David Edelsohn wrote: > On Sun, Jul 12, 2015 at 1:08 PM, Segher Boessenkool > <seg...@kernel.crashing.org> wrote: > > This rewrites all the rotate-and-mask and insert patterns. > > This is great! I'm glad that you completed this feature.
Compared to mainline the results do look good, and some of bugs I found in the old patterns have disappeared. I particularly like the fact that the "S" and "T" operand constraints are no longer needed. There are one or two regressions related to a TODO that Segher added. The following produces poorer code than mainline. extern void lfoo (long); void mask2_cond1 (long x) { if ((x & 0x00fff000000fffffL) > 0) lfoo (0); } void mask2_cond2 (long x) { if ((x & 0x00fff000000fffffL) > 0) lfoo (x & 0x00fff000000fffffL); } Also, rs6000.md patterns uses SImode for the rotate/shift count. Segher has added some new insns that use DImode when 64-bit. I think that inconsistency ought to be fixed. (I haven't completely analysed this) but won't (define_insn_and_split "*and<mode>3_imm_dot_shifted" [snip] (lshiftrt:GPR (match_operand:GPR 1 "gpc_reg_operand" "%r,r") (match_operand:GPR 4 "const_int_operand" "n,n")) ^^^this fail to match combined patterns generated from other rs6000.md patterns like (define_insn "lshr<mode>3" [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") (lshiftrt:GPR (match_operand:GPR 1 "gpc_reg_operand" "r") (match_operand:SI 2 "reg_or_cint_operand" "rn")))] ^^this? -- Alan Modra Australia Development Lab, IBM