| 693 | // TODO(binji): Rename this, it is used for more than loads/stores now. |
| 694 | template <typename T> |
| 695 | void BinaryWriter::WriteLoadStoreExpr(const Func* func, |
| 696 | const Expr* expr, |
| 697 | const char* desc) { |
| 698 | auto* typed_expr = cast<T>(expr); |
| 699 | WriteOpcode(stream_, typed_expr->opcode); |
| 700 | Address align = typed_expr->opcode.GetAlignment(typed_expr->align); |
| 701 | Index memidx = module_->GetMemoryIndex(typed_expr->memidx); |
| 702 | if (memidx != 0) { |
| 703 | stream_->WriteU8(log2_u32(align) | (1 << 6), "alignment"); |
| 704 | WriteU32Leb128(stream_, memidx, "memidx"); |
| 705 | } else { |
| 706 | stream_->WriteU8(log2_u32(align), "alignment"); |
| 707 | } |
| 708 | WriteU64Leb128(stream_, typed_expr->offset, desc); |
| 709 | } |
| 710 | |
| 711 | template <typename T> |
| 712 | void BinaryWriter::WriteSimdLoadStoreLaneExpr(const Func* func, |
nothing calls this directly
no test coverage detected