Skip to content

Commit b339c88

Browse files
committed
[AArch64] Add some base aes intrinsic tests. NFC
Including commutative tests.
1 parent 1530034 commit b339c88

File tree

1 file changed

+43
-0
lines changed
  • llvm/test/CodeGen/AArch64

1 file changed

+43
-0
lines changed

llvm/test/CodeGen/AArch64/aes.ll

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2+
; RUN: llc %s -o - -mtriple=aarch64 -mattr=+aes | FileCheck %s
3+
4+
declare <16 x i8> @llvm.aarch64.crypto.aese(<16 x i8> %d, <16 x i8> %k)
5+
declare <16 x i8> @llvm.aarch64.crypto.aesd(<16 x i8> %d, <16 x i8> %k)
6+
7+
define <16 x i8> @aese(<16 x i8> %a, <16 x i8> %b) {
8+
; CHECK-LABEL: aese:
9+
; CHECK: // %bb.0:
10+
; CHECK-NEXT: aese v0.16b, v1.16b
11+
; CHECK-NEXT: ret
12+
%r = call <16 x i8> @llvm.aarch64.crypto.aese(<16 x i8> %a, <16 x i8> %b)
13+
ret <16 x i8> %r
14+
}
15+
16+
define <16 x i8> @aese_c(<16 x i8> %a, <16 x i8> %b) {
17+
; CHECK-LABEL: aese_c:
18+
; CHECK: // %bb.0:
19+
; CHECK-NEXT: aese v1.16b, v0.16b
20+
; CHECK-NEXT: mov v0.16b, v1.16b
21+
; CHECK-NEXT: ret
22+
%r = call <16 x i8> @llvm.aarch64.crypto.aese(<16 x i8> %b, <16 x i8> %a)
23+
ret <16 x i8> %r
24+
}
25+
26+
define <16 x i8> @aesd(<16 x i8> %a, <16 x i8> %b) {
27+
; CHECK-LABEL: aesd:
28+
; CHECK: // %bb.0:
29+
; CHECK-NEXT: aesd v0.16b, v1.16b
30+
; CHECK-NEXT: ret
31+
%r = call <16 x i8> @llvm.aarch64.crypto.aesd(<16 x i8> %a, <16 x i8> %b)
32+
ret <16 x i8> %r
33+
}
34+
35+
define <16 x i8> @aesd_c(<16 x i8> %a, <16 x i8> %b) {
36+
; CHECK-LABEL: aesd_c:
37+
; CHECK: // %bb.0:
38+
; CHECK-NEXT: aesd v1.16b, v0.16b
39+
; CHECK-NEXT: mov v0.16b, v1.16b
40+
; CHECK-NEXT: ret
41+
%r = call <16 x i8> @llvm.aarch64.crypto.aesd(<16 x i8> %b, <16 x i8> %a)
42+
ret <16 x i8> %r
43+
}

0 commit comments

Comments
 (0)