Skip to content

Commit 22e9697

Browse files
AmrDeveloperlanza
authored andcommitted
[CIR][CIRGen][Builtin][Neon] Lower vminv_u32 (llvm#1551)
Lower vminv_u32
1 parent eb2e683 commit 22e9697

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2810,7 +2810,8 @@ static mlir::Value emitCommonNeonSISDBuiltinExpr(
28102810
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.sminv", resultTy,
28112811
loc);
28122812
case NEON::BI__builtin_neon_vminv_u32:
2813-
llvm_unreachable(" neon_vminv_u32 NYI ");
2813+
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.uminv", resultTy,
2814+
loc);
28142815
case NEON::BI__builtin_neon_vminvq_f32:
28152816
llvm_unreachable(" neon_vminvq_f32 NYI ");
28162817
case NEON::BI__builtin_neon_vminvq_f64:

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19270,12 +19270,17 @@ int32_t test_vminv_s32(int32x2_t a) {
1927019270
// LLVM: ret i32 [[VMINV_S32_I]]
1927119271
}
1927219272

19273-
// NYI-LABEL: @test_vminv_u32(
19274-
// NYI: [[VMINV_U32_I:%.*]] = call i32 @llvm.aarch64.neon.uminv.i32.v2i32(<2 x i32> %a)
19275-
// NYI: ret i32 [[VMINV_U32_I]]
19276-
// uint32_t test_vminv_u32(uint32x2_t a) {
19277-
// return vminv_u32(a);
19278-
// }
19273+
uint32_t test_vminv_u32(uint32x2_t a) {
19274+
return vminv_u32(a);
19275+
19276+
// CIR-LABEL: vminv_u32
19277+
// CIR: cir.llvm.intrinsic "aarch64.neon.uminv" {{%.*}} : (!cir.vector<!u32i x 2>) -> !u32i
19278+
19279+
// LLVM-LABEL: @test_vminv_u32
19280+
// LLVM-SAME: (<2 x i32> [[a:%.*]])
19281+
// LLVM: [[VMINV_U32_I:%.*]] = call i32 @llvm.aarch64.neon.uminv.i32.v2i32(<2 x i32> [[a]])
19282+
// LLVM: ret i32 [[VMINV_U32_I]]
19283+
}
1927919284

1928019285
int32_t test_vmaxv_s32(int32x2_t a) {
1928119286
return vmaxv_s32(a);

0 commit comments

Comments
 (0)