Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CIR][CIRGen][Builtin][Neon] Lower neon_vaddlvq_u16 #1176

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4254,7 +4254,10 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
llvm_unreachable("NEON::BI__builtin_neon_vaddlvq_u8 NYI");
}
case NEON::BI__builtin_neon_vaddlvq_u16: {
llvm_unreachable("NEON::BI__builtin_neon_vaddlvq_u16 NYI");
mlir::Type argTy = cir::VectorType::get(builder.getContext(), UInt16Ty, 8);
llvm::SmallVector<mlir::Value, 1> argOps = {emitScalarExpr(E->getArg(0))};
return emitNeonCall(builder, {argTy}, argOps, "aarch64.neon.uaddlv",
UInt32Ty, getLoc(E->getExprLoc()));
}
case NEON::BI__builtin_neon_vaddlv_s8: {
llvm_unreachable("NEON::BI__builtin_neon_vaddlv_s8 NYI");
Expand Down
11 changes: 11 additions & 0 deletions clang/test/CIR/CodeGen/AArch64/neon-arith.c
Original file line number Diff line number Diff line change
Expand Up @@ -882,3 +882,14 @@ float64x2_t test_vabsq_f64(float64x2_t a) {
// LLVM: [[VABS_F:%.*]] = call <2 x double> @llvm.fabs.v2f64(<2 x double> [[a]])
// LLVM: ret <2 x double> [[VABS_F]]
}

uint32_t test_vaddlvq_u16(uint16x8_t a) {
return vaddlvq_u16(a);

// CIR-LABEL: vaddlvq_u16
// CIR: cir.llvm.intrinsic "aarch64.neon.uaddlv" {{%.*}}: (!cir.vector<!u16i x 8>) -> !u32i

// LLVM: {{.*}}test_vaddlvq_u16(<8 x i16>{{.*}}[[A:%.*]])
// LLVM: [[VADDLV_I:%.*]] = call i32 @llvm.aarch64.neon.uaddlv.i32.v8i16(<8 x i16> [[A]])
// LLVM: ret i32 [[VADDLV_I]]
}