Hi Carl,

On Thu, Mar 12, 2020 at 09:57:06AM -0700, Carl Love wrote:
> > From the GCC manual:
> > 
> >   -mmfcrf    p4  2.01
> >   -mpopcntb  p5  2.02
> >   -mfprnd    p5+ 2.04  ("info gcc" says 2.03, that's wrong?  But the
> > ISA
> >                         says this is 2.02 even?  Now what!)
> >   -mcmpb     p6  2.05
> >   -mpopcntd  p7  2.06
> > 
> > (and there are more, in fact).
> 
> <snip>
> 
> > It would be better if you disallowed this option combination?  Don't
> > allow an options that says ISA X insns are allowed, but ISA Y insns
> > are
> > not, with Y < X.  In this case X is 2.06 and Y is 2.02 or 2.03 or
> > 2.04.
> 
> My fix was very specific to the builtin and the command line argument
> as pointed out in the bug report.  
> 
> Sounds like you are implying we should take a much more general
> approach to checking the command line args against the ISA level.  Such
> a test would need to go somewhere else not in the builtin expansion
> call.  We may want a routine that just does these checks which can then
> be called from the appropriate place.  Let me go look at the GCC manual
> and see about what all needs testing.

Yes, but only for this fprnd vs. 2.06 (vsx) situation.  Like we already
have:

  if (TARGET_DIRECT_MOVE && !TARGET_VSX)
    {
      if (rs6000_isa_flags_explicit & OPTION_MASK_DIRECT_MOVE)
        error ("%qs requires %qs", "-mdirect-move", "-mvsx");
      rs6000_isa_flags &= ~OPTION_MASK_DIRECT_MOVE;
    }

(and many other cases there), we could do this there as well (so, don't
allow -mvsx (maybe via a -mcpu= etc.) at the same time as -mno-fprnd).

Do you see problems with that?


Segher

Reply via email to