Skip to content

Commit 8790612

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

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
@@ -2971,7 +2971,7 @@ CIRGenFunction::buildAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
29712971
buildAArch64TblBuiltinExpr(*this, BuiltinID, E, Ops, Arch))
29722972
return V;
29732973

2974-
mlir::Type VTy = Ty;
2974+
mlir::cir::VectorType VTy = Ty;
29752975
llvm::SmallVector<mlir::Value, 4> args;
29762976
switch (BuiltinID) {
29772977
default:
@@ -3404,7 +3404,11 @@ CIRGenFunction::buildAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
34043404
}
34053405
case NEON::BI__builtin_neon_vld1_lane_v:
34063406
case NEON::BI__builtin_neon_vld1q_lane_v: {
3407-
llvm_unreachable("NYI");
3407+
Ops[1] = builder.createBitcast(Ops[1], VTy);
3408+
Ops[0] = builder.createAlignedLoad(Ops[0].getLoc(), VTy.getEltType(),
3409+
Ops[0], PtrOp0.getAlignment());
3410+
return builder.create<mlir::cir::VecInsertOp>(getLoc(E->getExprLoc()),
3411+
Ops[1], Ops[0], Ops[2]);
34083412
}
34093413
case NEON::BI__builtin_neon_vldap1_lane_s64:
34103414
case NEON::BI__builtin_neon_vldap1q_lane_s64: {

0 commit comments

Comments
 (0)