From ada3d2050c965e570b51ff47f70a6cae2e80b70f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1roly=20Balogh?= Date: Mon, 8 Feb 2021 05:01:45 +0000 Subject: [PATCH] m68k: write inline floating point immediates as hex consts, instead of scientific notation. the scientific notation format parsing depends on the libc the assembler was linked against, which can lead to varying results and compile errors git-svn-id: trunk@48524 - --- compiler/m68k/ag68kgas.pas | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/compiler/m68k/ag68kgas.pas b/compiler/m68k/ag68kgas.pas index 08bbe3b47f..49c4e08ec6 100644 --- a/compiler/m68k/ag68kgas.pas +++ b/compiler/m68k/ag68kgas.pas @@ -169,7 +169,7 @@ interface end; - function getopstr(var o:toper) : string; + function getopstr(size: topsize; var o:toper) : string; var i : tsuperregister; begin @@ -220,10 +220,14 @@ interface getopstr:='#'+tostr(longint(o.val)); top_realconst: begin - str(o.val_real,getopstr); - if getopstr[1]=' ' then - getopstr[1]:='+'; - getopstr:='#0d'+getopstr; + case size of + S_FS: + getopstr:='#0x'+hexstr(longint(single(o.val_real)),sizeof(single)*2); + S_FD: + getopstr:='#0x'+hexstr(BestRealRec(o.val_real).Data,sizeof(bestreal)*2); + else + internalerror(2021020801); + end; end; else internalerror(200405021); end; @@ -337,7 +341,7 @@ interface sep:=':' else sep:=','; - s:=s+sep+getopstr(taicpu(hp).oper[i]^); + s:=s+sep+getopstr(taicpu(hp).opsize,taicpu(hp).oper[i]^); end; end; end;