This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] rs6000: Fix fsel pattern (PR79211)
On Fri, Jan 27, 2017 at 05:36:10PM -0500, Michael Meissner wrote:
> On Fri, Jan 27, 2017 at 03:11:46PM +0000, Segher Boessenkool wrote:
> > The fsel define_insn uses fpr_reg_operand for its predicates. This
> > won't work because passes can put a hard register in the operands: in
> > the testcase, combine likes to forward the parameter registers to what
> > then is still an smin, and then split1 uses "*s<minmax><mode>3_fpr"
> > (which has gpc_reg_operand). And then we have a GPR in the operand,
> > which does not match fpr_reg_operand.
> >
> > It seems to me the predicates should be gpc_reg_operand here as well.
> > This patch changes that. Mike, does this look correct? Was there a
> > reason it used fpr_reg_operand?
> >
> > Bootstrapped and tested on powerpc64-linux.
>
> I dunno, we need to look at why somebody is putting a GPR in there in the first
> place. The instruction doesn't support GPRs. Perhaps the generator function
> should do a copy before doing the call.
This is the same for *all* other FP insns though!
I looked if perhaps this pattern would hide another one, but the xxsel
pattern uses a different mode (V2DI), so it cannot conflict.
Segher