From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id A6CB53858CDB for ; Mon, 8 Jan 2024 08:58:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A6CB53858CDB Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A6CB53858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::231 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704704334; cv=none; b=L2W1/evnRZmGIu8aeQH/N6UFhWfz2Yp7hi3sIsgl0GqGmXAD5y2SUe3sgMyppD+PN7q3DbgRrAimSCeVN/ohJyqCAa0iJHbxqSmE1ArrD2AAjNI359BT/QGdJXK8XkqLuC2Pa9iRxX2PWqx/acbkxSTCZr0jyqgFMnOBAgXy4yM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704704334; c=relaxed/simple; bh=pEU743y113bj9pjcEewUjjBL4hvZocFBy9GLveMpe1g=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=FgwkTdNyzUyr9AMEEHd9y83ixWiQCGAmXrSS3FjoSvvbKDpDU6Tzh9R4vvDdXgPj21xRWXGorK6KLPgamivKZWc3zXVv8PotGVyIm4Fg4Kjbwo7e55E2xp+fJoU8LFN9wlFGG+czrqEYSTh7YLqVGcnb+/IgjPAx8UQdlziS2m4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2cd2f472665so15266011fa.2 for ; Mon, 08 Jan 2024 00:58:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1704704329; x=1705309129; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Wsh9QhNSKZgfh4BsqLIQoaieauGy/KQNcUaTDQugIjA=; b=MtmVBsSZgoCt0CheIcH5wror9MyGxSTef3tXO4P82FhLvvA4HSsEDYOam0DSsVflQ1 kSisLsg+XuHXPc/v32+Ag4ooYiXQ11E3Q/XZ7K/ZmSbWFsXoQvINCEDkv6ATpfiLBjmf /eP3NWOcXg68CwH7Zyyi1pK/VnNlrr7oBN85hDEH/h8wM4u+h1JT9NCA1mqO77iLvNGJ D5D/u1JdHINkvF3IY2+GuTqzbsyoPq5yb8EnFHUDn34QSL8zuxJYhKSwKLKSENRGxsPL s1o3/+7koHgCEE3QvSXlumAF47pmmanvz6uFlf51M1QgdTlS+A5Ihz2AVQ/lf6EYl9b/ rT5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704704329; x=1705309129; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Wsh9QhNSKZgfh4BsqLIQoaieauGy/KQNcUaTDQugIjA=; b=i3cXRqJoj85mr7S0o+SeLrpYPaItL4dcU6Ja9mp0SKeIrwnY2fmGAdAg7sRTClAGM2 2ADD+qLEbOdPEhis7eX9PomT6bINSaMd9fQy9dm5PsEgPW+CeGZ243nlet48CNEwRIQc 267nEFJ76KCHaMS0ehkM/qTysdZ5zGHAc/p/3f8XMdWTC41y/LfnOSV8f+hgOKek4koA f2f9Yoo90+QOIF8zEKDs73x2Pvp5ncQyRREO+zV4x1lOmTu4mKhWVX3ySj9S33SIRfsE u9aG+FJHUPmYXBuJw2pEUrMlh77Np3dKVWOJ0g4ujW6lOWgwEcf2lKxg+D/LhKmPXKHO 6U0w== X-Gm-Message-State: AOJu0Yzy8+JQDOVXELAzNIe3Oq90NDtwyWPuJDYC15ENwGKbmGF9DVJp JNRRMF3uQ/BZD0CPnAqq+sUbyvCaioLe X-Google-Smtp-Source: AGHT+IH83wDos4NetNTEhRYrIX+4MowvXN3fs0KEkO0M4dfZjXFRcWq61F3TB78eTIIaQXm9KhjnHg== X-Received: by 2002:a2e:b5bb:0:b0:2cd:241c:848d with SMTP id f27-20020a2eb5bb000000b002cd241c848dmr1031100ljn.103.1704704329178; Mon, 08 Jan 2024 00:58:49 -0800 (PST) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id i13-20020a05663815cd00b0046e255b3cf8sm491057jat.115.2024.01.08.00.58.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Jan 2024 00:58:48 -0800 (PST) Message-ID: <11d23d18-142c-4c32-bab2-6ddfd9257051@suse.com> Date: Mon, 8 Jan 2024 09:58:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] x86: add missing APX logic to cpu_flags_match() Content-Language: en-US To: "Cui, Lili" Cc: "H.J. Lu" , Binutils References: <8662338c-e85a-4b84-a941-31170794dfe5@suse.com> From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5Cl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AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3025.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 08.01.2024 09:30, Cui, Lili wrote: >>>> --- a/gas/config/tc-i386.c >>>> +++ b/gas/config/tc-i386.c >>>> @@ -1940,6 +1940,30 @@ cpu_flags_match (const insn_template *t) >>>> any.bitfield.cpuavx512vl = 0; >>>> } >>>> } >>>> + >>>> + /* Dual non-APX/APX templates need massaging from what APX_F() in >> the >>>> + opcode table has produced. While the direct transformation of the >>>> + incoming cpuid&(cpuid|APX_F) would be to cpuid&(cpuid) / >>>> cpuid&(APX_F) >>>> + respectively, it's cheaper to move to just cpuid / cpuid&APX_F >>>> + instead. */ >>>> + if (any.bitfield.cpuapx_f >>>> + && (any.bitfield.cpubmi || any.bitfield.cpubmi2 >>>> + || any.bitfield.cpuavx512f || any.bitfield.cpuavx512bw >>>> + || any.bitfield.cpuavx512dq || any.bitfield.cpuamx_tile >>>> + || any.bitfield.cpucmpccxadd)) >>>> + { >>>> + /* These checks (verifying that APX_F() was properly used in the >>>> + opcode table entry) make sure there's no need for an "else" to >>>> + the "if()" below. */ >>>> + gas_assert (!cpu_flags_all_zero (&all)); >>>> + cpu = cpu_flags_and (all, any); >>>> + gas_assert (cpu_flags_equal (&cpu, &all)); >>>> + >>>> + if (need_evex_encoding (t)) >>>> + all = any; >>>> + >>> >>>> + memset (&any, 0, sizeof (any)); >>> >>> Wouldn't it make sense to put it in the else branch and clean out APX-F >> specifically? Just like you did before. >>> >>> if (need_evex_encoding (t)) >>> all = any; >>> else >>> any.bitfield.cpuapx_f = 0; >> >> That was an alternative I did consider, yes, but the way I've done it is overall >> more self-consistent imo, at the expense of being less consistent with the >> AVX/AVX512 logic (the moving of "any" to "all" isn't consistent with that >> anyway). >> > > memset (&any, 0, sizeof (any)); > > I'd say this would make "any" not match the actual value, which might be used later, but it's been cleared here. I'm afraid I don't get what you're trying to tell me. Jan