소스 검색

+ added the WebAssembly reference and vector types to TWasmBasicType

Nikolay Nikolov 3 년 전
부모
커밋
907e8402ab
3개의 변경된 파일10개의 추가작업 그리고 3개의 파일을 삭제
  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;
         do_line  : boolean;
       const
-        WasmBasicTypeStr : array [TWasmBasicType] of string = ('i32','i64','f32','f64');
+        WasmBasicTypeStr : array [TWasmBasicType] of string = ('i32','i64','f32','f64','funcref','externref','v128');
 
       begin
         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
       );
 
-      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;
 
       { TWasmFuncType }

+ 1 - 1
compiler/wasm32/itcpugas.pas

@@ -120,7 +120,7 @@ interface
       '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;