Skip to content

Commit 424918e

Browse files
authored
[CIR][CIRGen][Builtin][Neon] Lower vminv_u32 (#1551)
Lower vminv_u32
1 parent 7789ae7 commit 424918e

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
@@ -19269,12 +19269,17 @@ int32_t test_vminv_s32(int32x2_t a) {
1926919269
// LLVM: ret i32 [[VMINV_S32_I]]
1927019270
}
1927119271

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

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

0 commit comments

Comments
 (0)