Hi~

On Tue, May 19, 2020 at 03:20:37PM -0700, Douglas B Rupp wrote:
> On 5/19/20 3:03 PM, Segher Boessenkool wrote:
> >This is a compile test, so it does not matter at all what the kernel is
> >doing or not doing.  And the -mcpu=power8 flag should enable altivec.
> >Apparently it doesn't for you, but why is that?
> 
> It's likely the specs file we use for the kernel we are using for 
> testing with.
> 
> %{mcpu=604:%{!maltivec:%{!mno-altivec:-mno-altivec}}} 
> %{mcpu=604:%{!mvsx:%{!mno-vsx:-mno-vsx}}} 
> %{!mcpu=*:%{!maltivec:%{!mno-altivec:-mno-altivec}}} 
> %{!mcpu=*:%{!mvsx:%{!mno-vsx:-mno-vsx}}}
> 
> and
> 
> '--with-cpu=604'
> 
> >This shouldn't be fixed by whack-a-mole on individual testcases.
> >
> Perhaps a SUBTARGET_OVERRIDE incantation might work?  Any ideas or 
> advice you might have would be welcome.

[ pasting threads together: ]
> Apologies on this test, the problem is -mdejagnu-cpu doesn't get matched
> by the spec logic
> 
> If I pass -mcpu=power8, then indeed the test passes fine.
> 
> I'm not sure how to fix this cleanly.

So, which spec are those 4 lines above from?

We have as DRIVER_SELF_SPECS (see rs6000.h)
#define DRIVER_SELF_SPECS \
  "%{mdejagnu-cpu=*: %<mcpu=* -mcpu=%*}", \
  "%{mdejagnu-tune=*: %<mtune=* -mtune=%*}", \
  "%{mdejagnu-*: %<mdejagnu-*}", \
   SUBTARGET_DRIVER_SELF_SPECS
so -mdejagnu-cpu= is translated to -mcpu= very early.  But yours is
still done earlier?

It can of course be fixed by adding

%{mdejagnu-cpu=604:%{!maltivec:%{!mno-altivec:-mno-altivec}}} 
%{mdejagnu-cpu=604:%{!mvsx:%{!mno-vsx:-mno-vsx}}} 
%{!mdejagnu-cpu=*:%{!maltivec:%{!mno-altivec:-mno-altivec}}} 
%{!mdejagnu-cpu=*:%{!mvsx:%{!mno-vsx:-mno-vsx}}}

to your specs, but that is band-aid on top of band-aid.  Why do you want
to add -mno-altivec -mno-vsx whenever possible, anyway?


Segher

Reply via email to