Bug 32171 - The assembler should report errors for illegal uses of egpr instructions.
Summary: The assembler should report errors for illegal uses of egpr instructions.
Status: CLOSED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.44 (HEAD)
: P2 normal
Target Milestone: 2.44
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-13 03:20 UTC by lili.cui@intel.com
Modified: 2024-09-23 03:06 UTC (History)
3 users (show)

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 lili.cui@intel.com 2024-09-13 03:20:58 UTC
We should report errors for the following instructions, since APX spec doesn't promote them.

--------------------------------
vbroadcastf128  (%r16),%ymm3
vbroadcasti128  (%r16),%ymm3
vextractf128    $1,%ymm3,(%r16)
vextracti128    $1,%ymm3,(%r16)
vinsertf128     $1,(%r16),%ymm3,%ymm8
vinserti128     $1,(%r16),%ymm3,%ymm8
vroundpd $1,(%r24),%xmm6
vroundps $2,(%r24),%xmm6
vroundsd $3,(%r24),%xmm6,%xmm3
vroundss $4,(%r24),%xmm6,%xmm3
---------------------------------
Comment 1 H.J. Lu 2024-09-13 04:10:36 UTC
Is this the complete list?
Comment 2 lili.cui@intel.com 2024-09-13 06:00:57 UTC
(In reply to H.J. Lu from comment #1)
> Is this the complete list?

Yes, I only found these, involving the following three commits

eea4357967b6182459d423c4d919a7cb0219604b
eea4357967b6182459d423c4d919a7cb0219604b
ec3babb8c10111bacfd195fe9eafed1bfb721b5c
Comment 3 H.J. Lu 2024-09-13 06:06:45 UTC
We need to issue an error on these instructions.
Comment 4 lili.cui@intel.com 2024-09-13 06:43:07 UTC
Sorry, correct the commit Id.

eea4357967b6182459d423c4d919a7cb0219604b
5a635f1f59ad08e572e36419f1145433fd670214
ec3babb8c10111bacfd195fe9eafed1bfb721b5c
Comment 5 Sourceware Commits 2024-09-18 02:25:25 UTC
The master branch has been updated by H.J. Lu <hjl@sourceware.org>:

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

commit 2963d7d80dffc9feb391ce7b5f3bc1c87e932b9d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Sep 16 07:11:39 2024 +0800

    x86/APX: Don't promote AVX/AVX2 instructions out of APX spec
    
    V{BROADCAST,EXTRACT,INSERT}{F,I}128 and VROUND{P,S}{S,D} aren't promoted
    to support EGPR in APX spec.  Don't promote them out of APX spec.  This
    commit effectively reverted:
    
    ec3babb8c10 x86/APX: V{BROADCAST,EXTRACT,INSERT}{F,I}128 can also be expressed
    5a635f1f59a x86/APX: VROUND{P,S}{S,D} encodings require AVX512{F,VL}
    eea4357967b x86/APX: VROUND{P,S}{S,D} can generally be encoded
    
    gas/
    
            PR gas/32171
            * testsuite/gas/i386/x86-64-apx-egpr-promote-inval.s: Add
            V{BROADCAST,EXTRACT,INSERT}{F,I}128 tests with EGPR.
            * testsuite/gas/i386/x86-64-apx-evex-promoted.s: Remove
            V{BROADCAST,EXTRACT,INSERT}{F,I}128 and VROUND{P,S}{S,D} tests
            with EGPR.
            * testsuite/gas/i386/x86-64-apx-egpr-inval.l: Updated.
            * testsuite/gas/i386/x86-64-apx-egpr-promote-inval.l: Likewise.
            * testsuite/gas/i386/x86-64-apx-evex-promoted-intel.d: Likewise.
            * testsuite/gas/i386/x86-64-apx-evex-promoted-wig.d: Likewise.
            * testsuite/gas/i386/x86-64-apx-evex-promoted.d: Likewise.
    
    opcodes/
    
            PR gas/32171
            * i386-opc.tbl: Remove V{BROADCAST,EXTRACT,INSERT}{F,I}128 and
            VROUND{P,S}{S,D} entries with EGPR.
            * i386-tbl.h: Regenerated.
    
    Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Comment 6 Sourceware Commits 2024-09-20 21:51:00 UTC
The binutils-2_43-branch branch has been updated by H.J. Lu <hjl@sourceware.org>:

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

commit d77d08180d195a60193e9b35b6d08036caa55c70
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Sep 16 07:11:39 2024 +0800

    x86/APX: Don't promote AVX/AVX2 instructions out of APX spec
    
    V{BROADCAST,EXTRACT,INSERT}{F,I}128 and VROUND{P,S}{S,D} aren't promoted
    to support EGPR in APX spec.  Don't promote them out of APX spec.  This
    commit effectively reverted:
    
    ec3babb8c10 x86/APX: V{BROADCAST,EXTRACT,INSERT}{F,I}128 can also be expressed
    5a635f1f59a x86/APX: VROUND{P,S}{S,D} encodings require AVX512{F,VL}
    eea4357967b x86/APX: VROUND{P,S}{S,D} can generally be encoded
    
    gas/
    
            PR gas/32171
            * testsuite/gas/i386/x86-64-apx-egpr-promote-inval.s: Add
            V{BROADCAST,EXTRACT,INSERT}{F,I}128 tests with EGPR.
            * testsuite/gas/i386/x86-64-apx-evex-promoted.s: Remove
            V{BROADCAST,EXTRACT,INSERT}{F,I}128 and VROUND{P,S}{S,D} tests
            with EGPR.
            * testsuite/gas/i386/x86-64-apx-egpr-inval.l: Updated.
            * testsuite/gas/i386/x86-64-apx-egpr-promote-inval.l: Likewise.
            * testsuite/gas/i386/x86-64-apx-evex-promoted-intel.d: Likewise.
            * testsuite/gas/i386/x86-64-apx-evex-promoted-wig.d: Likewise.
            * testsuite/gas/i386/x86-64-apx-evex-promoted.d: Likewise.
    
    opcodes/
    
            PR gas/32171
            * i386-opc.tbl: Remove V{BROADCAST,EXTRACT,INSERT}{F,I}128 and
            VROUND{P,S}{S,D} entries with EGPR.
            * i386-tbl.h: Regenerated.
    
    Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
    (cherry picked from commit 2963d7d80dffc9feb391ce7b5f3bc1c87e932b9d)
Comment 7 H.J. Lu 2024-09-20 21:59:38 UTC
Fixed for 2.44 and 2.43 branch.
Comment 8 lili.cui@intel.com 2024-09-23 03:06:29 UTC
Fixed, close it.