From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id C22453858430 for ; Thu, 1 Dec 2022 16:43:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C22453858430 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-x231.google.com with SMTP id v13so2620031oie.3 for ; Thu, 01 Dec 2022 08:43:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=b8wbPwdKzocxDLcnPy24r8OV49CF/59mMsdIx7NUfTE=; b=U9Hp11wcllWjAUm69x+gbWKt5lZMQ7aCdGty/0F+hkIlmMLgi1tNhbXCsiraRv1G8X bOzsGzcMvLagBcZYk33dTci3QD79PXvgc/HnuZXgSfUe99BnSEY9pHalNKKx0WxtfFlD 6ZsLE2BgfOLUKMpnIeQ4ManxkPpE4dEWfWEY9e7V3ADbTSCLdfl5z6ffrTzhakj03TCl kqvW6TpzmdZJgFVu0LJtwxd3PF3Qn8X/5Psqtm7QmqjW6M63HiNJnDdVgnxoo0MEQQwI LjmlfcrujjEKBH9gDmcacZ4i+2Xs9wFCbGSWdLFwrx8HDlH5VQ4+e+NFF7pQhxqKrcoM miZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=b8wbPwdKzocxDLcnPy24r8OV49CF/59mMsdIx7NUfTE=; b=61KZ3mczrEEwfW1v8dx4luV1s+mDBl9H3geSvBWBLa4SuQ9umYWWV4dVldEyo8rfRQ XQSl089enED24ESrpwlInT3Egdj51yQXON/RacWsW8INDe6kzZN8ye3CF06ceRRHyhqV HRhD/dCvZ1Hqb3xJOeKnFYL9sfFWwp49mbbfilCfaHkocknrqBMOfxNMOFJgDk7rDUSz x5AkopHDtZ/DQFqcOVsM8JCs1SpRwn6Mq93O4s1nCxV1HWpIGbcca1GmC/VXdxGAfsFk NVY1RrT4FTOIw6DdDPk4jY2x2s97NMeAmSuqZZEWLse/cuYgWbS/soe0cLq088JAvBA3 pS2w== X-Gm-Message-State: ANoB5pmxXqsQwtpam/ofrGJ6HIObazP3r6bQPCsFeYfE14wRxPBmjJSq 4nSBLEr2b17kJiM2FQxoZl0y/VJ1trVpR4XnQj7mLc8b X-Google-Smtp-Source: AA0mqf5FHAY8C52q5ZfMsGo8vVbTLZz1NG+GJLTOYRFQEobXQm2PeZxRJI8lv6jYHj8GRNKWcLckLgP00TcIOpFB5Ec= X-Received: by 2002:a05:6808:22a0:b0:35b:c6c4:7a33 with SMTP id bo32-20020a05680822a000b0035bc6c47a33mr6190229oib.266.1669913024109; Thu, 01 Dec 2022 08:43:44 -0800 (PST) MIME-Version: 1.0 References: <35539292-53a8-292d-2f5d-f65ad02a36bb@suse.com> In-Reply-To: <35539292-53a8-292d-2f5d-f65ad02a36bb@suse.com> From: "H.J. Lu" Date: Thu, 1 Dec 2022 08:43:08 -0800 Message-ID: Subject: Re: [PATCH] x86: simplify and slightly correct XCHG vs NOP checking To: Jan Beulich Cc: Binutils Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3017.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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 Thu, Dec 1, 2022 at 1:11 AM Jan Beulich wrote: > > For one, because of CheckRegSize, there's no need to check the size of > both (register) operands. And then in process_suffix() check opcode > space rather than the (potentially ambiguous) extension opcode. > > --- a/gas/config/tc-i386.c > +++ b/gas/config/tc-i386.c > @@ -6686,8 +6686,7 @@ match_template (char mnem_suffix) > && t->opcode_modifier.opcodespace == SPACE_BASE > && i.types[0].bitfield.instance == Accum > && i.types[0].bitfield.dword > - && i.types[1].bitfield.instance == Accum > - && i.types[1].bitfield.dword) > + && i.types[1].bitfield.instance == Accum) > continue; > /* xrelease mov %eax, is another special case. It must not > match the accumulator-only encoding of mov. */ > @@ -7408,11 +7407,10 @@ process_suffix (void) > need rex64. */ > && ! (i.operands == 2 > && i.tm.base_opcode == 0x90 > - && i.tm.extension_opcode == None > + && i.tm.opcode_modifier.opcodespace == SPACE_BASE > && i.types[0].bitfield.instance == Accum > && i.types[0].bitfield.qword > - && i.types[1].bitfield.instance == Accum > - && i.types[1].bitfield.qword)) > + && i.types[1].bitfield.instance == Accum)) > i.rex |= REX_W; > > break; OK. Thanks. -- H.J.