Skip to content

Commit 29fae5c

Browse files
AmrDeveloperlanza
authored andcommitted
[CIR][CIRGen][Builtin][Neon] Lower vmaxv_u32 (#1534)
Lower vmaxv_u32
1 parent 657db03 commit 29fae5c

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2789,7 +2789,8 @@ static mlir::Value emitCommonNeonSISDBuiltinExpr(
27892789
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.smaxv", resultTy,
27902790
loc);
27912791
case NEON::BI__builtin_neon_vmaxv_u32:
2792-
llvm_unreachable(" neon_vmaxv_u32 NYI ");
2792+
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.umaxv", resultTy,
2793+
loc);
27932794
case NEON::BI__builtin_neon_vmaxvq_f32:
27942795
llvm_unreachable(" neon_vmaxvq_f32 NYI ");
27952796
case NEON::BI__builtin_neon_vmaxvq_f64:

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19236,9 +19236,17 @@ int32_t test_vmaxv_s32(int32x2_t a) {
1923619236
// NYI-LABEL: @test_vmaxv_u32(
1923719237
// NYI: [[VMAXV_U32_I:%.*]] = call i32 @llvm.aarch64.neon.umaxv.i32.v2i32(<2 x i32> %a)
1923819238
// NYI: ret i32 [[VMAXV_U32_I]]
19239-
// uint32_t test_vmaxv_u32(uint32x2_t a) {
19240-
// return vmaxv_u32(a);
19241-
// }
19239+
uint32_t test_vmaxv_u32(uint32x2_t a) {
19240+
return vmaxv_u32(a);
19241+
19242+
// CIR-LABEL: vmaxv_u32
19243+
// CIR: cir.llvm.intrinsic "aarch64.neon.umaxv" {{%.*}} : (!cir.vector<!u32i x 2>) -> !u32i
19244+
19245+
// LLVM-LABEL: @test_vmaxv_u32
19246+
// LLVM-SAME: (<2 x i32> [[a:%.*]])
19247+
// LLVM: [[VMAXV_U32_I:%.*]] = call i32 @llvm.aarch64.neon.umaxv.i32.v2i32(<2 x i32> [[a]])
19248+
// LLVM: ret i32 [[VMAXV_U32_I]]
19249+
}
1924219250

1924319251
int32_t test_vaddv_s32(int32x2_t a) {
1924419252
return vaddv_s32(a);

0 commit comments

Comments
 (0)