-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[AArch64] Add assembly/disassembly for multi-vector AES instructions #113307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,83 @@ | ||
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve-aes2,+sve2p1 2>&1 < %s| FileCheck %s | ||
|
||
// --------------------------------------------------------------------------// | ||
// Invalid vector list | ||
|
||
aesd {z0.b-z2.b}, {z0.b-z2.b}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
// CHECK-NEXT: aesd {z0.b-z2.b}, {z0.b-z2.b}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesd {z0.d-z1.d}, {z0.d-z1.d}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
// CHECK-NEXT: aesd {z0.d-z1.d}, {z0.d-z1.d}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesd {z0.s-z3.s}, {z0.s-z3.s}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
// CHECK-NEXT: aesd {z0.s-z3.s}, {z0.s-z3.s}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesd {z0.b-z0.b}, {z0.b-z0.b}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid number of vectors | ||
// CHECK-NEXT: aesd {z0.b-z0.b}, {z0.b-z0.b}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesd {z3.b-z7.b}, {z3.b-z7.b}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid number of vectors | ||
// CHECK-NEXT: aesd {z3.b-z7.b}, {z3.b-z7.b}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesd {z3.b-z4.b}, {z3.b-z4.b}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors, where the first vector is a multiple of 2 and with matching element types | ||
// CHECK-NEXT: aesd {z3.b-z4.b}, {z3.b-z4.b}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesd {z5.b-z8.b}, {z5.b-z8.b}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 4 consecutive SVE vectors, where the first vector is a multiple of 4 and with matching element types | ||
// CHECK-NEXT: aesd {z5.b-z8.b}, {z5.b-z8.b}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
// --------------------------------------------------------------------------// | ||
// Invalid second source vector width | ||
|
||
aesd {z0.b-z1.b}, {z0.b-z1.b}, z0.d[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: aesd {z0.b-z1.b}, {z0.b-z1.b}, z0.d[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesd {z0.b-z3.b}, {z0.b-z3.b}, z0.s[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: aesd {z0.b-z3.b}, {z0.b-z3.b}, z0.s[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
// --------------------------------------------------------------------------// | ||
// Invalid immediate index | ||
|
||
aesd {z0.b-z1.b}, {z0.b-z1.b}, z0.q[4] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 3]. | ||
// CHECK-NEXT: aesd {z0.b-z1.b}, {z0.b-z1.b}, z0.q[4] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesd {z0.b-z3.b}, {z0.b-z3.b}, z0.q[-1] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 3]. | ||
// CHECK-NEXT: aesd {z0.b-z3.b}, {z0.b-z3.b}, z0.q[-1] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
// --------------------------------------------------------------------------// | ||
// Source and Destination Registers must match | ||
|
||
aesd {z0.b-z1.b}, {z2.b-z3.b}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: operand must match destination register list | ||
// CHECK-NEXT: aesd {z0.b-z1.b}, {z2.b-z3.b}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesd {z0.b-z3.b}, {z4.b-z7.b}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: operand must match destination register list | ||
// CHECK-NEXT: aesd {z0.b-z3.b}, {z4.b-z7.b}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesd {z0.b-z3.b}, {z0.h-z3.h}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
// CHECK-NEXT: aesd {z0.b-z3.b}, {z0.h-z3.h}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: |
This file contains hidden or 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,53 @@ | ||
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve-aes2,+sve2p1 < %s \ | ||
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST | ||
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve-aes2,+ssve-aes < %s \ | ||
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST | ||
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \ | ||
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR | ||
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve-aes2,+sve2p1 < %s \ | ||
// RUN: | llvm-objdump -d --mattr=+sve-aes2,+sve2p1 --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-INST | ||
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve-aes2,+sve2p1 < %s \ | ||
// RUN: | llvm-objdump -d --mattr=-sme2 --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-UNKNOWN | ||
// Disassemble encoding and check the re-encoding (-show-encoding) matches. | ||
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve-aes2,+sve2p1 < %s \ | ||
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \ | ||
// RUN: | llvm-mc -triple=aarch64 -mattr=+sve-aes2,+sve2p1 -disassemble -show-encoding \ | ||
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST | ||
|
||
// x2 | ||
aesd {z0.b-z1.b}, {z0.b-z1.b}, z0.q[0] // 01000101-00100010-11101100-00000000 | ||
// CHECK-INST: aesd { z0.b, z1.b }, { z0.b, z1.b }, z0.q[0] | ||
// CHECK-ENCODING: [0x00,0xec,0x22,0x45] | ||
// CHECK-ERROR: instruction requires: sve2p1 or ssve-aes sve-aes2 | ||
// CHECK-UNKNOWN: 4522ec00 <unknown> | ||
|
||
aesd {z20.b-z21.b}, {z20.b-z21.b}, z10.q[2] // 01000101-00110010-11101101-01010100 | ||
// CHECK-INST: aesd { z20.b, z21.b }, { z20.b, z21.b }, z10.q[2] | ||
// CHECK-ENCODING: [0x54,0xed,0x32,0x45] | ||
// CHECK-ERROR: instruction requires: sve2p1 or ssve-aes sve-aes2 | ||
// CHECK-UNKNOWN: 4532ed54 <unknown> | ||
|
||
aesd {z30.b-z31.b}, {z30.b-z31.b}, z31.q[3] // 01000101-00111010-11101111-11111110 | ||
// CHECK-INST: aesd { z30.b, z31.b }, { z30.b, z31.b }, z31.q[3] | ||
// CHECK-ENCODING: [0xfe,0xef,0x3a,0x45] | ||
// CHECK-ERROR: instruction requires: sve2p1 or ssve-aes sve-aes2 | ||
// CHECK-UNKNOWN: 453aeffe <unknown> | ||
|
||
// x4 | ||
aesd {z0.b-z3.b}, {z0.b-z3.b}, z0.q[0] // 01000101-00100110-11101100-00000000 | ||
// CHECK-INST: aesd { z0.b - z3.b }, { z0.b - z3.b }, z0.q[0] | ||
// CHECK-ENCODING: [0x00,0xec,0x26,0x45] | ||
// CHECK-ERROR: instruction requires: sve2p1 or ssve-aes sve-aes2 | ||
// CHECK-UNKNOWN: 4526ec00 <unknown> | ||
|
||
aesd {z20.b-z23.b}, {z20.b-z23.b}, z13.q[1] // 01000101-00101110-11101101-10110100 | ||
// CHECK-INST: aesd { z20.b - z23.b }, { z20.b - z23.b }, z13.q[1] | ||
// CHECK-ENCODING: [0xb4,0xed,0x2e,0x45] | ||
// CHECK-ERROR: instruction requires: sve2p1 or ssve-aes sve-aes2 | ||
// CHECK-UNKNOWN: 452eedb4 <unknown> | ||
|
||
aesd {z28.b-z31.b}, {z28.b-z31.b}, z31.q[3] // 01000101-00111110-11101111-11111100 | ||
// CHECK-INST: aesd { z28.b - z31.b }, { z28.b - z31.b }, z31.q[3] | ||
// CHECK-ENCODING: [0xfc,0xef,0x3e,0x45] | ||
// CHECK-ERROR: instruction requires: sve2p1 or ssve-aes sve-aes2 | ||
// CHECK-UNKNOWN: 453eeffc <unknown> |
This file contains hidden or 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,83 @@ | ||
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve-aes2,+sve2p1 2>&1 < %s| FileCheck %s | ||
|
||
// --------------------------------------------------------------------------// | ||
// Invalid vector list | ||
|
||
aesdimc {z0.b-z2.b}, {z0.b-z2.b}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
// CHECK-NEXT: aesdimc {z0.b-z2.b}, {z0.b-z2.b}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesdimc {z0.d-z1.d}, {z0.d-z1.d}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
// CHECK-NEXT: aesdimc {z0.d-z1.d}, {z0.d-z1.d}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesdimc {z0.s-z3.s}, {z0.s-z3.s}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
// CHECK-NEXT: aesdimc {z0.s-z3.s}, {z0.s-z3.s}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesdimc {z0.b-z0.b}, {z0.b-z0.b}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid number of vectors | ||
// CHECK-NEXT: aesdimc {z0.b-z0.b}, {z0.b-z0.b}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesdimc {z3.b-z7.b}, {z3.b-z7.b}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid number of vectors | ||
// CHECK-NEXT: aesdimc {z3.b-z7.b}, {z3.b-z7.b}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesdimc {z3.b-z4.b}, {z3.b-z4.b}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors, where the first vector is a multiple of 2 and with matching element types | ||
// CHECK-NEXT: aesdimc {z3.b-z4.b}, {z3.b-z4.b}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesdimc {z5.b-z8.b}, {z5.b-z8.b}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 4 consecutive SVE vectors, where the first vector is a multiple of 4 and with matching element types | ||
// CHECK-NEXT: aesdimc {z5.b-z8.b}, {z5.b-z8.b}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
// --------------------------------------------------------------------------// | ||
// Invalid second source vector width | ||
|
||
aesdimc {z0.b-z1.b}, {z0.b-z1.b}, z0.d[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: aesdimc {z0.b-z1.b}, {z0.b-z1.b}, z0.d[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesdimc {z0.b-z3.b}, {z0.b-z3.b}, z0.s[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: aesdimc {z0.b-z3.b}, {z0.b-z3.b}, z0.s[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
// --------------------------------------------------------------------------// | ||
// Invalid immediate index | ||
|
||
aesdimc {z0.b-z1.b}, {z0.b-z1.b}, z0.q[4] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 3]. | ||
// CHECK-NEXT: aesdimc {z0.b-z1.b}, {z0.b-z1.b}, z0.q[4] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesdimc {z0.b-z3.b}, {z0.b-z3.b}, z0.q[-1] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 3]. | ||
// CHECK-NEXT: aesdimc {z0.b-z3.b}, {z0.b-z3.b}, z0.q[-1] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
// --------------------------------------------------------------------------// | ||
// Source and Destination Registers must match | ||
|
||
aesdimc {z0.b-z1.b}, {z2.b-z3.b}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: operand must match destination register list | ||
// CHECK-NEXT: aesdimc {z0.b-z1.b}, {z2.b-z3.b}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesdimc {z0.b-z3.b}, {z4.b-z7.b}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: operand must match destination register list | ||
// CHECK-NEXT: aesdimc {z0.b-z3.b}, {z4.b-z7.b}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesdimc {z0.b-z3.b}, {z0.h-z3.h}, z0.q[0] | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
// CHECK-NEXT: aesdimc {z0.b-z3.b}, {z0.h-z3.h}, z0.q[0] | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.