Skip to content

Commit

Permalink
[CIR][CIRGen][Builtin][Neon] Lower neon vld1_lane and vld1q_lane (llv…
Browse files Browse the repository at this point in the history
…m#901)

just as title.

---------

Co-authored-by: Guojin He <[email protected]>
  • Loading branch information
2 people authored and smeenai committed Oct 9, 2024
1 parent e2bad43 commit 313038a
Show file tree
Hide file tree
Showing 2 changed files with 382 additions and 2 deletions.
8 changes: 6 additions & 2 deletions clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2966,7 +2966,7 @@ CIRGenFunction::buildAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
buildAArch64TblBuiltinExpr(*this, BuiltinID, E, Ops, Arch))
return V;

mlir::Type VTy = Ty;
mlir::cir::VectorType VTy = Ty;
llvm::SmallVector<mlir::Value, 4> args;
switch (BuiltinID) {
default:
Expand Down Expand Up @@ -3399,7 +3399,11 @@ CIRGenFunction::buildAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E,
}
case NEON::BI__builtin_neon_vld1_lane_v:
case NEON::BI__builtin_neon_vld1q_lane_v: {
llvm_unreachable("NYI");
Ops[1] = builder.createBitcast(Ops[1], VTy);
Ops[0] = builder.createAlignedLoad(Ops[0].getLoc(), VTy.getEltType(),
Ops[0], PtrOp0.getAlignment());
return builder.create<mlir::cir::VecInsertOp>(getLoc(E->getExprLoc()),
Ops[1], Ops[0], Ops[2]);
}
case NEON::BI__builtin_neon_vldap1_lane_s64:
case NEON::BI__builtin_neon_vldap1q_lane_s64: {
Expand Down
Loading

0 comments on commit 313038a

Please sign in to comment.