https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101393

Segher Boessenkool <segher at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amodra at gcc dot gnu.org

--- Comment #8 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Franz Sirl from comment #7)
> Created attachment 51189 [details]
> More complete trial patch to overhaul ASM_CPU_SPEC
> 
> This patch should be more complete now. It does the following basic things:

If it does a few things, it should be a few patches, not one.

>  - Only pass -many to the assembler when -massembler-any is given

Interesting idea!  I wonder how well that works, how many programs will
need to use that new flag (for their inline assembler code).

>  - Unify the non-AIX (for now) asm_cpu spec settings into rs6000-cpus.def.
> Currently this uses a "static inline" function because I developed on GCC10,
> on GCC11 and later using a constexpr would be much nicer.
> 
> Now, the other stuff to reliably handle -many would need some gas support,
> where I likely need some help, because I've no expertise there.
> 
> First, I suggest to introduce 2 assembler warning options:
> 
>  -wany-duplicates: Warn if the mnemonic to assemble has duplicates because
> of -many, this should limit the warnings to the most difficult cases. In the
> patch it's automatically enabled when -massembler-any is used.
>  -wany-strict: Warn if any mnemonic to assemble is only fulfilled because of
> -many.

You'll have to discuss this on binut...@sourceware.org .

> And also some additional/changed options for .machine:
> 
>  .machine "resetsticky": Reset the sticky flags (eg. VSX, AltiVec, ANY)
>  .machine "pushsticky": Push CPU+sticky settings, reset the sticky flags
>  .machine "push": Change to push CPU+sticky, keep the sticky flags
>  .machine "pop": Change to pop CPU+sticky

Why would you want this concept?  It is mixing .machine selection with
other things.

> The attached patch tries to make use of such a TBD change to gas.
> 
> Alternatively, gas could be changed to have -madditive-sticky and/or
> '.machine "additive-sticky"' to make any '.machine "realcpu"' reset the
> sticky flags and they have to be re-added again afterwards if needed. Maybe
> this push/pop-less solution would be even easier to handle in the compiler?
> 
> What do you think? I hope I addressed most of your concerns, suggestions
> welcome.

I don't think it is a good idea to add workaround upon workaround to avoid
some of the not-so-useful behaviours of -many.  Instead, we should just
not use -many?

[ Cc: Alan, for the binutils side of things ]

Reply via email to