On Tue, 1 Apr 2025, Jakub Jelinek wrote: > On Tue, Apr 01, 2025 at 01:36:23PM +0800, Hongtao Liu wrote: > > >Changing ix86_valid_target_attribute_inner_p might be even better because > > >OPT_msse4 is RejectNegative option, so !value for it looks weird. > > msse4 is defined as ix86_opt_isa in ix86_valid_target_attribute_inner_p > > > > 1055 IX86_ATTR_ISA ("sse4", OPT_msse4), > > > > and would be handled in ix86_handle_option > > > > 1282 else if (type == ix86_opt_isa) > > 1283 { > > 1284 struct cl_decoded_option decoded; > > 1285 > > 1286 generate_option (opt, NULL, opt_set_p, CL_TARGET, > > &decoded); > > 1287 ix86_handle_option (opts, opts_set, > > 1288 &decoded, input_location); > > 1289 } > > > > So I think it's already correct here. > > The entries are > msse4 > Target RejectNegative Mask(ISA_SSE4_2) Var(ix86_isa_flags) Save > Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and SSE4.2 built-in functions and > code generation. > > mno-sse4 > Target RejectNegative InverseMask(ISA_SSE4_1) Var(ix86_isa_flags) Save > Do not support SSE4.1 and SSE4.2 built-in functions and code generation. > > so if it is turned into something without RejectNegative, > it will be wrong in the Mask argument, either for the positive or for the > negative case. > > I wonder though if msse4 should not be a Target RejectNegative Alias to > msse4.2 > and mno-sse4 RejectNegative Alias to mno-sse4.1. > Though, unsure if one will still be able to specify it in #pragma GCC target > or target attribute...
Yeah, I think the lack of Alias(-msse4.1,-msse4.2) aka alias to enable/disable two options is what makes it difficult. I'll post a v2 momentarily fixing up ix86_valid_target_attribute_inner_p instead. That at least seems quite a safe change (also for branches). Richard.