Skip to content

Commit 65d20dc

Browse files
ghehglanza
authored andcommitted
[CIR][CIRGen][Builtin][Neon] Lower neon_vaeseq_u8 (#1112)
1 parent 4a3344d commit 65d20dc

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -2485,6 +2485,10 @@ mlir::Value CIRGenFunction::emitCommonNeonBuiltinExpr(
24852485
argTypes.push_back(vTy);
24862486
break;
24872487
}
2488+
case NEON::BI__builtin_neon_vaeseq_u8: {
2489+
intrincsName = "aarch64.crypto.aese";
2490+
break;
2491+
}
24882492
case NEON::BI__builtin_neon_vpadd_v:
24892493
case NEON::BI__builtin_neon_vpaddq_v: {
24902494
intrincsName = mlir::isa<mlir::FloatType>(vTy.getEltType())

clang/test/CIR/CodeGen/AArch64/neon-crypto.c

+12-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
55

66
// RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
7-
// RUN: -target-feature +sha2 -target-feature +aes \
7+
// RUN: -fclangir -target-feature +sha2 -target-feature +aes \
88
// RUN: -disable-O0-optnone -emit-llvm -o - %s \
99
// RUN: | opt -S -passes=mem2reg,simplifycfg -o %t.ll
1010
// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
@@ -23,3 +23,14 @@ uint8x16_t test_vaesmcq_u8(uint8x16_t data) {
2323
// LLVM: [[RES:%.*]] = call <16 x i8> @llvm.aarch64.crypto.aesmc(<16 x i8> [[DATA]])
2424
// LLVM: ret <16 x i8> [[RES]]
2525
}
26+
27+
uint8x16_t test_vaeseq_u8(uint8x16_t data, uint8x16_t key) {
28+
return vaeseq_u8(data, key);
29+
30+
// CIR-LABEL: vaeseq_u8
31+
// {{%.*}} = cir.llvm.intrinsic "aarch64.crypto.aese" {{%.*}} : (!cir.vector<!u8i x 16>) -> !cir.vector<!u8i x 16>
32+
33+
// LLVM: {{.*}}vaeseq_u8(<16 x i8>{{.*}}[[DATA:%.*]], <16 x i8>{{.*}}[[KEY:%.*]])
34+
// LLVM: [[RES:%.*]] = call <16 x i8> @llvm.aarch64.crypto.aese(<16 x i8> [[DATA]], <16 x i8> [[KEY]])
35+
// LLVM: ret <16 x i8> [[RES]]
36+
}

0 commit comments

Comments
 (0)