Skip to content

Commit 44eeb5b

Browse files
AmrDeveloperlanza
authored andcommitted
[CIR][CIRGen][Builtin][Neon] Lower vmaxv_u32 (llvm#1534)
Lower vmaxv_u32
1 parent f769f13 commit 44eeb5b

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
@@ -19237,9 +19237,17 @@ int32_t test_vmaxv_s32(int32x2_t a) {
1923719237
// NYI-LABEL: @test_vmaxv_u32(
1923819238
// NYI: [[VMAXV_U32_I:%.*]] = call i32 @llvm.aarch64.neon.umaxv.i32.v2i32(<2 x i32> %a)
1923919239
// NYI: ret i32 [[VMAXV_U32_I]]
19240-
// uint32_t test_vmaxv_u32(uint32x2_t a) {
19241-
// return vmaxv_u32(a);
19242-
// }
19240+
uint32_t test_vmaxv_u32(uint32x2_t a) {
19241+
return vmaxv_u32(a);
19242+
19243+
// CIR-LABEL: vmaxv_u32
19244+
// CIR: cir.llvm.intrinsic "aarch64.neon.umaxv" {{%.*}} : (!cir.vector<!u32i x 2>) -> !u32i
19245+
19246+
// LLVM-LABEL: @test_vmaxv_u32
19247+
// LLVM-SAME: (<2 x i32> [[a:%.*]])
19248+
// LLVM: [[VMAXV_U32_I:%.*]] = call i32 @llvm.aarch64.neon.umaxv.i32.v2i32(<2 x i32> [[a]])
19249+
// LLVM: ret i32 [[VMAXV_U32_I]]
19250+
}
1924319251

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

0 commit comments

Comments
 (0)