From patchwork Wed Apr 4 15:36:06 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: 26601 Received: (qmail 118796 invoked by alias); 4 Apr 2018 15:36:11 -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 118781 invoked by uid 89); 4 Apr 2018 15:36:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.1 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-ot0-f176.google.com Received: from mail-ot0-f176.google.com (HELO mail-ot0-f176.google.com) (74.125.82.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Apr 2018 15:36:08 +0000 Received: by mail-ot0-f176.google.com with SMTP id h55-v6so22284819ote.9 for ; Wed, 04 Apr 2018 08:36:08 -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:cc; bh=tTrmAgldMMZ8fjZEpHpnIcRT9V/ANRA5z64p3oEt8fY=; b=YWngEjPBoHaCFmZVvK4QU7Ke+IipWwNcUJc6IGVs7PpEJU6RavvV+uhByGYxlkgDXJ F9IRnUivuNwv+sKq4qOCzlm88ALzfWPQoznx8yTbHGwBeavspN7OZ0ZKJpU5eXDpd+e4 HqbxqM9dlV4hW6lqvy0uXOSv/qU/SRSSZFsVFHRunEaaoRVeQ7xpxi1z4XW5mJJSbAKe lSRJ4MP+LMb1E7fn3OGcpoha76xoSjwNjtPIEUgj6IgT/K8nqUjWB595q3BFnA0SEL1L 8VHeA2UDOW50ir/E68nakZ+kqplCK340gZUNmg6SaPGhBUPfGmuoh9vD43r6U8/Ip4JE CK/Q== X-Gm-Message-State: ALQs6tDHN1qVtD5UcFOQB4klugsmzklUp9BUvtS4iS6b/lEzpunvPymw zvR5m268jVT8GycsTy3+IEAJOpbLq/OqGtCfDmY= X-Google-Smtp-Source: AIpwx49xuxL1q2J29FR5Ewshmv20NC1rNO0m7Y3ExjVFDPciOHaRwRHqObYZXzBzG81TVpq9C+Plz+zMDZV4yqCQA/o= X-Received: by 2002:a9d:2c09:: with SMTP id f9-v6mr11748148otb.123.1522856167229; Wed, 04 Apr 2018 08:36:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.190.152 with HTTP; Wed, 4 Apr 2018 08:36:06 -0700 (PDT) In-Reply-To: <20180404153301.ud5oahwwf25cqi7e@adacore.com> References: <20180404114219.GA439@intel.com> <20180404144342.vxvb7u52s2zz33eh@adacore.com> <20180404153301.ud5oahwwf25cqi7e@adacore.com> From: "H.J. Lu" Date: Wed, 4 Apr 2018 08:36:06 -0700 Message-ID: Subject: Re: Fwd: [PATCH, committed] i386: Clear vex instead of vex.evex To: Joel Brobecker Cc: GDB X-IsSubscribed: yes On Wed, Apr 4, 2018 at 8:33 AM, Joel Brobecker wrote: >> > Looks good to me, but in that case, create a GDB PR that points >> > to the binutils one, and set the Target Milestone to 8.1. This is >> > to make sure all changes made on the 8.1 branch since the 8.1 >> > release are easily trackable by everyone. >> >> Done: >> https://sourceware.org/bugzilla/show_bug.cgi?id=23028 > > Perfect, thank you. This is the patch I am checking in. Thanks. From f13be04ec6cc83947d8c4997aa48296a915b637f Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 4 Apr 2018 04:36:44 -0700 Subject: [PATCH] i386: Clear vex instead of vex.evex "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. gas/ PR gdb/23028 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 gdb/23028 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. (cherry picked from commit caf0678c84b5b55fbc4bcc853954745a4ad8b658) --- gas/ChangeLog | 11 +++++++++++ gas/testsuite/gas/i386/prefix.d | 3 +++ gas/testsuite/gas/i386/prefix.s | 4 ++++ opcodes/ChangeLog | 11 +++++++++++ opcodes/i386-dis.c | 7 +------ 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 85ced2f05b..b6afd1e133 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,14 @@ +2018-04-04 H.J. Lu + + Backport from master branch + 2018-04-04 H.J. Lu + + PR gdb/23028 + PR binutils/23025 + * testsuite/gas/i386/prefix.s: Add tests for vcvtpd2dq with + VEX and EVEX prefixes. + * testsuite/gas/i386/prefix.d: Updated. + 2018-01-04 Jim Wilson * testsuite/gas/riscv/priv-reg.s: Add missing stval and mtval. 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 076cd149fb..bb26b93813 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,14 @@ +2018-04-04 H.J. Lu + + Backport from master branch + 2018-04-04 H.J. Lu + + PR gdb/23028 + 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-01-03 Alan Modra Update year range in copyright notice of all files. diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 86a2cdd022..a9874dec96 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -12815,7 +12815,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; @@ -12880,7 +12879,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; @@ -12918,12 +12916,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; @@ -12998,7 +12994,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; @@ -13356,7 +13351,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