[llvm] r300490 - [WebAssembly] Encode block signatures as SLEB instead of ULEB

Derek Schuff via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 17 13:28:28 PDT 2017


Author: dschuff
Date: Mon Apr 17 15:28:28 2017
New Revision: 300490

URL: http://llvm.org/viewvc/llvm-project?rev=300490&view=rev
Log:
[WebAssembly] Encode block signatures as SLEB instead of ULEB

Use SLEB (varint) for block_type immediates in accordance with the spec.

Patch by Yury Delendik

Modified:
    llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp

Modified: llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp?rev=300490&r1=300489&r2=300490&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp Mon Apr 17 15:28:28 2017
@@ -94,6 +94,8 @@ void WebAssemblyMCCodeEmitter::encodeIns
               MCFixupKind(WebAssembly::fixup_code_global_index), MI.getLoc()));
           ++MCNumFixups;
           encodeULEB128(uint64_t(MO.getImm()), OS);
+        } else if (Info.OperandType == WebAssembly::OPERAND_SIGNATURE) {
+          encodeSLEB128(int64_t(MO.getImm()), OS);
         } else {
           encodeULEB128(uint64_t(MO.getImm()), OS);
         }




More information about the llvm-commits mailing list