m68k: revert r48224, the fix proposed in that patch was just hiding an underlying issue

git-svn-id: trunk@48415 -
This commit is contained in:
Károly Balogh 2021-01-25 00:42:01 +00:00
parent 10fa12bbae
commit 67fcf0f03e

View File

@ -26,7 +26,7 @@ unit n68kadd;
interface interface
uses uses
symtype,node,nadd,ncgadd,cpubase,cgbase; node,nadd,ncgadd,cpubase,cgbase;
type type
@ -34,7 +34,7 @@ interface
private private
function getresflags(unsigned: boolean) : tresflags; function getresflags(unsigned: boolean) : tresflags;
function getfloatresflags: tresflags; function getfloatresflags: tresflags;
function inlineable_realconstnode(const n: tnode; fpu_type : tdef): boolean; function inlineable_realconstnode(const n: tnode): boolean;
procedure second_mul64bit; procedure second_mul64bit;
protected protected
function use_generic_mul64bit: boolean; override; function use_generic_mul64bit: boolean; override;
@ -55,7 +55,7 @@ implementation
uses uses
globtype,systems, globtype,systems,
cutils,verbose,globals, cutils,verbose,globals,
symconst,symdef,paramgr, symconst,symdef,paramgr,symtype,
aasmbase,aasmtai,aasmdata,aasmcpu,defutil,htypechk, aasmbase,aasmtai,aasmdata,aasmcpu,defutil,htypechk,
cpuinfo,pass_1,pass_2, cpuinfo,pass_1,pass_2,
cpupara,cgutils,procinfo, cpupara,cgutils,procinfo,
@ -146,14 +146,9 @@ implementation
end; end;
function t68kaddnode.inlineable_realconstnode(const n: tnode; fpu_type : tdef): boolean; function t68kaddnode.inlineable_realconstnode(const n: tnode): boolean;
begin begin
if assigned(fpu_type) and result:=(n.nodetype = realconstn) and
((FPUM68K_HAS_EXTENDED in fpu_capabilities[current_settings.fputype])
or (fpu_type.size < sizeof(bestreal))) then
result:=false
else
result:=(n.nodetype = realconstn) and
not ((trealconstnode(n).value_real=MathInf.Value) or not ((trealconstnode(n).value_real=MathInf.Value) or
(trealconstnode(n).value_real=MathNegInf.Value) or (trealconstnode(n).value_real=MathNegInf.Value) or
(trealconstnode(n).value_real=MathQNaN.value)); (trealconstnode(n).value_real=MathQNaN.value));
@ -196,7 +191,7 @@ implementation
{ have left in the register, right can be a memory location } { have left in the register, right can be a memory location }
if (FPUM68K_HAS_FLOATIMMEDIATE in fpu_capabilities[current_settings.fputype]) and if (FPUM68K_HAS_FLOATIMMEDIATE in fpu_capabilities[current_settings.fputype]) and
inlineable_realconstnode(left,resultdef) then inlineable_realconstnode(left) then
begin begin
location.register := cg.getfpuregister(current_asmdata.CurrAsmList,location.size); location.register := cg.getfpuregister(current_asmdata.CurrAsmList,location.size);
current_asmdata.CurrAsmList.concat(taicpu.op_realconst_reg(A_FMOVE,tcgsize2opsize[left.location.size],trealconstnode(left).value_real,location.register)) current_asmdata.CurrAsmList.concat(taicpu.op_realconst_reg(A_FMOVE,tcgsize2opsize[left.location.size],trealconstnode(left).value_real,location.register))
@ -216,7 +211,7 @@ implementation
LOC_REFERENCE,LOC_CREFERENCE: LOC_REFERENCE,LOC_CREFERENCE:
begin begin
if (FPUM68K_HAS_FLOATIMMEDIATE in fpu_capabilities[current_settings.fputype]) and if (FPUM68K_HAS_FLOATIMMEDIATE in fpu_capabilities[current_settings.fputype]) and
inlineable_realconstnode(right,resultdef) then inlineable_realconstnode(right) then
current_asmdata.CurrAsmList.concat(taicpu.op_realconst_reg(op,tcgsize2opsize[right.location.size],trealconstnode(right).value_real,location.register)) current_asmdata.CurrAsmList.concat(taicpu.op_realconst_reg(op,tcgsize2opsize[right.location.size],trealconstnode(right).value_real,location.register))
else else
begin begin
@ -289,7 +284,7 @@ implementation
begin begin
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true); hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
if not (current_settings.fputype = fpu_coldfire) and if not (current_settings.fputype = fpu_coldfire) and
inlineable_realconstnode(right,left.resultdef) then inlineable_realconstnode(right) then
current_asmdata.CurrAsmList.concat(taicpu.op_realconst_reg(A_FCMP,tcgsize2opsize[right.location.size],trealconstnode(right).value_real,left.location.register)) current_asmdata.CurrAsmList.concat(taicpu.op_realconst_reg(A_FCMP,tcgsize2opsize[right.location.size],trealconstnode(right).value_real,left.location.register))
else else
begin begin