Skip to content

Commit 7789ae7

Browse files
authored
[CIR][CIRGen][Builtin][Neon] Lower vminv_s32 (#1550)
Lower vminv_s32
1 parent 9f2da98 commit 7789ae7

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
@@ -2807,7 +2807,8 @@ static mlir::Value emitCommonNeonSISDBuiltinExpr(
28072807
case NEON::BI__builtin_neon_vminv_f32:
28082808
llvm_unreachable(" neon_vminv_f32 NYI ");
28092809
case NEON::BI__builtin_neon_vminv_s32:
2810-
llvm_unreachable(" neon_vminv_s32 NYI ");
2810+
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.sminv", resultTy,
2811+
loc);
28112812
case NEON::BI__builtin_neon_vminv_u32:
28122813
llvm_unreachable(" neon_vminv_u32 NYI ");
28132814
case NEON::BI__builtin_neon_vminvq_f32:

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19257,12 +19257,17 @@ float64x1_t test_vmax_f64(float64x1_t a, float64x1_t b) {
1925719257
// return vrsqrts_f64(a, b);
1925819258
// }
1925919259

19260-
// NYI-LABEL: @test_vminv_s32(
19261-
// NYI: [[VMINV_S32_I:%.*]] = call i32 @llvm.aarch64.neon.sminv.i32.v2i32(<2 x i32> %a)
19262-
// NYI: ret i32 [[VMINV_S32_I]]
19263-
// int32_t test_vminv_s32(int32x2_t a) {
19264-
// return vminv_s32(a);
19265-
// }
19260+
int32_t test_vminv_s32(int32x2_t a) {
19261+
return vminv_s32(a);
19262+
19263+
// CIR-LABEL: vminv_s32
19264+
// CIR: cir.llvm.intrinsic "aarch64.neon.sminv" {{%.*}} : (!cir.vector<!s32i x 2>) -> !s32i
19265+
19266+
// LLVM-LABEL: @test_vminv_s32
19267+
// LLVM-SAME: (<2 x i32> [[a:%.*]])
19268+
// LLVM: [[VMINV_S32_I:%.*]] = call i32 @llvm.aarch64.neon.sminv.i32.v2i32(<2 x i32> [[a]])
19269+
// LLVM: ret i32 [[VMINV_S32_I]]
19270+
}
1926619271

1926719272
// NYI-LABEL: @test_vminv_u32(
1926819273
// NYI: [[VMINV_U32_I:%.*]] = call i32 @llvm.aarch64.neon.uminv.i32.v2i32(<2 x i32> %a)

0 commit comments

Comments
 (0)