From patchwork Wed Apr 4 13:28:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 26596 Received: (qmail 117477 invoked by alias); 4 Apr 2018 13:28:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 117467 invoked by uid 89); 4 Apr 2018 13:28:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-oi0-f50.google.com Received: from mail-oi0-f50.google.com (HELO mail-oi0-f50.google.com) (209.85.218.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Apr 2018 13:28:24 +0000 Received: by mail-oi0-f50.google.com with SMTP id e123-v6so19192403oih.13 for ; Wed, 04 Apr 2018 06:28:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=/zNtBEjHG8qjRBWu+MjbDy/mfnJQoj6IYDZ2SuMH+WE=; b=de0qzQ9qdc0XAOmWmbLWvweI14o1Rmf120ESx/c/WhYjI+8a17Sd3jTZ8bNCwx5PsI eud/208o9iHAp5mv5xvasQ2xjcHkQ8E5UsLUdYG8vPTnskEUktZVprj+WRRjoZw76tlb RfkfkBSL9VQiSv69ZzfcSYHl2/9Ndh8u5f2oCeR+AmHy10DuaUPvPo8QKetD+Tz4rxDz 0CXQ/ysrZjev1wKrOyAXbzmwVOiWlCKYiH+4S2HGzGMJQUbZOOq5MYL8F9FltwL+4+8V mukveA35oPjct7GMjjxVglAEjzf/pwQJOy1K/ZmfNZA8KdVhdhonQNcKnTVUlb/qnTGm ZhSw== X-Gm-Message-State: ALQs6tCHxQe8EeEwCu8qEmt4SNhVDJLk282WPlk0OeruvAWdCaHa8Bak vQOTlsge1f3c7jTmfn9qbZR2RE2qvkLL4GMFN43ihg== X-Google-Smtp-Source: AIpwx4+oZWnvRa2kww8m4bxEQpawGRxOKu01t7G0HlRIKNSaZsPL2lZYhALf9qZ166VtMde0G9iBN29Mhh5/HZzA33Q= X-Received: by 2002:aca:603:: with SMTP id 3-v6mr519792oig.279.1522848502776; Wed, 04 Apr 2018 06:28:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.190.152 with HTTP; Wed, 4 Apr 2018 06:28:22 -0700 (PDT) In-Reply-To: <20180404114219.GA439@intel.com> References: <20180404114219.GA439@intel.com> From: "H.J. Lu" Date: Wed, 4 Apr 2018 06:28:22 -0700 Message-ID: Subject: Fwd: [PATCH, committed] i386: Clear vex instead of vex.evex To: GDB X-IsSubscribed: yes I'd like to backport it to GDB 8.1 branch. Is it OK for gdb-8.1-branch? H.J. ---------- Forwarded message ---------- From: H.J. Lu Date: Wed, Apr 4, 2018 at 4:42 AM Subject: [PATCH, committed] i386: Clear vex instead of vex.evex To: binutils@sourceware.org "vex" has many fields to control how to decode an instruction. Clear all fields in "vex" before decoding an instruction to avoid using values left from the previous instruction. Checked into master and will backport it to 2.30 branch. H.J. ---- gas/ PR binutils/23025 * testsuite/gas/i386/prefix.s: Add tests for vcvtpd2dq with VEX and EVEX prefixes. * testsuite/gas/i386/prefix.d: Updated. opcodes/ PR binutils/23025 * i386-dis.c (get_valid_dis386): Don't set vex.prefix nor vex.w to 0. (print_insn): Clear vex instead of vex.evex. --- gas/ChangeLog | 7 +++++++ gas/testsuite/gas/i386/prefix.d | 3 +++ gas/testsuite/gas/i386/prefix.s | 4 ++++ opcodes/ChangeLog | 7 +++++++ opcodes/i386-dis.c | 7 +------ 5 files changed, 22 insertions(+), 6 deletions(-) vex.prefix = DATA_PREFIX_OPCODE; @@ -12891,7 +12890,6 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info) switch ((*codep & 0x3)) { case 0: - vex.prefix = 0; break; case 1: vex.prefix = DATA_PREFIX_OPCODE; @@ -12929,12 +12927,10 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info) /* For the 2-byte VEX prefix in 32-bit mode, the highest bit in VEX.vvvv is 1. */ vex.register_specifier = (~(*codep >> 3)) & 0xf; - vex.w = 0; vex.length = (*codep & 0x4) ? 256 : 128; switch ((*codep & 0x3)) { case 0: - vex.prefix = 0; break; case 1: vex.prefix = DATA_PREFIX_OPCODE; @@ -13009,7 +13005,6 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info) switch ((*codep & 0x3)) { case 0: - vex.prefix = 0; break; case 1: vex.prefix = DATA_PREFIX_OPCODE; @@ -13367,7 +13362,7 @@ print_insn (bfd_vma pc, disassemble_info *info) need_vex = 0; need_vex_reg = 0; vex_w_done = 0; - vex.evex = 0; + memset (&vex, 0, sizeof (vex)); if (dp->name == NULL && dp->op[0].bytemode == FLOATCODE) { -- 2.14.3 diff --git a/gas/ChangeLog b/gas/ChangeLog index d0f047e335..17d1b17c6e 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2018-04-04 H.J. Lu + + PR binutils/23025 + * testsuite/gas/i386/prefix.s: Add tests for vcvtpd2dq with + VEX and EVEX prefixes. + * testsuite/gas/i386/prefix.d: Updated. + 2018-03-30 Peter Bergner PR binutils/23013 diff --git a/gas/testsuite/gas/i386/prefix.d b/gas/testsuite/gas/i386/prefix.d index 8dd200be08..e9ad5eb56c 100644 --- a/gas/testsuite/gas/i386/prefix.d +++ b/gas/testsuite/gas/i386/prefix.d @@ -72,5 +72,8 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 90 nop [ ]*[a-f0-9]+: f2 0f c7 \(bad\) [ ]*[a-f0-9]+: f0 90 lock nop +[ ]*[a-f0-9]+: c5 fb e6 40 20 vcvtpd2dqx 0x20\(%eax\),%xmm0 +[ ]*[a-f0-9]+: 62 f1 ff 18 e6 40 04 vcvtpd2dq 0x20\(%eax\)\{1to2\},%xmm0 +[ ]*[a-f0-9]+: c5 fb e6 40 20 vcvtpd2dqx 0x20\(%eax\),%xmm0 ... #pass diff --git a/gas/testsuite/gas/i386/prefix.s b/gas/testsuite/gas/i386/prefix.s index 12d8bbc007..a4c60a7144 100644 --- a/gas/testsuite/gas/i386/prefix.s +++ b/gas/testsuite/gas/i386/prefix.s @@ -391,5 +391,9 @@ nop + vcvtpd2dqx 0x20(%eax),%xmm0 + vcvtpd2dq 0x20(%eax){1to2},%xmm0 + vcvtpd2dqx 0x20(%eax),%xmm0 + # Get a good alignment. .p2align 4,0 diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 28ffed3438..3add69b8d1 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,10 @@ +2018-04-04 H.J. Lu + + PR binutils/23025 + * i386-dis.c (get_valid_dis386): Don't set vex.prefix nor vex.w + to 0. + (print_insn): Clear vex instead of vex.evex. + 2018-04-04 Nick Clifton * po/es.po: Updated Spanish translation. diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index e5791c9a5f..3e45d0e1f3 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -12826,7 +12826,6 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info) switch ((*codep & 0x3)) { case 0: - vex.prefix = 0; break; case 1: