Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AArch64][SVE2] Asm: support SVE2 Crypto Extensions Group
Summary: Patch adds support for the following instructions: SVE2 crypto constructive binary operations: * SM4EKEY, RAX1 SVE2 crypto destructive binary operations: * AESE, AESD, SM4E SVE2 crypto unary operations: * AESMC, AESIMC AESE, AESD, AESMC and AESIMC are enabled with +sve2-aes. SM4E and SM4EKEY are enabled with +sve2-sm4. RAX1 is enabled with +sve2-sha3. The specification can be found here: https://developer.arm.com/docs/ddi0602/latest Reviewed By: SjoerdMeijer Differential Revision: https://reviews.llvm.org/D62307 llvm-svn: 361797
- Loading branch information
Showing
16 changed files
with
485 additions
and
0 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
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,45 @@ | ||
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2-aes 2>&1 < %s| FileCheck %s | ||
|
||
|
||
// --------------------------------------------------------------------------// | ||
// Source and Destination Registers must match | ||
|
||
aesd z0.b, z1.b, z2.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: operand must match destination register | ||
// CHECK-NEXT: aesd z0.b, z1.b, z2.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
|
||
// --------------------------------------------------------------------------// | ||
// Invalid element width | ||
|
||
aesd z0.h, z0.h, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: aesd z0.h, z0.h, z0.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesd z0.s, z0.s, z0.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: aesd z0.s, z0.s, z0.s | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesd z0.d, z0.d, z0.d | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: aesd z0.d, z0.d, z0.d | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
|
||
// --------------------------------------------------------------------------// | ||
// Negative tests for instructions that are incompatible with movprfx | ||
|
||
movprfx z0.b, p0/z, z7.b | ||
aesd z0.b, z0.b, z1.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: aesd z0.b, z0.b, z1.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
movprfx z0, z7 | ||
aesd z0.b, z0.b, z1.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: aesd z0.b, z0.b, z1.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: |
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,15 @@ | ||
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2-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=+sve2-aes < %s \ | ||
// RUN: | llvm-objdump -d -mattr=+sve2-aes - | FileCheck %s --check-prefix=CHECK-INST | ||
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2-aes < %s \ | ||
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN | ||
|
||
|
||
aesd z0.b, z0.b, z31.b | ||
// CHECK-INST: aesd z0.b, z0.b, z31.b | ||
// CHECK-ENCODING: [0xe0,0xe7,0x22,0x45] | ||
// CHECK-ERROR: instruction requires: sve2-aes | ||
// CHECK-UNKNOWN: e0 e7 22 45 <unknown> |
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,45 @@ | ||
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2-aes 2>&1 < %s| FileCheck %s | ||
|
||
|
||
// --------------------------------------------------------------------------// | ||
// Source and Destination Registers must match | ||
|
||
aese z0.b, z1.b, z2.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: operand must match destination register | ||
// CHECK-NEXT: aese z0.b, z1.b, z2.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
|
||
// --------------------------------------------------------------------------// | ||
// Invalid element width | ||
|
||
aese z0.h, z0.h, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: aese z0.h, z0.h, z0.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aese z0.s, z0.s, z0.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: aese z0.s, z0.s, z0.s | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aese z0.d, z0.d, z0.d | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: aese z0.d, z0.d, z0.d | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
|
||
// --------------------------------------------------------------------------// | ||
// Negative tests for instructions that are incompatible with movprfx | ||
|
||
movprfx z0.b, p0/z, z7.b | ||
aese z0.b, z0.b, z1.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: aese z0.b, z0.b, z1.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
movprfx z0, z7 | ||
aese z0.b, z0.b, z1.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: aese z0.b, z0.b, z1.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: |
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,15 @@ | ||
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2-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=+sve2-aes < %s \ | ||
// RUN: | llvm-objdump -d -mattr=+sve2-aes - | FileCheck %s --check-prefix=CHECK-INST | ||
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2-aes < %s \ | ||
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN | ||
|
||
|
||
aese z0.b, z0.b, z31.b | ||
// CHECK-INST: aese z0.b, z0.b, z31.b | ||
// CHECK-ENCODING: [0xe0,0xe3,0x22,0x45] | ||
// CHECK-ERROR: instruction requires: sve2-aes | ||
// CHECK-UNKNOWN: e0 e3 22 45 <unknown> |
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,45 @@ | ||
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2-aes 2>&1 < %s| FileCheck %s | ||
|
||
|
||
// --------------------------------------------------------------------------// | ||
// Source and Destination Registers must match | ||
|
||
aesimc z0.b, z1.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: operand must match destination register | ||
// CHECK-NEXT: aesimc z0.b, z1.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
|
||
// --------------------------------------------------------------------------// | ||
// Invalid element width | ||
|
||
aesimc z0.h, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: aesimc z0.h, z0.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesimc z0.s, z0.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: aesimc z0.s, z0.s | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesimc z0.d, z0.d | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: aesimc z0.d, z0.d | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
|
||
// --------------------------------------------------------------------------// | ||
// Negative tests for instructions that are incompatible with movprfx | ||
|
||
movprfx z0.b, p0/z, z7.b | ||
aesimc z0.b, z0.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: aesimc z0.b, z0.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
movprfx z0, z7 | ||
aesimc z0.b, z0.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: aesimc z0.b, z0.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: |
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,21 @@ | ||
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2-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=+sve2-aes < %s \ | ||
// RUN: | llvm-objdump -d -mattr=+sve2-aes - | FileCheck %s --check-prefix=CHECK-INST | ||
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2-aes < %s \ | ||
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN | ||
|
||
|
||
aesimc z0.b, z0.b | ||
// CHECK-INST: aesimc z0.b, z0.b | ||
// CHECK-ENCODING: [0x00,0xe4,0x20,0x45] | ||
// CHECK-ERROR: instruction requires: sve2-aes | ||
// CHECK-UNKNOWN: 00 e4 20 45 <unknown> | ||
|
||
aesimc z31.b, z31.b | ||
// CHECK-INST: aesimc z31.b, z31.b | ||
// CHECK-ENCODING: [0x1f,0xe4,0x20,0x45] | ||
// CHECK-ERROR: instruction requires: sve2-aes | ||
// CHECK-UNKNOWN: 1f e4 20 45 <unknown> |
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,45 @@ | ||
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2-aes 2>&1 < %s| FileCheck %s | ||
|
||
|
||
// --------------------------------------------------------------------------// | ||
// Source and Destination Registers must match | ||
|
||
aesmc z0.b, z1.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: operand must match destination register | ||
// CHECK-NEXT: aesmc z0.b, z1.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
|
||
// --------------------------------------------------------------------------// | ||
// Invalid element width | ||
|
||
aesmc z0.h, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: aesmc z0.h, z0.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesmc z0.s, z0.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: aesmc z0.s, z0.s | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
aesmc z0.d, z0.d | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: aesmc z0.d, z0.d | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
|
||
// --------------------------------------------------------------------------// | ||
// Negative tests for instructions that are incompatible with movprfx | ||
|
||
movprfx z0.b, p0/z, z7.b | ||
aesmc z0.b, z0.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: aesmc z0.b, z0.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
movprfx z0, z7 | ||
aesmc z0.b, z0.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: aesmc z0.b, z0.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: |
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,21 @@ | ||
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2-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=+sve2-aes < %s \ | ||
// RUN: | llvm-objdump -d -mattr=+sve2-aes - | FileCheck %s --check-prefix=CHECK-INST | ||
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2-aes < %s \ | ||
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN | ||
|
||
|
||
aesmc z0.b, z0.b | ||
// CHECK-INST: aesmc z0.b, z0.b | ||
// CHECK-ENCODING: [0x00,0xe0,0x20,0x45] | ||
// CHECK-ERROR: instruction requires: sve2-aes | ||
// CHECK-UNKNOWN: 00 e0 20 45 <unknown> | ||
|
||
aesmc z31.b, z31.b | ||
// CHECK-INST: aesmc z31.b, z31.b | ||
// CHECK-ENCODING: [0x1f,0xe0,0x20,0x45] | ||
// CHECK-ERROR: instruction requires: sve2-aes | ||
// CHECK-UNKNOWN: 1f e0 20 45 <unknown> |
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,36 @@ | ||
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2-sha3 2>&1 < %s| FileCheck %s | ||
|
||
|
||
// --------------------------------------------------------------------------// | ||
// Invalid element width | ||
|
||
rax1 z0.b, z0.b, z0.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: rax1 z0.b, z0.b, z0.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
rax1 z0.h, z0.h, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: rax1 z0.h, z0.h, z0.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
rax1 z0.s, z0.s, z0.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: rax1 z0.s, z0.s, z0.s | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
|
||
// --------------------------------------------------------------------------// | ||
// Negative tests for instructions that are incompatible with movprfx | ||
|
||
movprfx z0.d, p0/z, z7.d | ||
rax1 z0.d, z1.d, z2.d | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: rax1 z0.d, z1.d, z2.d | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
movprfx z0, z7 | ||
rax1 z0.d, z1.d, z2.d | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: rax1 z0.d, z1.d, z2.d | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: |
Oops, something went wrong.