forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[X86][MC] Support Enc/Dec for EGPR for promoted CRC32 (llvm#76434)
R16-R31 was added into GPRs in llvm#70958, This patch supports the encoding/decoding for promoted CRC32 instruction in EVEX space. RFC: https://discourse.llvm.org/t/rfc-design-for-apx-feature-egpr-and-ndd-support/73031/4
- Loading branch information
Showing
6 changed files
with
294 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT | ||
# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL | ||
|
||
# ATT: crc32b %al, %ebx | ||
# INTEL: crc32 ebx, al | ||
0x62,0xf4,0x7c,0x08,0xf0,0xd8 | ||
|
||
# ATT: crc32b %al, %rbx | ||
# INTEL: crc32 rbx, al | ||
0x62,0xf4,0xfc,0x08,0xf0,0xd8 | ||
|
||
# ATT: crc32w %ax, %ebx | ||
# INTEL: crc32 ebx, ax | ||
0x62,0xf4,0x7d,0x08,0xf1,0xd8 | ||
|
||
# ATT: crc32l %eax, %ebx | ||
# INTEL: crc32 ebx, eax | ||
0x62,0xf4,0x7c,0x08,0xf1,0xd8 | ||
|
||
# ATT: crc32q %rax, %rbx | ||
# INTEL: crc32 rbx, rax | ||
0x62,0xf4,0xfc,0x08,0xf1,0xd8 | ||
|
||
# ATT: crc32w 291(%rax,%rbx,4), %ecx | ||
# INTEL: crc32 ecx, word ptr [rax + 4*rbx + 291] | ||
0x62,0xf4,0x7d,0x08,0xf1,0x8c,0x98,0x23,0x01,0x00,0x00 | ||
|
||
# ATT: crc32l 291(%rax,%rbx,4), %ecx | ||
# INTEL: crc32 ecx, dword ptr [rax + 4*rbx + 291] | ||
0x62,0xf4,0x7c,0x08,0xf1,0x8c,0x98,0x23,0x01,0x00,0x00 | ||
|
||
# ATT: crc32b 291(%rax,%rbx,4), %rcx | ||
# INTEL: crc32 rcx, byte ptr [rax + 4*rbx + 291] | ||
0x62,0xf4,0xfc,0x08,0xf0,0x8c,0x98,0x23,0x01,0x00,0x00 | ||
|
||
# ATT: crc32q 291(%rax,%rbx,4), %rcx | ||
# INTEL: crc32 rcx, qword ptr [rax + 4*rbx + 291] | ||
0x62,0xf4,0xfc,0x08,0xf1,0x8c,0x98,0x23,0x01,0x00,0x00 | ||
|
||
# ATT: crc32b %r16b, %r22d | ||
# INTEL: crc32 r22d, r16b | ||
0x62,0xec,0x7c,0x08,0xf0,0xf0 | ||
|
||
# ATT: crc32b %r16b, %r23 | ||
# INTEL: crc32 r23, r16b | ||
0x62,0xec,0xfc,0x08,0xf0,0xf8 | ||
|
||
# ATT: crc32w %r17w, %r22d | ||
# INTEL: crc32 r22d, r17w | ||
0x62,0xec,0x7d,0x08,0xf1,0xf1 | ||
|
||
# ATT: crc32l %r18d, %r22d | ||
# INTEL: crc32 r22d, r18d | ||
0x62,0xec,0x7c,0x08,0xf1,0xf2 | ||
|
||
# ATT: crc32q %r19, %r23 | ||
# INTEL: crc32 r23, r19 | ||
0x62,0xec,0xfc,0x08,0xf1,0xfb | ||
|
||
# ATT: crc32w 291(%r28,%r29,4), %r18d | ||
# INTEL: crc32 r18d, word ptr [r28 + 4*r29 + 291] | ||
0x62,0x8c,0x79,0x08,0xf1,0x94,0xac,0x23,0x01,0x00,0x00 | ||
|
||
# ATT: crc32l 291(%r28,%r29,4), %r18d | ||
# INTEL: crc32 r18d, dword ptr [r28 + 4*r29 + 291] | ||
0x62,0x8c,0x78,0x08,0xf1,0x94,0xac,0x23,0x01,0x00,0x00 | ||
|
||
# ATT: crc32b 291(%r28,%r29,4), %r19 | ||
# INTEL: crc32 r19, byte ptr [r28 + 4*r29 + 291] | ||
0x62,0x8c,0xf8,0x08,0xf0,0x9c,0xac,0x23,0x01,0x00,0x00 | ||
|
||
# ATT: crc32q 291(%r28,%r29,4), %r19 | ||
# INTEL: crc32 r19, qword ptr [r28 + 4*r29 + 291] | ||
0x62,0x8c,0xf8,0x08,0xf1,0x9c,0xac,0x23,0x01,0x00,0x00 | ||
|
||
# ATT: crc32w 123(%r28,%r29,4), %r18d | ||
# INTEL: crc32 r18d, word ptr [r28 + 4*r29 + 123] | ||
0x62,0x8c,0x79,0x08,0xf1,0x54,0xac,0x7b | ||
|
||
# ATT: crc32l 123(%r28,%r29,4), %r18d | ||
# INTEL: crc32 r18d, dword ptr [r28 + 4*r29 + 123] | ||
0x62,0x8c,0x78,0x08,0xf1,0x54,0xac,0x7b | ||
|
||
# ATT: crc32b 123(%r28,%r29,4), %r19 | ||
# INTEL: crc32 r19, byte ptr [r28 + 4*r29 + 123] | ||
0x62,0x8c,0xf8,0x08,0xf0,0x5c,0xac,0x7b | ||
|
||
# ATT: crc32q 123(%r28,%r29,4), %r19 | ||
# INTEL: crc32 r19, qword ptr [r28 + 4*r29 + 123] | ||
0x62,0x8c,0xf8,0x08,0xf1,0x5c,0xac,0x7b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s | ||
# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR | ||
|
||
# ERROR-COUNT-22: error: | ||
# ERROR-NOT: error: | ||
# CHECK: {evex} crc32b %al, %ebx | ||
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xf0,0xd8] | ||
{evex} crc32b %al, %ebx | ||
|
||
# CHECK: {evex} crc32b %al, %rbx | ||
# CHECK: encoding: [0x62,0xf4,0xfc,0x08,0xf0,0xd8] | ||
{evex} crc32b %al, %rbx | ||
|
||
# CHECK: {evex} crc32w %ax, %ebx | ||
# CHECK: encoding: [0x62,0xf4,0x7d,0x08,0xf1,0xd8] | ||
{evex} crc32w %ax, %ebx | ||
|
||
# CHECK: {evex} crc32l %eax, %ebx | ||
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xf1,0xd8] | ||
{evex} crc32l %eax, %ebx | ||
|
||
# CHECK: {evex} crc32q %rax, %rbx | ||
# CHECK: encoding: [0x62,0xf4,0xfc,0x08,0xf1,0xd8] | ||
{evex} crc32q %rax, %rbx | ||
|
||
# CHECK: {evex} crc32w 291(%rax,%rbx,4), %ecx | ||
# CHECK: encoding: [0x62,0xf4,0x7d,0x08,0xf1,0x8c,0x98,0x23,0x01,0x00,0x00] | ||
{evex} crc32w 291(%rax,%rbx,4), %ecx | ||
|
||
# CHECK: {evex} crc32l 291(%rax,%rbx,4), %ecx | ||
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xf1,0x8c,0x98,0x23,0x01,0x00,0x00] | ||
{evex} crc32l 291(%rax,%rbx,4), %ecx | ||
|
||
# CHECK: {evex} crc32b 291(%rax,%rbx,4), %rcx | ||
# CHECK: encoding: [0x62,0xf4,0xfc,0x08,0xf0,0x8c,0x98,0x23,0x01,0x00,0x00] | ||
{evex} crc32b 291(%rax,%rbx,4), %rcx | ||
|
||
# CHECK: {evex} crc32q 291(%rax,%rbx,4), %rcx | ||
# CHECK: encoding: [0x62,0xf4,0xfc,0x08,0xf1,0x8c,0x98,0x23,0x01,0x00,0x00] | ||
{evex} crc32q 291(%rax,%rbx,4), %rcx | ||
|
||
# CHECK: crc32b %r16b, %r22d | ||
# CHECK: encoding: [0x62,0xec,0x7c,0x08,0xf0,0xf0] | ||
crc32b %r16b, %r22d | ||
|
||
# CHECK: crc32b %r16b, %r23 | ||
# CHECK: encoding: [0x62,0xec,0xfc,0x08,0xf0,0xf8] | ||
crc32b %r16b, %r23 | ||
|
||
# CHECK: crc32w %r17w, %r22d | ||
# CHECK: encoding: [0x62,0xec,0x7d,0x08,0xf1,0xf1] | ||
crc32w %r17w, %r22d | ||
|
||
# CHECK: crc32l %r18d, %r22d | ||
# CHECK: encoding: [0x62,0xec,0x7c,0x08,0xf1,0xf2] | ||
crc32l %r18d, %r22d | ||
|
||
# CHECK: crc32q %r19, %r23 | ||
# CHECK: encoding: [0x62,0xec,0xfc,0x08,0xf1,0xfb] | ||
crc32q %r19, %r23 | ||
|
||
# CHECK: crc32w 291(%r28,%r29,4), %r18d | ||
# CHECK: encoding: [0x62,0x8c,0x79,0x08,0xf1,0x94,0xac,0x23,0x01,0x00,0x00] | ||
crc32w 291(%r28,%r29,4), %r18d | ||
|
||
# CHECK: crc32l 291(%r28,%r29,4), %r18d | ||
# CHECK: encoding: [0x62,0x8c,0x78,0x08,0xf1,0x94,0xac,0x23,0x01,0x00,0x00] | ||
crc32l 291(%r28,%r29,4), %r18d | ||
|
||
# CHECK: crc32b 291(%r28,%r29,4), %r19 | ||
# CHECK: encoding: [0x62,0x8c,0xf8,0x08,0xf0,0x9c,0xac,0x23,0x01,0x00,0x00] | ||
crc32b 291(%r28,%r29,4), %r19 | ||
|
||
# CHECK: crc32q 291(%r28,%r29,4), %r19 | ||
# CHECK: encoding: [0x62,0x8c,0xf8,0x08,0xf1,0x9c,0xac,0x23,0x01,0x00,0x00] | ||
crc32q 291(%r28,%r29,4), %r19 | ||
|
||
# CHECK: crc32w 123(%r28,%r29,4), %r18d | ||
# CHECK: encoding: [0x62,0x8c,0x79,0x08,0xf1,0x54,0xac,0x7b] | ||
crc32w 123(%r28,%r29,4), %r18d | ||
|
||
# CHECK: crc32l 123(%r28,%r29,4), %r18d | ||
# CHECK: encoding: [0x62,0x8c,0x78,0x08,0xf1,0x54,0xac,0x7b] | ||
crc32l 123(%r28,%r29,4), %r18d | ||
|
||
# CHECK: crc32b 123(%r28,%r29,4), %r19 | ||
# CHECK: encoding: [0x62,0x8c,0xf8,0x08,0xf0,0x5c,0xac,0x7b] | ||
crc32b 123(%r28,%r29,4), %r19 | ||
|
||
# CHECK: crc32q 123(%r28,%r29,4), %r19 | ||
# CHECK: encoding: [0x62,0x8c,0xf8,0x08,0xf1,0x5c,0xac,0x7b] | ||
crc32q 123(%r28,%r29,4), %r19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s | ||
|
||
# CHECK: {evex} crc32 ebx, al | ||
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xf0,0xd8] | ||
{evex} crc32 ebx, al | ||
|
||
# CHECK: {evex} crc32 rbx, al | ||
# CHECK: encoding: [0x62,0xf4,0xfc,0x08,0xf0,0xd8] | ||
{evex} crc32 rbx, al | ||
|
||
# CHECK: {evex} crc32 ebx, ax | ||
# CHECK: encoding: [0x62,0xf4,0x7d,0x08,0xf1,0xd8] | ||
{evex} crc32 ebx, ax | ||
|
||
# CHECK: {evex} crc32 ebx, eax | ||
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xf1,0xd8] | ||
{evex} crc32 ebx, eax | ||
|
||
# CHECK: {evex} crc32 rbx, rax | ||
# CHECK: encoding: [0x62,0xf4,0xfc,0x08,0xf1,0xd8] | ||
{evex} crc32 rbx, rax | ||
|
||
# CHECK: {evex} crc32 ecx, word ptr [rax + 4*rbx + 291] | ||
# CHECK: encoding: [0x62,0xf4,0x7d,0x08,0xf1,0x8c,0x98,0x23,0x01,0x00,0x00] | ||
{evex} crc32 ecx, word ptr [rax + 4*rbx + 291] | ||
|
||
# CHECK: {evex} crc32 ecx, dword ptr [rax + 4*rbx + 291] | ||
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xf1,0x8c,0x98,0x23,0x01,0x00,0x00] | ||
{evex} crc32 ecx, dword ptr [rax + 4*rbx + 291] | ||
|
||
# CHECK: {evex} crc32 rcx, byte ptr [rax + 4*rbx + 291] | ||
# CHECK: encoding: [0x62,0xf4,0xfc,0x08,0xf0,0x8c,0x98,0x23,0x01,0x00,0x00] | ||
{evex} crc32 rcx, byte ptr [rax + 4*rbx + 291] | ||
|
||
# CHECK: {evex} crc32 rcx, qword ptr [rax + 4*rbx + 291] | ||
# CHECK: encoding: [0x62,0xf4,0xfc,0x08,0xf1,0x8c,0x98,0x23,0x01,0x00,0x00] | ||
{evex} crc32 rcx, qword ptr [rax + 4*rbx + 291] | ||
|
||
# CHECK: crc32 r22d, r16b | ||
# CHECK: encoding: [0x62,0xec,0x7c,0x08,0xf0,0xf0] | ||
crc32 r22d, r16b | ||
|
||
# CHECK: crc32 r23, r16b | ||
# CHECK: encoding: [0x62,0xec,0xfc,0x08,0xf0,0xf8] | ||
crc32 r23, r16b | ||
|
||
# CHECK: crc32 r22d, r17w | ||
# CHECK: encoding: [0x62,0xec,0x7d,0x08,0xf1,0xf1] | ||
crc32 r22d, r17w | ||
|
||
# CHECK: crc32 r22d, r18d | ||
# CHECK: encoding: [0x62,0xec,0x7c,0x08,0xf1,0xf2] | ||
crc32 r22d, r18d | ||
|
||
# CHECK: crc32 r23, r19 | ||
# CHECK: encoding: [0x62,0xec,0xfc,0x08,0xf1,0xfb] | ||
crc32 r23, r19 | ||
|
||
# CHECK: crc32 r18d, word ptr [r28 + 4*r29 + 291] | ||
# CHECK: encoding: [0x62,0x8c,0x79,0x08,0xf1,0x94,0xac,0x23,0x01,0x00,0x00] | ||
crc32 r18d, word ptr [r28 + 4*r29 + 291] | ||
|
||
# CHECK: crc32 r18d, dword ptr [r28 + 4*r29 + 291] | ||
# CHECK: encoding: [0x62,0x8c,0x78,0x08,0xf1,0x94,0xac,0x23,0x01,0x00,0x00] | ||
crc32 r18d, dword ptr [r28 + 4*r29 + 291] | ||
|
||
# CHECK: crc32 r19, byte ptr [r28 + 4*r29 + 291] | ||
# CHECK: encoding: [0x62,0x8c,0xf8,0x08,0xf0,0x9c,0xac,0x23,0x01,0x00,0x00] | ||
crc32 r19, byte ptr [r28 + 4*r29 + 291] | ||
|
||
# CHECK: crc32 r19, qword ptr [r28 + 4*r29 + 291] | ||
# CHECK: encoding: [0x62,0x8c,0xf8,0x08,0xf1,0x9c,0xac,0x23,0x01,0x00,0x00] | ||
crc32 r19, qword ptr [r28 + 4*r29 + 291] | ||
|
||
# CHECK: crc32 r18d, word ptr [r28 + 4*r29 + 123] | ||
# CHECK: encoding: [0x62,0x8c,0x79,0x08,0xf1,0x54,0xac,0x7b] | ||
crc32 r18d, word ptr [r28 + 4*r29 + 123] | ||
|
||
# CHECK: crc32 r18d, dword ptr [r28 + 4*r29 + 123] | ||
# CHECK: encoding: [0x62,0x8c,0x78,0x08,0xf1,0x54,0xac,0x7b] | ||
crc32 r18d, dword ptr [r28 + 4*r29 + 123] | ||
|
||
# CHECK: crc32 r19, byte ptr [r28 + 4*r29 + 123] | ||
# CHECK: encoding: [0x62,0x8c,0xf8,0x08,0xf0,0x5c,0xac,0x7b] | ||
crc32 r19, byte ptr [r28 + 4*r29 + 123] | ||
|
||
# CHECK: crc32 r19, qword ptr [r28 + 4*r29 + 123] | ||
# CHECK: encoding: [0x62,0x8c,0xf8,0x08,0xf1,0x5c,0xac,0x7b] | ||
crc32 r19, qword ptr [r28 + 4*r29 + 123] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters