|
@@ -571,6 +571,30 @@ begin
|
|
end;
|
|
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);
|
|
procedure TBinWriter.WriteInstList(list: TWasmInstrList; ofsAddition: LongWord);
|
|
var
|
|
var
|
|
i : integer;
|
|
i : integer;
|
|
@@ -597,6 +621,9 @@ begin
|
|
WriteI64Operand(dst, ci.operandText);
|
|
WriteI64Operand(dst, ci.operandText);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ ipf32: WriteF32Operand(dst, ci.operandText);
|
|
|
|
+ ipf64: WriteF64Operand(dst, ci.operandText);
|
|
|
|
+
|
|
ipi32OrFunc: begin
|
|
ipi32OrFunc: begin
|
|
if ci.hasRelocIdx then
|
|
if ci.hasRelocIdx then
|
|
// should have been populated with Normalize
|
|
// should have been populated with Normalize
|