From patchwork Thu Nov 3 16:57:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 80702 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp734679qge; Thu, 3 Nov 2016 09:58:21 -0700 (PDT) X-Received: by 10.99.146.22 with SMTP id o22mr1867380pgd.40.1478192301241; Thu, 03 Nov 2016 09:58:21 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id z195si10648161pgz.197.2016.11.03.09.58.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Nov 2016 09:58:21 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-return-94333-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of binutils-return-94333-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=binutils-return-94333-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; q=dns; s=default; b=OLTB 8J28XaCHOGHgj68xA9+LL/khudWGtQKfDlimJ5q+1dMhZTzCM0t/O+hG2JhLXbnp kHOOSrxJa2yFCyrSsIEjf+ESJbGEIVC2fqKyTLdsiDQAcDlBRyuNXztQRoNi421N sepd/NhC7R1M51p48r0iAoQPTzwxMG/cSLpoNvA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; s=default; bh=RLrMC81H2Y BGCLfVrmVd5v4qFOc=; b=xVFzSHLjiMstvoXUqEsRStDwJ08e5whHB5lP9DC408 65OwnfHGHD1UZP6g/Gj1lqjRPcpYvJC1B2ZxMrEqoKc8cl5i7DuFD3aCywGD/xs9 GX83jHnPbZxKNyE5N/5FZzRoipoDIueGbOgUfJrPQZJVbOAw8tF9kTUBpbWFJbyk c= Received: (qmail 48811 invoked by alias); 3 Nov 2016 16:58:06 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Delivered-To: mailing list binutils@sourceware.org Received: (qmail 48744 invoked by uid 89); 3 Nov 2016 16:58:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=no version=3.3.2 spammy=D*suse.com, jbeulichsusecom, Beulich, JBeulichsusecom X-HELO: mail-qk0-f195.google.com Received: from mail-qk0-f195.google.com (HELO mail-qk0-f195.google.com) (209.85.220.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 03 Nov 2016 16:57:54 +0000 Received: by mail-qk0-f195.google.com with SMTP id o68so3860508qkf.1 for ; Thu, 03 Nov 2016 09:57:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Eiz6pQdxsATcR4nPDwD+bpCHgiBdN30z58PvRK/Iuy4=; b=iZxUX1/LrRqAVPwI7jjbDpfnkLKqAbpbYC2wnjRDbyQw7J7NsEs1gR9QC5e8M7QIbk K2wbiPVP87ZEFoe9d7G5zWtgX56ghc0uEWmqb7OLesKs1k/Sv0t8QhyVk9f3dLi7B+RG SV0XNqNxufJtWgG1E41VO29XhlNd8nHm42C+W2cmQFu7HQV8ErkcTEHrP0tNnvWaZOKJ 0CmNRKah9kyaAqQRJwszkpxEoHafvvcv4ZCjSBJKMfxga3/mqYsgs9+PG5cs2DaQNIhy TiwnsdAUXI2f/Uy2WLNo5qvepKA/YNuItR9FbsGXsMxmGHMdWcm9kxD1DNL0UXxeGmqv g18Q== X-Gm-Message-State: ABUngvdnt62hT0O4m5F3NFHIub3EkAqbolygKY6b6ucxair2miFWj7sXMShuS7C3sFwBbyyUXvqvQV9uSrJM1g== X-Received: by 10.55.12.19 with SMTP id 19mr9759439qkm.100.1478192272387; Thu, 03 Nov 2016 09:57:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.32.197 with HTTP; Thu, 3 Nov 2016 09:57:51 -0700 (PDT) In-Reply-To: References: <20161103161838.GA23454@intel.com> <581B7487020000780011C0CF@prv-mh.provo.novell.com> From: "H.J. Lu" Date: Thu, 3 Nov 2016 09:57:51 -0700 Message-ID: Subject: Re: [PATCH, committed] X86: Decode opcode 0x82 as opcode 0x80 in 32-bit mode To: Jan Beulich Cc: Binutils X-IsSubscribed: yes On Thu, Nov 3, 2016 at 9:45 AM, H.J. Lu wrote: > On Thu, Nov 3, 2016 at 9:31 AM, Jan Beulich wrote: >>>>> On 03.11.16 at 17:18, wrote: >>> Update x86 disassembler to treat opcode 0x82 as an aliase of opcode 0x80 >>> in 32-bit mode. >>> >>> gas/ >>> >>> PR binutils/20754 >>> * testsuite/gas/i386/opcode.s: Add tests for opcode 0x82. >>> * testsuite/gas/i386/opcode-intel.d: Updated. >>> * testsuite/gas/i386/opcode.d: Likewise. >>> >>> opcodes/ >>> >>> PR binutils/20754 >>> * i386-dis.c (REG_82): New. >>> (X86_64_82_REG_0): Likewise. >>> (X86_64_82_REG_1): Likewise. >>> (X86_64_82_REG_2): Likewise. >>> (X86_64_82_REG_3): Likewise. >>> (X86_64_82_REG_4): Likewise. >>> (X86_64_82_REG_5): Likewise. >>> (X86_64_82_REG_6): Likewise. >>> (X86_64_82_REG_7): Likewise. >> >> Why do you need all these? I've had a patch pending doing about the >> same, but with fewer new identifiers. > > Nothing particular. > I checked in this patch to reuse opcode 0x80 decoder for opcode 0x82. -- H.J. >From d039fef395c1b5fd781acaf1c611f96f654f5f91 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 3 Nov 2016 09:55:01 -0700 Subject: [PATCH] X86: Reuse opcode 0x80 decoder for opcode 0x82 Since opcode 0x82 is an alias of opcode 0x80, we can reuse opcode 0x80 decoder. * i386-dis.c (REG_82): Removed. (X86_64_82_REG_0): Likewise. (X86_64_82_REG_1): Likewise. (X86_64_82_REG_2): Likewise. (X86_64_82_REG_3): Likewise. (X86_64_82_REG_4): Likewise. (X86_64_82_REG_5): Likewise. (X86_64_82_REG_6): Likewise. (X86_64_82_REG_7): Likewise. (X86_64_82): New. (dis386): Use X86_64_82 instead of REG_82. (reg_table): Remove REG_82. (x86_64_table): Add X86_64_82. Remove X86_64_82_REG_0, X86_64_82_REG_1, X86_64_82_REG_2, X86_64_82_REG_3, X86_64_82_REG_4, X86_64_82_REG_5, X86_64_82_REG_6 and X86_64_82_REG_7. --- opcodes/ChangeLog | 19 ++++++++++++++++ opcodes/i386-dis.c | 63 +++++------------------------------------------------- 2 files changed, 24 insertions(+), 58 deletions(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index d0f8846..4c7ba8d 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,5 +1,24 @@ 2016-11-03 H.J. Lu + * i386-dis.c (REG_82): Removed. + (X86_64_82_REG_0): Likewise. + (X86_64_82_REG_1): Likewise. + (X86_64_82_REG_2): Likewise. + (X86_64_82_REG_3): Likewise. + (X86_64_82_REG_4): Likewise. + (X86_64_82_REG_5): Likewise. + (X86_64_82_REG_6): Likewise. + (X86_64_82_REG_7): Likewise. + (X86_64_82): New. + (dis386): Use X86_64_82 instead of REG_82. + (reg_table): Remove REG_82. + (x86_64_table): Add X86_64_82. Remove X86_64_82_REG_0, + X86_64_82_REG_1, X86_64_82_REG_2, X86_64_82_REG_3, + X86_64_82_REG_4, X86_64_82_REG_5, X86_64_82_REG_6 and + X86_64_82_REG_7. + +2016-11-03 H.J. Lu + PR binutils/20754 * i386-dis.c (REG_82): New. (X86_64_82_REG_0): Likewise. diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index b0bb5e8..22f77aa 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -706,7 +706,6 @@ enum { REG_80 = 0, REG_81, - REG_82, REG_83, REG_8F, REG_C0, @@ -1695,14 +1694,7 @@ enum X86_64_63, X86_64_6D, X86_64_6F, - X86_64_82_REG_0, - X86_64_82_REG_1, - X86_64_82_REG_2, - X86_64_82_REG_3, - X86_64_82_REG_4, - X86_64_82_REG_5, - X86_64_82_REG_6, - X86_64_82_REG_7, + X86_64_82, X86_64_9A, X86_64_C4, X86_64_C5, @@ -2671,7 +2663,7 @@ static const struct dis386 dis386[] = { /* 80 */ { REG_TABLE (REG_80) }, { REG_TABLE (REG_81) }, - { REG_TABLE (REG_82) }, + { X86_64_TABLE (X86_64_82) }, { REG_TABLE (REG_83) }, { "testB", { Eb, Gb }, 0 }, { "testS", { Ev, Gv }, 0 }, @@ -3409,17 +3401,6 @@ static const struct dis386 reg_table[][8] = { { "xorQ", { Evh1, Iv }, 0 }, { "cmpQ", { Ev, Iv }, 0 }, }, - /* REG_82 */ - { - { X86_64_TABLE (X86_64_82_REG_0) }, - { X86_64_TABLE (X86_64_82_REG_1) }, - { X86_64_TABLE (X86_64_82_REG_2) }, - { X86_64_TABLE (X86_64_82_REG_3) }, - { X86_64_TABLE (X86_64_82_REG_4) }, - { X86_64_TABLE (X86_64_82_REG_5) }, - { X86_64_TABLE (X86_64_82_REG_6) }, - { X86_64_TABLE (X86_64_82_REG_7) }, - }, /* REG_83 */ { { "addQ", { Evh1, sIb }, 0 }, @@ -6907,44 +6888,10 @@ static const struct dis386 x86_64_table[][2] = { { "outs{G|}", { indirDXr, Xz }, 0 }, }, - /* X86_64_82_REG_0 */ - { - { "addA", { Ebh1, Ib }, 0 }, - }, - - /* X86_64_82_REG_1 */ - { - { "orA", { Ebh1, Ib }, 0 }, - }, - - /* X86_64_82_REG_2 */ - { - { "adcA", { Ebh1, Ib }, 0 }, - }, - - /* X86_64_82_REG_3 */ + /* X86_64_82 */ { - { "sbbA", { Ebh1, Ib }, 0 }, - }, - - /* X86_64_82_REG_4 */ - { - { "andA", { Ebh1, Ib }, 0 }, - }, - - /* X86_64_82_REG_5 */ - { - { "subA", { Ebh1, Ib }, 0 }, - }, - - /* X86_64_82_REG_6 */ - { - { "xorA", { Ebh1, Ib }, 0 }, - }, - - /* X86_64_82_REG_7 */ - { - { "cmpA", { Eb, Ib }, 0 }, + /* Opcode 0x82 is an alias of of opcode 0x80 in 32-bit mode. */ + { REG_TABLE (REG_80) }, }, /* X86_64_9A */ -- 2.7.4