Bug 16489 - GAS doesn't complain about same register used for destination and index in AVX512 gather insn.
Summary: GAS doesn't complain about same register used for destination and index in AV...
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (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:31 UTC by Michael Zolotukhin
Modified: 2014-01-31 17:48 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:31:37 UTC
GAS doesn't complain about the following insns (depending on operand-check flag it should emit error/warning/nothing):
vgatherqps      ymm5{k3}, [eax+zmm5]
vpgatherqd      ymm5{k3}, [eax+zmm5]
While destination and index registers should be distinct.  There is such check for AVX2 gathers, but AVX512 gathers lack it.
Comment 1 Sourceware Commits 2014-01-22 18:01:59 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  8444f82a1d163171deccfcf014cc31adb81f703b (commit)
      from  237b092b9f52d90716e537d624e9a8c60a4cd4b5 (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=8444f82a1d163171deccfcf014cc31adb81f703b

commit 8444f82a1d163171deccfcf014cc31adb81f703b
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.

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

Summary of changes:
 gas/ChangeLog                                      |    6 ++++++
 gas/config/tc-i386.c                               |   16 ++++++++++++++++
 gas/testsuite/ChangeLog                            |   16 ++++++++++++++++
 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/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 ++++++++++++++++++
 15 files changed, 214 insertions(+), 0 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:20 UTC
Fixed on master and 2.24 branch.