mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 19:29:26 +02:00
[PATCH 132/188] adding old-style instructions
From 53eaaa727d935abe1ce568bc4d68b95a22ad2003 Mon Sep 17 00:00:00 2001 From: Dmitry Boyarintsev <skalogryz.lists@gmail.com> Date: Tue, 24 Mar 2020 15:55:17 -0400 git-svn-id: branches/wasm@46128 -
This commit is contained in:
parent
5c9d1df31d
commit
5ddf47ec58
@ -251,6 +251,7 @@ begin
|
||||
else if t = 'f32.convert_i64_u' then inst := inst_f32_convert_i64_u
|
||||
else if t = 'f32.demote_f64' then inst := inst_f32_demote_f64
|
||||
else if t = 'f32.reinterpret_i32' then inst := inst_f32_reinterpret_i32
|
||||
else if t = 'f32.reinterpret/i32' then inst := inst_f32_reinterpret_i32
|
||||
else Result := false;
|
||||
|
||||
end else if (t[2]='6') and (t[3]='4') then begin
|
||||
@ -283,6 +284,7 @@ begin
|
||||
else if t = 'f64.convert_i64_u' then inst := inst_f64_convert_i64_u
|
||||
else if t = 'f64.promote_f32' then inst := inst_f64_promote_f32
|
||||
else if t = 'f64.reinterpret_i64' then inst := inst_f64_reinterpret_i64
|
||||
else if t = 'f64.reinterpret/i64' then inst := inst_f64_reinterpret_i64
|
||||
else Result := false;
|
||||
end;
|
||||
end;
|
||||
@ -337,6 +339,7 @@ begin
|
||||
else if t = 'i32.trunc_f64_s' then inst := inst_i32_trunc_f64_s
|
||||
else if t = 'i32.trunc_f64_u' then inst := inst_i32_trunc_f64_u
|
||||
else if t = 'i32.reinterpret_f32' then inst := inst_i32_reinterpret_f32
|
||||
else if t = 'i32.reinterpret/f32' then inst := inst_i32_reinterpret_f32
|
||||
else Result := false;
|
||||
end else if (t[2]='6') and (t[3]='4') then begin
|
||||
if t = 'i64.load8_s' then inst := inst_i64_load8_s
|
||||
@ -387,6 +390,7 @@ begin
|
||||
else if t = 'i64.trunc_f64_u' then inst := inst_i64_trunc_f64_u
|
||||
else if t = 'i64.load' then inst := inst_i64_load
|
||||
else if t = 'i64.reinterpret_f64' then inst := inst_i64_reinterpret_f64
|
||||
else if t = 'i64.reinterpret/f64' then inst := inst_i64_reinterpret_f64
|
||||
else Result := false;
|
||||
end else
|
||||
Result := false;
|
||||
|
@ -65,7 +65,9 @@ const
|
||||
,'+' ,'-' ,'.' ,'/' ,':' ,'<' ,'='
|
||||
,'>' ,'?' ,'@' ,'\' ,'^' ,'_' ,'`'
|
||||
,'|' ,'~'];
|
||||
GrammarChars = AlphaNumChars+['.','_'];
|
||||
GrammarChars = AlphaNumChars+['.','_'
|
||||
,'/' // some old instructions are like that: "f32.reinterpret/i32"
|
||||
];
|
||||
|
||||
procedure GetGrammar(const txt: string; out entity: TWatToken; out instByte: byte);
|
||||
|
||||
@ -264,7 +266,7 @@ begin
|
||||
numformat := wnfInteger;
|
||||
end;
|
||||
|
||||
end else if buf[idx] in AlphaNumChars then begin
|
||||
end else if buf[idx] in GrammarChars then begin
|
||||
resText:=ScanWhile(buf, idx, GrammarChars);
|
||||
GetGrammar(resText, token, instrCode);
|
||||
done:=true;
|
||||
|
Loading…
Reference in New Issue
Block a user