mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 13:30:33 +02:00
+ introduced decode_wasm_basic_type function
This commit is contained in:
parent
90e7b2be56
commit
2626b85984
@ -391,6 +391,7 @@ uses
|
||||
|
||||
function natural_alignment_for_load_store(op: TAsmOp): shortint;
|
||||
function encode_wasm_basic_type(wbt: TWasmBasicType): Byte;
|
||||
function decode_wasm_basic_type(b: Byte; out wbt: TWasmBasicType): Boolean;
|
||||
|
||||
implementation
|
||||
|
||||
@ -595,6 +596,32 @@ uses
|
||||
end;
|
||||
end;
|
||||
|
||||
function decode_wasm_basic_type(b: Byte; out wbt: TWasmBasicType): Boolean;
|
||||
begin
|
||||
result:=true;
|
||||
case b of
|
||||
$7F:
|
||||
wbt:=wbt_i32;
|
||||
$7E:
|
||||
wbt:=wbt_i64;
|
||||
$7D:
|
||||
wbt:=wbt_f32;
|
||||
$7C:
|
||||
wbt:=wbt_f64;
|
||||
$7B:
|
||||
wbt:=wbt_v128;
|
||||
$70:
|
||||
wbt:=wbt_funcref;
|
||||
$6F:
|
||||
wbt:=wbt_externref;
|
||||
else
|
||||
begin
|
||||
result:=false;
|
||||
wbt:=default(TWasmBasicType);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
{*****************************************************************************
|
||||
TWasmFuncType
|
||||
*****************************************************************************}
|
||||
|
Loading…
Reference in New Issue
Block a user