From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id 095DC3858D20 for ; Mon, 11 Mar 2024 14:09:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 095DC3858D20 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 095DC3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::62d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710166191; cv=none; b=J6YZ+3WVmqpdsN2/a18YiXDRPBJcorzJGmAPdLFDMnhGaqEN5bM3ZLcsNzG14J1I15ItHIoeHTLdBAVtSAygxTQ9htecRW7j4dE534X0FjblHwTsOehZTrSs6HAbZkyb3c8gHArJ/T+h1f6YAphasSjeibsa7mX+72ntPsx15aA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710166191; c=relaxed/simple; bh=cIkhQHpXwBai7bKFxxdlHTb3MHzz4Ja4vA4TvNLlBhk=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=swfqyg+QbQcgn585G+71bKO5QGI7qTX6deFYm14/CJ5r9/Ga8c66OCyfCflqpYJFBY8uRx2IK8zHrz61CmetDyjSHghf33EcBKhrDzudN4naJTayPpDtmZRgPUKgER8baPkmaMhH1X+WyuHhqXVb0t8hYAUPjehd75xx123JQCE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a461c50deccso159751866b.0 for ; Mon, 11 Mar 2024 07:09:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1710166188; x=1710770988; 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=DIyTPh7GaQDwkdmgRE8/7pJnls1fw4HymTj9Ga3M9D0=; b=ECXFv8ZoS/sxE/1NPCSPkMYhf5eRTK3qbVbMDYFl1dDyRTU+4DoPVwdrm+FokVoeoM ZJs12gw/+tPAdgRYEEHHYqEs9shDsdqsdAbhMJOvH+DU2JqEHiCBRyJ25s+UVcdCR0Vq zrj8FxFgl5vSx5vY0fUlD73ueZ8nGZYhjlvG6v+PcZdCiAQD4XqJtJYti08AAK4z2b7a AXFD0hucsz4c+QE58cH/EEJGQKxDgTBxQkF0TcL8UEs3o0FuyG6pngY6fd0rDx3m8b09 B3j8cnzr5unF2SooYjlgoDTGc+JI5bFMVy2VnK9/tV9S5WJQ5+d+zHHsnaTqEHl0efKR wq7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710166188; x=1710770988; 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=DIyTPh7GaQDwkdmgRE8/7pJnls1fw4HymTj9Ga3M9D0=; b=qDfglXQK91jSmNlN6nZWC5Ux5RIToufZZV486suF1X5dzkbYk+kx7mB0TxDi1nJSiC yiv/Ls+/wQbgnDza93ZI5Cv5jd39cRjoK9O9KfDllZ3OM5Xn1eiPJwY63bfDHopden2i vPP1+WtQ0rbA5qgwMlxyrWufJq4MRuUiO5/g5p8FrR/Zio/v2OUTJvhS0QkbX24cvjts HKu1a0w61JkipbBIhyBV993xTKZL11r2Ii02M5WwpNTs7bv+Rk1pEz1vkEKvWocB3vSH fCoYAXGRTWGBMf1tCQkogYYC8hFGK2b+Sk8Vd8fH+ksuzly1sV7z6MiJxOSeTj8HDW5U OHAA== X-Forwarded-Encrypted: i=1; AJvYcCUk2NvwOTJtX4gDQNYBG2Yajgbt1mV7Iad2ZeIPmJy7C7U3tCIWFx7/OVQ4X6V2g6zF0KB61lQVWwCrudRyU5LzgTvHcCQ29A== X-Gm-Message-State: AOJu0YyU0fzoUfvlknjGabBds8Bp+UQW/fP8nsfBw9yCZq0r8J+gUU9P Oz/cO7tLsnkIOBuayvRc0FXhkHhT3nQBJEW3l0JJvsulA2eTY8BHaAeCo/CM0GoOe9Aa1kMp2fw = X-Google-Smtp-Source: AGHT+IFxeygpGv8f4iMIHMB+L8oQWAkXT/qPtrz5p+szbB+pkm5JhhK/YmFM+lMJSBz2U6SIYJ6TGg== X-Received: by 2002:a17:906:f9c5:b0:a45:c8cb:f5c1 with SMTP id lj5-20020a170906f9c500b00a45c8cbf5c1mr3856613ejb.63.1710166188373; Mon, 11 Mar 2024 07:09:48 -0700 (PDT) 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 pw27-20020a17090720bb00b00a44e65447f9sm2882503ejb.7.2024.03.11.07.09.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Mar 2024 07:09:48 -0700 (PDT) Message-ID: Date: Mon, 11 Mar 2024 15:09:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V2] Support APX NF Content-Language: en-US To: "Cui, Lili" Cc: "hjl.tools@gmail.com" , "binutils@sourceware.org" References: <20240304081527.1724628-1-lili.cui@intel.com> <84c732bb-ec84-416b-bc69-29f4f3b9ad0e@suse.com> From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgb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tSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr 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.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,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 11.03.2024 14:54, Cui, Lili wrote: >> -----Original Message----- >> From: Jan Beulich >> Sent: Friday, March 8, 2024 5:36 PM >> >> On 04.03.2024 09:15, Cui, Lili wrote: >>> @@ -7218,6 +7229,11 @@ parse_insn (const char *line, char *mnemonic, >> bool prefix_only) >>> /* {rex2} */ >>> i.rex2_encoding = true; >>> break; >>> + case Prefix_NF: >>> + /* {nf} */ >>> + i.has_nf = true; >>> + i.encoding = encoding_evex; >>> + break; >> >> It's not quite as easy, I'm afraid: Have you thought of the "{vex} {nf} ..." >> case? (I think I previously indicated that their combination, actually in either >> order, needs properly rejecting.) Without having spent much thought on it, >> perhaps it would suffice to check here that the field is still encoding_default, >> and leave the value alone otherwise (in order to reject bad combinations >> elsewhere). >> > Oh, good point. Do you think it's ok to report bad outside of "switch"? > > case Prefix_NF: > /* {nf} */ > i.has_nf = true; > - i.encoding = encoding_evex; > + if (i.encoding == encoding_default) > + i.encoding = encoding_evex; > break; > case Prefix_NoOptimize: > /* {nooptimize} */ > i.no_optimize = true; > break; > default: > abort (); > } > + if (i.has_nf && i.encoding != encoding_evex) > + { > + as_bad (_("{nf} cannot be combined with {vex}/{vex3}")); > + return NULL; > + } Where the checking is done is secondary to me. My primary point is that the above isn't correct: There are more encoding variants than just vex, vex3, and evex. That said, reporting the error right here may lead to multiple identical errors being reported for a single line of input. This wants avoiding, at which point placing the check here is ruled out. >>> --- a/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s >>> +++ b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s >>> @@ -23,7 +23,7 @@ _start: >>> .insn EVEX.L1.66.M12.W0 0x60, %di, %ax >>> >>> #EVEX_MAP4 movbe %r18w,%ax set EVEX.z == 0b1. >>> - .insn EVEX.L0.66.M12.W0 0x60, %di, %ax {%k7}{z} >>> + .insn EVEX.L0.66.M12.W0 0x60, %di, %ax {%k3}{z} >> >> What's going on here ... >> >>> @@ -33,17 +33,25 @@ _start: >>> .insn EVEX.L1.NP.0f38.W1 0xf5, %rax, (%rax,%rbx), %rcx >>> >>> #EVEX from VEX bzhi %rax,(%rax,%rbx),%rcx EVEX.P[23](EVEX.z) == >> 0b1 >>> - .insn EVEX.L0.NP.0f38.W1 0xf5, %rax, (%rax,%rbx), %rcx {%k7}{z} >>> + .insn EVEX.L0.NP.0f38.W1 0xf5, %rax, (%rax,%rbx), %rcx {%k3}{z} >> >> ... and here? This is the kind of thing that wants mentioning in the patch >> description. And once again, especially for larger patches it is generally a bad >> idea if they come with only legacy ChangeLog entries: >> These only say "what", never "why". (That said, I think I see why the change is >> needed.) > > Do you remember that you asked a bad report for illegal use of nf bit? Yes. > When we use K7 it sets the nf bit, not wanting to lose their original testing purpose due to the interception of nf, I adjusted its value. Yes. What's missing is an explanation for the need of this in the patch description. Without this you made me work out what this change is about, when otherwise I would have had to merely check that what you say fits what changes (i.e. me then knowing what exactly to look for). Jan