| 4043 | } |
| 4044 | } |
| 4045 | void compileAtomicStore(unsigned MemoryIndex, uint64_t MemoryOffset, |
| 4046 | unsigned Alignment, LLVM::Type, LLVM::Type TargetType, |
| 4047 | bool Signed = false) noexcept { |
| 4048 | auto V = stackPop(); |
| 4049 | |
| 4050 | if (Signed) { |
| 4051 | V = Builder.createSExtOrTrunc(V, TargetType); |
| 4052 | } else { |
| 4053 | V = Builder.createZExtOrTrunc(V, TargetType); |
| 4054 | } |
| 4055 | V = switchEndian(V); |
| 4056 | auto Offset = Builder.createZExt(Stack.back(), Context.Int64Ty); |
| 4057 | if (MemoryOffset != 0) { |
| 4058 | Offset = Builder.createAdd(Offset, LLContext.getInt64(MemoryOffset)); |
| 4059 | } |
| 4060 | compileAtomicCheckOffsetAlignment(Offset, TargetType); |
| 4061 | auto VPtr = Builder.createInBoundsGEP1( |
| 4062 | Context.Int8Ty, Context.getMemory(Builder, ExecCtx, MemoryIndex), |
| 4063 | Offset); |
| 4064 | auto Ptr = Builder.createBitCast(VPtr, TargetType.getPointerTo()); |
| 4065 | auto Store = Builder.createStore(V, Ptr, true); |
| 4066 | Store.setAlignment(1 << Alignment); |
| 4067 | Store.setOrdering(LLVMAtomicOrderingSequentiallyConsistent); |
| 4068 | } |
| 4069 | |
| 4070 | void compileAtomicRMWOp(unsigned MemoryIndex, uint64_t MemoryOffset, |
| 4071 | [[maybe_unused]] unsigned Alignment, |
nothing calls this directly
no test coverage detected