mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 18:25:58 +02:00
m68k: instead of trying to mess with LOC_FLAGS, use LOC_REGISTER to return a boolean result of the compare. idea by Florian. fixes several issues with optimizer enabled and also results in better code in some cases.
git-svn-id: trunk@29709 -
This commit is contained in:
parent
7049e40668
commit
fdb09365ba
@ -172,8 +172,6 @@ implementation
|
|||||||
case current_settings.fputype of
|
case current_settings.fputype of
|
||||||
fpu_68881:
|
fpu_68881:
|
||||||
begin
|
begin
|
||||||
location_reset(location,LOC_FLAGS,OS_NO);
|
|
||||||
|
|
||||||
{ force fpureg as location, left right doesn't matter
|
{ force fpureg as location, left right doesn't matter
|
||||||
as both will be in a fpureg }
|
as both will be in a fpureg }
|
||||||
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
|
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
|
||||||
@ -182,18 +180,17 @@ implementation
|
|||||||
// emit compare
|
// emit compare
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_FCMP,S_FX,right.location.register,left.location.register));
|
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_FCMP,S_FX,right.location.register,left.location.register));
|
||||||
|
|
||||||
location.resflags:=getresflags(false);
|
|
||||||
|
|
||||||
// temporary(?) hack, move condition result back to the CPU from the FPU.
|
// temporary(?) hack, move condition result back to the CPU from the FPU.
|
||||||
// 6888x has its own FBcc branch instructions and FScc flags->reg instruction,
|
// 6888x has its own FBcc branch instructions and FScc flags->reg instruction,
|
||||||
// which we don't support yet in the rest of the cg. (KB)
|
// which we don't support yet in the rest of the cg. (KB)
|
||||||
tmpreg:=cg.getintregister(current_asmdata.CurrAsmList,OS_8);
|
tmpreg:=cg.getintregister(current_asmdata.CurrAsmList,OS_8);
|
||||||
ai:=taicpu.op_reg(A_FSxx,S_B,tmpreg);
|
ai:=taicpu.op_reg(A_FSxx,S_B,tmpreg);
|
||||||
ai.SetCondition(flags_to_cond(location.resflags));
|
ai.SetCondition(flags_to_cond(getresflags(false)));
|
||||||
current_asmdata.CurrAsmList.concat(ai);
|
current_asmdata.CurrAsmList.concat(ai);
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_TST,S_B,tmpreg));
|
current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_NEG,S_B,tmpreg));
|
||||||
location.resflags:=F_E;
|
|
||||||
|
|
||||||
|
location_reset(location,LOC_REGISTER,OS_8);
|
||||||
|
location.register:=tmpreg;
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
// softfpu should be handled in pass1, others are not yet supported...
|
// softfpu should be handled in pass1, others are not yet supported...
|
||||||
|
Loading…
Reference in New Issue
Block a user