Browse Source

+ added the WebAssembly reference and vector types to TWasmBasicType

Nikolay Nikolov 3 years ago
parent
commit
907e8402ab
3 changed files with 10 additions and 3 deletions
  1. 1 1
      compiler/wasm32/agwat.pas
  2. 8 1
      compiler/wasm32/cpubase.pas
  3. 1 1
      compiler/wasm32/itcpugas.pas

+ 1 - 1
compiler/wasm32/agwat.pas

@@ -402,7 +402,7 @@ implementation
         InlineLevel : longint;
         InlineLevel : longint;
         do_line  : boolean;
         do_line  : boolean;
       const
       const
-        WasmBasicTypeStr : array [TWasmBasicType] of string = ('i32','i64','f32','f64');
+        WasmBasicTypeStr : array [TWasmBasicType] of string = ('i32','i64','f32','f64','funcref','externref','v128');
 
 
       begin
       begin
         if not assigned(p) then
         if not assigned(p) then

+ 8 - 1
compiler/wasm32/cpubase.pas

@@ -121,7 +121,14 @@ uses
       a_memory_atomic_wait32, a_memory_atomic_wait64, a_memory_atomic_notify, a_atomic_fence
       a_memory_atomic_wait32, a_memory_atomic_wait64, a_memory_atomic_notify, a_atomic_fence
       );
       );
 
 
-      TWasmBasicType = (wbt_i32, wbt_i64, wbt_f32, wbt_f64);
+      TWasmBasicType = (
+        { number types }
+        wbt_i32, wbt_i64, wbt_f32, wbt_f64,
+        { reference types }
+        wbt_funcref, wbt_externref,
+        { vector types }
+        wbt_v128
+      );
       TWasmResultType = array of TWasmBasicType;
       TWasmResultType = array of TWasmBasicType;
 
 
       { TWasmFuncType }
       { TWasmFuncType }

+ 1 - 1
compiler/wasm32/itcpugas.pas

@@ -120,7 +120,7 @@ interface
       'memory.atomic.wait32', 'memory.atomic.wait64', 'memory.atomic.notify', 'atomic.fence'
       'memory.atomic.wait32', 'memory.atomic.wait64', 'memory.atomic.notify', 'atomic.fence'
     );
     );
 
 
-    gas_wasm_basic_type_str : array [TWasmBasicType] of string = ('i32','i64','f32','f64');
+    gas_wasm_basic_type_str : array [TWasmBasicType] of string = ('i32','i64','f32','f64','funcref','externref','v128');
 
 
     function gas_regname(r:Tregister):string;
     function gas_regname(r:Tregister):string;