[PATCH 109/188] writing out binary float-point

From 814363bcc1c03513bc0db08d347a32c5e6883c06 Mon Sep 17 00:00:00 2001
From: Dmitry Boyarintsev <skalogryz.lists@gmail.com>
Date: Wed, 18 Mar 2020 08:47:16 -0400

git-svn-id: branches/wasm@46105 -
This commit is contained in:
nickysn 2020-08-03 13:00:59 +00:00
parent 861f7c67a8
commit d557557e1c

View File

@ -571,6 +571,30 @@ begin
end;
procedure WriteF32Operand(dst: TStream; const txt: string);
var
f : single;
err : integer;
begin
//todo: float point parsing!
f:=0;
Val(txt, f, err);
// valid or not, it still should write out the value
dst.Write(f, sizeof(f));
end;
procedure WriteF64Operand(dst: TStream; const txt: string);
var
f : double;
err : integer;
begin
//todo: float point parsing!
f:=0;
Val(txt, f, err);
dst.Write(f, sizeof(f));
end;
procedure TBinWriter.WriteInstList(list: TWasmInstrList; ofsAddition: LongWord);
var
i : integer;
@ -597,6 +621,9 @@ begin
WriteI64Operand(dst, ci.operandText);
end;
ipf32: WriteF32Operand(dst, ci.operandText);
ipf64: WriteF64Operand(dst, ci.operandText);
ipi32OrFunc: begin
if ci.hasRelocIdx then
// should have been populated with Normalize