Skip to content

Commit 313038a

Browse files
ghehgsmeenai
authored andcommitted
[CIR][CIRGen][Builtin][Neon] Lower neon vld1_lane and vld1q_lane (llvm#901)
just as title. --------- Co-authored-by: Guojin He <[email protected]>
1 parent e2bad43 commit 313038a

File tree

2 files changed

+382
-2
lines changed

2 files changed

+382
-2
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2966,7 +2966,7 @@ CIRGenFunction::buildAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
29662966
buildAArch64TblBuiltinExpr(*this, BuiltinID, E, Ops, Arch))
29672967
return V;
29682968

2969-
mlir::Type VTy = Ty;
2969+
mlir::cir::VectorType VTy = Ty;
29702970
llvm::SmallVector<mlir::Value, 4> args;
29712971
switch (BuiltinID) {
29722972
default:
@@ -3399,7 +3399,11 @@ CIRGenFunction::buildAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
33993399
}
34003400
case NEON::BI__builtin_neon_vld1_lane_v:
34013401
case NEON::BI__builtin_neon_vld1q_lane_v: {
3402-
llvm_unreachable("NYI");
3402+
Ops[1] = builder.createBitcast(Ops[1], VTy);
3403+
Ops[0] = builder.createAlignedLoad(Ops[0].getLoc(), VTy.getEltType(),
3404+
Ops[0], PtrOp0.getAlignment());
3405+
return builder.create<mlir::cir::VecInsertOp>(getLoc(E->getExprLoc()),
3406+
Ops[1], Ops[0], Ops[2]);
34033407
}
34043408
case NEON::BI__builtin_neon_vldap1_lane_s64:
34053409
case NEON::BI__builtin_neon_vldap1q_lane_s64: {

0 commit comments

Comments
 (0)