On Tue, Apr 1, 2025 at 3:56 PM Jakub Jelinek <ja...@redhat.com> 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. For the command line, or target attribute, the actual operation goes into ix86_handle_option, and as long as we get it right in this ix86_handle_option, everything else should be fine. As for the macros generated by the mask name (TARGET_SSE4_1_P), their meanings remain the same, so in my opinion they can be handled this way. But to be on the safe side, I agree that it should be adjusted in ix86_valid_target_attribute_inner_p first. In GCC16, we can do a refactor for this. > > 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... > > Jakub >
-- BR, Hongtao