On Wed, Apr 22, 2015 at 08:43:10AM -0500, Peter Bergner wrote: > > Maybe you can fold tabortdc with tabortwc now? Use one UNSPEC name > > for both, :GPR and <wd>? > > Wouldn't that change the tabortwc pattern to use DImode rather > than SImode when compiled with -m64 or -m32 -mpowerpc64? > I'm not sure we want that.
The GPR mode iterator creates two patterns, one for SI and one for DI, and the tabortwc would be the one for SI if you use <wd>. > > > + case HTM_BUILTIN_TTEST: /* Alias for: tabortwci. 0,r0,0 */ > > > + op[nopnds++] = GEN_INT (0); > > > + op[nopnds++] = gen_rtx_REG (SImode, 0); > > > + op[nopnds++] = GEN_INT (0); > > > > Is that really r0, isn't that (0|rA)? [Too lazy to read the docs myself > > right now, sorry.] > > The ISA doc shows: [snip] Thanks for looking it up! I'm still a bit worried about putting a reg in the RTL (while the instruction doesn't actually use one), but perhaps it's harmless. > > > + emit_insn (gen_movcc (subreg, cr)); > > > + emit_insn (gen_lshrsi3 (scratch2, scratch1, GEN_INT (28))); > > > + emit_insn (gen_andsi3 (target, scratch2, GEN_INT (0xf))); > > > + } > > > + } > > > > Don't we have helper functions/expanders to do these moves? Yuck. > > Heh, I looked. The only helper pattern was the movcc pattern, but > that placed the CR into bits 32-35 of the register. I needed the > shift to move it down into the low nibble and I use the "and", since > one of the move cr insns places two copies of the CR value into > bits 32-35 and 36-39. At least the VMX patterns have something like it for CR6. Probably not directly usable either, sigh. > > > -/* { dg-final { scan-assembler-times "tabortdc\\." 1 } } */ > > > -/* { dg-final { scan-assembler-times "tabortdci\\." 1 } } */ > > > +/* { dg-final { scan-assembler-times "tabortdc\\." 1 { target lp64 } } } > > > */ > > > +/* { dg-final { scan-assembler-times "tabortdci\\." 1 { target lp64 } } > > > } */ > > > > This skips this test on -m32 -mpowerpc64, is that on purpose? > > Ummm, not exactly. :-) Not that many people test that though. > I'll see if I can find a replacement for lp64 that covers that case. Maybe just { powerpc64 } works? > If not, I'm not too torn up if we skip it for -m32 -mpowerpc64. Me neither, just looked like an oversight. Segher