Message ID | abcf637b8332ba2417011fcbb1d86930e72965c9.1431268135.git.segher@kernel.crashing.org |
---|---|
State | New |
Headers | show |
On Sun, May 10, 2015 at 12:13 PM, Segher Boessenkool <segher@kernel.crashing.org> wrote: > The next patch will rename the "rlwinm" pattern (as well as the other patterns > that implement rlwinm, now unnamed). The only place that uses gen_rlwinm > (an expander) is better off expanding the separate operations separately. > Do so. > > Okay for trunk? > > > Segher > > > 2015-05-10 Segher Boessenkool <segher@kernel.crashing.org> > > * config/rs6000/rs6000.md (rs6000_adjust_atomic_subword): Use > gen_ashlsi3 and gen_andsi3 instead of gen_rlwinm. Okay. Thanks, David
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 7c59ac8..e5b8edd 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -20577,7 +20577,9 @@ rs6000_adjust_atomic_subword (rtx orig_mem, rtx *pshift, rtx *pmask) /* Shift amount for subword relative to aligned word. */ shift = gen_reg_rtx (SImode); addr = gen_lowpart (SImode, addr); - emit_insn (gen_rlwinm (shift, addr, GEN_INT (3), GEN_INT (shift_mask))); + rtx tmp = gen_reg_rtx (SImode); + emit_insn (gen_ashlsi3 (tmp, addr, GEN_INT (3))); + emit_insn (gen_andsi3 (shift, tmp, GEN_INT (shift_mask))); if (BYTES_BIG_ENDIAN) shift = expand_simple_binop (SImode, XOR, shift, GEN_INT (shift_mask), shift, 1, OPTAB_LIB_WIDEN);