[clang] [CIR][AArch64] Upstream addition-across-vector (incl. widening) NEON builtins (PR #193396)
Andrzej WarzyĆski via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 27 07:04:55 PDT 2026
================
@@ -2719,6 +2732,32 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned builtinID, const CallExpr *expr,
std::string("unimplemented AArch64 builtin call: ") +
getContext().BuiltinInfo.getName(builtinID));
return mlir::Value{};
+ case NEON::BI__builtin_neon_vaddlv_u8:
+ case NEON::BI__builtin_neon_vaddlvq_u8:
+ case NEON::BI__builtin_neon_vaddlv_u16:
+ case NEON::BI__builtin_neon_vaddlvq_u16:
+ case NEON::BI__builtin_neon_vaddlv_s8:
+ case NEON::BI__builtin_neon_vaddlvq_s8:
+ case NEON::BI__builtin_neon_vaddlv_s16:
+ case NEON::BI__builtin_neon_vaddlvq_s16: {
+ mlir::Type argTy = convertType(expr->getArg(0)->getType());
+ mlir::Type userRetTy = convertType(expr->getType());
+ auto eltTy = mlir::cast<cir::IntType>(
+ mlir::cast<cir::VectorType>(argTy).getElementType());
+ bool isUnsigned = !eltTy.isSigned();
+ // The intrinsic always returns a 32-bit integer for these variants;
+ // only the 8-bit element variants need a further truncation to i16.
----------------
banach-space wrote:
This comment is is only true for u|s8|16 (i.e. 8 and 16 bit integers) - it's worth clarifying.
https://github.com/llvm/llvm-project/pull/193396
More information about the cfe-commits
mailing list