[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:
nickysn 2020-08-03 13:01:26 +00:00
parent 5c9d1df31d
commit 5ddf47ec58
2 changed files with 8 additions and 2 deletions

View File

@ -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;

View File

@ -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;