[PATCH] D105849: [WebAssembly] Fixed LLD generation of 64-bit __wasm_init_memory
Wouter van Oortmerssen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 12 15:26:53 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb568c11b4090: [WebAssembly] Fixed LLD generation of 64-bit __wasm_init_memory (authored by aardappel).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105849/new/
https://reviews.llvm.org/D105849
Files:
lld/test/wasm/data-segments.ll
lld/wasm/Writer.cpp
Index: lld/wasm/Writer.cpp
===================================================================
--- lld/wasm/Writer.cpp
+++ lld/wasm/Writer.cpp
@@ -1057,7 +1057,7 @@
writeU8(os, WASM_OPCODE_GLOBAL_GET, "GLOBAL_GET");
writeUleb128(os, WasmSym::memoryBase->getGlobalIndex(), "memory_base");
writePtrConst(os, flagAddress, is64, "flag address");
- writeU8(os, WASM_OPCODE_I32_ADD, "add");
+ writeU8(os, is64 ? WASM_OPCODE_I64_ADD : WASM_OPCODE_I32_ADD, "add");
writeU8(os, WASM_OPCODE_LOCAL_SET, "local.set");
writeUleb128(os, 0, "local 0");
} else {
@@ -1104,7 +1104,8 @@
writeU8(os, WASM_OPCODE_GLOBAL_GET, "GLOBAL_GET");
writeUleb128(os, WasmSym::memoryBase->getGlobalIndex(),
"memory_base");
- writeU8(os, WASM_OPCODE_I32_ADD, "i32.add");
+ writeU8(os, is64 ? WASM_OPCODE_I64_ADD : WASM_OPCODE_I32_ADD,
+ "i32.add");
}
// source segment offset
writeI32Const(os, 0, "segment offset");
Index: lld/test/wasm/data-segments.ll
===================================================================
--- lld/test/wasm/data-segments.ll
+++ lld/test/wasm/data-segments.ll
@@ -122,7 +122,7 @@
; PASSIVE64-PIC-NEXT: - Type: I64
; PASSIVE-PIC-NEXT: Count: 1
; PASSIVE32-PIC-NEXT: Body: 230141B4CE006A2100200041004101FE480200044020004101427FFE0102001A05410023016A4100410DFC080000411023016A41004114FC08010020004102FE1702002000417FFE0002001A0BFC0900FC09010B
-; PASSIVE64-PIC-NEXT: Body: 230142B4CE006A2100200041004101FE480200044020004101427FFE0102001A05420023016A4100410DFC080000421023016A41004114FC08010020004102FE1702002000417FFE0002001A0BFC0900FC09010B
+; PASSIVE64-PIC-NEXT: Body: 230142B4CE007C2100200041004101FE480200044020004101427FFE0102001A05420023017C4100410DFC080000421023017C41004114FC08010020004102FE1702002000417FFE0002001A0BFC0900FC09010B
; PASSIVE-PIC-NEXT: - Index: 3
; PASSIVE-PIC-NEXT: Locals: []
; PASSIVE-PIC-NEXT: Body: 0B
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105849.358080.patch
Type: text/x-patch
Size: 2135 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210712/6a67e2c6/attachment.bin>
More information about the llvm-commits
mailing list