| 4646 | } |
| 4647 | |
| 4648 | void compileLoadOp(unsigned MemoryIndex, uint64_t Offset, unsigned Alignment, |
| 4649 | LLVM::Type LoadTy) noexcept { |
| 4650 | if constexpr (kForceUnalignment) { |
| 4651 | Alignment = 0; |
| 4652 | } |
| 4653 | auto Off = Builder.createZExt(stackPop(), Context.Int64Ty); |
| 4654 | if (Offset != 0) { |
| 4655 | Off = Builder.createAdd(Off, LLContext.getInt64(Offset)); |
| 4656 | } |
| 4657 | |
| 4658 | auto VPtr = Builder.createInBoundsGEP1( |
| 4659 | Context.Int8Ty, Context.getMemory(Builder, ExecCtx, MemoryIndex), Off); |
| 4660 | auto Ptr = Builder.createBitCast(VPtr, LoadTy.getPointerTo()); |
| 4661 | auto LoadInst = Builder.createLoad(LoadTy, Ptr, true); |
| 4662 | LoadInst.setAlignment(1 << Alignment); |
| 4663 | stackPush(switchEndian(LoadInst)); |
| 4664 | } |
| 4665 | void compileLoadOp(unsigned MemoryIndex, uint64_t Offset, unsigned Alignment, |
| 4666 | LLVM::Type LoadTy, LLVM::Type ExtendTy, |
| 4667 | bool Signed) noexcept { |
nothing calls this directly
no test coverage detected