[llvm] [WebAssembly] MC support for acquire-release atomics (PR #183656)

Derek Schuff via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 13:55:06 PST 2026


================
@@ -255,12 +283,33 @@ MCDisassembler::DecodeStatus WebAssemblyDisassembler::getInstruction(
         return MCDisassembler::Fail;
       break;
     }
-    // Vector lane operands (not LEB encoded).
+    // Vector lane operands and memory ordering (not LEB encoded).
     case WebAssembly::OPERAND_VEC_I8IMM: {
       if (!parseImmediate<uint8_t>(MI, Size, Bytes))
         return MCDisassembler::Fail;
       break;
     }
+    case WebAssembly::OPERAND_MEMORDER: {
+      uint8_t Val;
+      if (OPI + 1 < WasmInst->NumOperands &&
+          OperandTable[WasmInst->OperandStart + OPI + 1] ==
+              WebAssembly::OPERAND_P2ALIGN) {
+        // If we have P2ALIGN next, it will be encoded as part of the memarg,
+        // which has not been parsed yet. Default to SEQ_CST
+        // and we will update it when we parse P2ALIGN if necessary.
+        Val = wasm::WASM_MEM_ORDER_SEQ_CST;
+      } else {
----------------
dschuff wrote:

Correct, done.

https://github.com/llvm/llvm-project/pull/183656


More information about the llvm-commits mailing list