Browse Source

+ introduced WebAssembly helper is_atomic_op

Nikolay Nikolov 1 year ago
parent
commit
26c69d564f
1 changed files with 7 additions and 0 deletions
  1. 7 0
      compiler/wasm32/cpubase.pas

+ 7 - 0
compiler/wasm32/cpubase.pas

@@ -399,6 +399,8 @@ uses
     function encode_wasm_basic_type(wbt: TWasmBasicType): Byte;
     function decode_wasm_basic_type(b: Byte; out wbt: TWasmBasicType): Boolean;
 
+    function is_atomic_op(op: TAsmOp): boolean;
+
 implementation
 
 uses
@@ -630,6 +632,11 @@ uses
         end;
       end;
 
+    function is_atomic_op(op: TAsmOp): boolean;
+      begin
+        result:=(op>=a_i32_atomic_load8_u) and (op<=a_atomic_fence);
+      end;
+
 {*****************************************************************************
                                   TWasmFuncType
 *****************************************************************************}