Bug 16490 - Disp8 encoding/decoding is wrong AVX512 gather/scatter insns
Summary: Disp8 encoding/decoding is wrong AVX512 gather/scatter insns
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: 2.25
Assignee: Michael Zolotukhin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-22 07:35 UTC by Michael Zolotukhin
Modified: 2014-02-02 16:50 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Zolotukhin 2014-01-22 07:35:46 UTC
Disp8 encoding/decoding is wrong for the following example (supposedly, encoding is correct, decoding is incorrect):
.intel_syntax noprefix
vgatherqps      ymm1{k1}, [eax+zmm0+4]
vpgatherqd      ymm1{k1}, [eax+zmm0+4]
vpscatterqd     [eax+zmm0+4]{k1}, ymm0
vscatterqps     [eax+zmm0+4]{k1}, ymm0

After as d.s && objdump -dw:
Disassembly of section .text:

0000000000000000 <.text>:
   0:   67 62 f2 7d 49 93 4c 00 01      vgatherqps 0x8(%eax,%zmm0,1),%ymm1{%k1}
   9:   67 62 f2 7d 49 91 4c 00 01      vpgatherqd 0x8(%eax,%zmm0,1),%ymm1{%k1}
  12:   67 62 f2 7d 49 a1 44 00 01      vpscatterqd %ymm0,0x8(%eax,%zmm0,1){%k1}
  1b:   67 62 f2 7d 49 a3 44 00 01      vscatterqps %ymm0,0x8(%eax,%zmm0,1){%k1}

Note that the disp is 8, while the original disp is 4.
Comment 1 Sourceware Commits 2014-01-30 15:40:32 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  eaa9d1ad0e77540e8768ad11d8389f9408249237 (commit)
      from  2c39fc0d9c50061be0cdaaba40c278b7ab50ab70 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=eaa9d1ad0e77540e8768ad11d8389f9408249237

commit eaa9d1ad0e77540e8768ad11d8389f9408249237
Author: Michael Zolotukhin <michael.v.zolotukhin@gmail.com>
Date:   Thu Jan 30 07:38:09 2014 -0800

    Fix shift for AVX512F gather/scatter instructions
    
    opcodes/
    
    2014-01-30  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>
    	    Jan Beulich  <jbeulich@suse.com>
    
    	PR binutils/16490
    	* i386-dis.c (OP_E_memory): Fix shift computation for
    	vex_vsib_q_w_dq_mode.
    
    gas/testsuite/
    
    2014-01-30  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>
    	    Jan Beulich  <jbeulich@suse.com>
    
    	PR binutils/16490
    	* gas/i386/avx512f.d: Fix test output.
    	* gas/i386/avx512f-intel.d: Likewise.
    	* gas/i386/x86-64-avx512f.d: Likewise.
    	* gas/i386/x86-64-avx512f-intel.d: Likewise.

-----------------------------------------------------------------------

Summary of changes:
 gas/testsuite/ChangeLog                       |    9 +++++++++
 gas/testsuite/gas/i386/avx512f-intel.d        |   16 ++++++++--------
 gas/testsuite/gas/i386/avx512f.d              |   16 ++++++++--------
 gas/testsuite/gas/i386/x86-64-avx512f-intel.d |   16 ++++++++--------
 gas/testsuite/gas/i386/x86-64-avx512f.d       |   16 ++++++++--------
 opcodes/ChangeLog                             |    7 +++++++
 opcodes/i386-dis.c                            |    4 +---
 7 files changed, 49 insertions(+), 35 deletions(-)
Comment 2 Sourceware Commits 2014-01-31 16:25:57 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, binutils-2_24-branch has been updated
       via  6bcbd6512cec95ecc6fc4d2245d344bec9af0775 (commit)
       via  ec4c9021973adb9cf3464e2fa9a3a7607c4d96b4 (commit)
       via  ae3073542fd4d35d203164c1fde0bebb36f2069c (commit)
       via  fded37241ac826fcbdd061ec44a23573023dd921 (commit)
      from  3351298d6237b63dcf4ee59ed19613c99b188f52 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6bcbd6512cec95ecc6fc4d2245d344bec9af0775

commit 6bcbd6512cec95ecc6fc4d2245d344bec9af0775
Author: Michael Zolotukhin <michael.v.zolotukhin@gmail.com>
Date:   Fri Jan 31 08:13:06 2014 -0800

    Add gather/scatter tests with incorrect memory operand
    
    2014-01-31  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>
    
    	PR gas/16488
    	* gas/i386/inval-avx512f.s: Add test for incorrect memory operand
    	for gather/scatter instructions.
    	* gas/i386/x86-64-inval-avx512f.s: Likewise.
    	* gas/i386/inval-avx512f.l: Adjust correspondingly.
    	* gas/i386/x86-64-inval-avx512f.l: Likewise.
    
    Conflicts:
    	gas/testsuite/ChangeLog

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ec4c9021973adb9cf3464e2fa9a3a7607c4d96b4

commit ec4c9021973adb9cf3464e2fa9a3a7607c4d96b4
Author: Michael Zolotukhin <michael.v.zolotukhin@gmail.com>
Date:   Thu Jan 30 07:38:09 2014 -0800

    Fix shift for AVX512F gather/scatter instructions
    
    opcodes/
    
    2014-01-30  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>
    	    Jan Beulich  <jbeulich@suse.com>
    
    	PR binutils/16490
    	* i386-dis.c (OP_E_memory): Fix shift computation for
    	vex_vsib_q_w_dq_mode.
    
    gas/testsuite/
    
    2014-01-30  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>
    	    Jan Beulich  <jbeulich@suse.com>
    
    	PR binutils/16490
    	* gas/i386/avx512f.d: Fix test output.
    	* gas/i386/avx512f-intel.d: Likewise.
    	* gas/i386/x86-64-avx512f.d: Likewise.
    	* gas/i386/x86-64-avx512f-intel.d: Likewise.
    
    Conflicts:
    	gas/testsuite/ChangeLog

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ae3073542fd4d35d203164c1fde0bebb36f2069c

commit ae3073542fd4d35d203164c1fde0bebb36f2069c
Author: Michael Zolotukhin <michael.v.zolotukhin@gmail.com>
Date:   Wed Jan 22 11:39:02 2014 -0800

    Remove regzmm from AVX2 gather assert
    
    Since regzmm can't be used in AVX2 gather instructions, there is no need
    to check regzmm in AVX2 gather assert.
    
    2014-01-22  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>
    
    	* config/tc-i386.c (check_VecOperands): Remove regzmm from AVX2
    	gather assert.

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fded37241ac826fcbdd061ec44a23573023dd921

commit fded37241ac826fcbdd061ec44a23573023dd921
Author: Michael Zolotukhin <michael.v.zolotukhin@gmail.com>
Date:   Wed Jan 22 09:57:31 2014 -0800

    Add check for invalid register in AVX512 gathers
    
    AVX512 gather instructions shouldn't accept the same register for both
    destination and index.
    
    gas/
    
    2014-01-22  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>
    
    	PR gas/16489
    	* config/tc-i386.c (check_VecOperands): Add check for invalid
    	register set in AVX512 gathers.
    
    gas/testsuite/
    
    2014-01-22  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>
    
    	PR gas/16489
    	* gas/i386/vgather-check.s: Add tests for AVX512 gathers.
    	* gas/i386/x86-64-vgather-check.s: Likewise.
    	* gas/i386/vgather-check-error.l: Update correspondingly.
    	* gas/i386/vgather-check-none.d: Likewise.
    	* gas/i386/vgather-check-warn.d: Likewise.
    	* gas/i386/vgather-check-warn.e: Likewise.
    	* gas/i386/vgather-check.d: Likewise.
    	* gas/i386/x86-64-vgather-check-error.l: Likewise.
    	* gas/i386/x86-64-vgather-check-none.d: Likewise.
    	* gas/i386/x86-64-vgather-check-warn.d: Likewise.
    	* gas/i386/x86-64-vgather-check-warn.e: Likewise.
    	* gas/i386/x86-64-vgather-check.d: Likewise.
    
    Conflicts:
    	gas/ChangeLog
    	gas/testsuite/ChangeLog

-----------------------------------------------------------------------

Summary of changes:
 gas/ChangeLog                                      |   11 ++
 gas/config/tc-i386.c                               |   22 +++-
 gas/testsuite/ChangeLog                            |   34 ++++++
 gas/testsuite/gas/i386/avx512f-intel.d             |   16 ++--
 gas/testsuite/gas/i386/avx512f.d                   |   16 ++--
 gas/testsuite/gas/i386/inval-avx512f.l             |  115 +++++++++++---------
 gas/testsuite/gas/i386/inval-avx512f.s             |    9 ++
 gas/testsuite/gas/i386/vgather-check-error.l       |    8 ++
 gas/testsuite/gas/i386/vgather-check-none.d        |   18 +++
 gas/testsuite/gas/i386/vgather-check-warn.d        |   18 +++
 gas/testsuite/gas/i386/vgather-check-warn.e        |    8 ++
 gas/testsuite/gas/i386/vgather-check.d             |   18 +++
 gas/testsuite/gas/i386/vgather-check.s             |   18 +++
 gas/testsuite/gas/i386/x86-64-avx512f-intel.d      |   16 ++--
 gas/testsuite/gas/i386/x86-64-avx512f.d            |   16 ++--
 gas/testsuite/gas/i386/x86-64-inval-avx512f.l      |  107 +++++++++++--------
 gas/testsuite/gas/i386/x86-64-inval-avx512f.s      |   11 ++
 .../gas/i386/x86-64-vgather-check-error.l          |    8 ++
 gas/testsuite/gas/i386/x86-64-vgather-check-none.d |   18 +++
 gas/testsuite/gas/i386/x86-64-vgather-check-warn.d |   18 +++
 gas/testsuite/gas/i386/x86-64-vgather-check-warn.e |    8 ++
 gas/testsuite/gas/i386/x86-64-vgather-check.d      |   18 +++
 gas/testsuite/gas/i386/x86-64-vgather-check.s      |   18 +++
 opcodes/ChangeLog                                  |    7 ++
 opcodes/i386-dis.c                                 |    4 +-
 25 files changed, 428 insertions(+), 132 deletions(-)
Comment 3 H.J. Lu 2014-01-31 17:48:50 UTC
Fixed on master and 2.24 branch.
Comment 4 H.J. Lu 2014-01-31 17:49:35 UTC
Fixed on master and 2.24 branch.
Comment 5 Sourceware Commits 2014-02-02 16:50:16 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, gdb-7.7-branch has been updated
       via  53b7665db8faf9ba057b7a6bc65f72f0e0c15313 (commit)
      from  2d22194318d741406823b25a134f9f1f7d0b393d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=53b7665db8faf9ba057b7a6bc65f72f0e0c15313

commit 53b7665db8faf9ba057b7a6bc65f72f0e0c15313
Author: Michael Zolotukhin <michael.v.zolotukhin@gmail.com>
Date:   Thu Jan 30 07:38:09 2014 -0800

    Fix shift for AVX512F gather/scatter instructions
    
    opcodes/
    
    2014-01-30  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>
    	    Jan Beulich  <jbeulich@suse.com>
    
    	PR binutils/16490
    	* i386-dis.c (OP_E_memory): Fix shift computation for
    	vex_vsib_q_w_dq_mode.
    
    gas/testsuite/
    
    2014-01-30  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>
    	    Jan Beulich  <jbeulich@suse.com>
    
    	PR binutils/16490
    	* gas/i386/avx512f.d: Fix test output.
    	* gas/i386/avx512f-intel.d: Likewise.
    	* gas/i386/x86-64-avx512f.d: Likewise.
    	* gas/i386/x86-64-avx512f-intel.d: Likewise.
    
    Conflicts:
    	gas/testsuite/ChangeLog

-----------------------------------------------------------------------

Summary of changes:
 gas/testsuite/ChangeLog                       |    9 +++++++++
 gas/testsuite/gas/i386/avx512f-intel.d        |   16 ++++++++--------
 gas/testsuite/gas/i386/avx512f.d              |   16 ++++++++--------
 gas/testsuite/gas/i386/x86-64-avx512f-intel.d |   16 ++++++++--------
 gas/testsuite/gas/i386/x86-64-avx512f.d       |   16 ++++++++--------
 opcodes/ChangeLog                             |    7 +++++++
 opcodes/i386-dis.c                            |    4 +---
 7 files changed, 49 insertions(+), 35 deletions(-)