On Mon, Mar 31, 2025 at 03:33:34PM +0200, Richard Biener wrote:
> On Mon, 31 Mar 2025, Jakub Jelinek wrote:
> 
> > On Mon, Mar 31, 2025 at 03:12:56PM +0200, Richard Biener wrote:
> > > The following fixes ix86_handle_option to properly handle -mno-sse4
> > > which is always handled as -msse4 with value unset.  I've verified
> > > no other OPT_mno_* is left around.
> > > 
> > > Bootstrap and regtest running on x86_64-unknown-linux-gnu.
> > > 
> > > This error goes back quite some time, I'm not sure how prevalent
> > > the use of -mno-sse4 is.  In fact I have no idea why we have
> > > OPT_mno_sse4 at all...
> > 
> > That is because SSE4 is SSE4.1 + SSE4.2.
> > So for -msse4 we want it to act as -msse4.2 and for -mno-sse4
> > to act as -mno-sse4.1
> 
> Yes, but it seems ix86_handle_option handles this via
> OPTION_MASK_ISA_SSE4_SET vs. ~OPTION_MASK_ISA_SSE4_UNSET.  So the
> question is what the -mno-sse4 options entry does.  I'll note

But
i386-common.cc:#define OPTION_MASK_ISA_SSE4_SET OPTION_MASK_ISA_SSE4_2_SET
i386-common.cc:#define OPTION_MASK_ISA_SSE4_UNSET OPTION_MASK_ISA_SSE4_1_UNSET
i386-common.cc:#define OPTION_MASK_ISA2_SSE4_UNSET OPTION_MASK_ISA2_SSE4_1_UNSET
which is exactly what it wants.

> that ix86_handle_option also unsets flags in ix86_isa_flags2
> with -mno-sse4 but the mno-sse4 options entry does not indicate
> that.

It does, that is the
  opts->x_ix86_isa_flags2 &= ~OPTION_MASK_ISA2_SSE4_UNSET;
  opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA2_SSE4_UNSET;
There is no OPTION_MASK_ISA2_SSE4_SET (like there is no
OPTION_MASK_ISA2_SSE{,[234],4_{1,2}}_SET, that isn't needed because
all the requirements of SSE4 still fit into ix86_isa_flags.

        Jakub

Reply via email to