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:
Károly Balogh 2015-02-15 17:15:15 +00:00
parent 7049e40668
commit fdb09365ba

View File

@ -172,8 +172,6 @@ implementation
case current_settings.fputype of
fpu_68881:
begin
location_reset(location,LOC_FLAGS,OS_NO);
{ force fpureg as location, left right doesn't matter
as both will be in a fpureg }
hlcg.location_force_fpureg(current_asmdata.CurrAsmList,left.location,left.resultdef,true);
@ -182,18 +180,17 @@ implementation
// emit compare
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.
// 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)
tmpreg:=cg.getintregister(current_asmdata.CurrAsmList,OS_8);
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(taicpu.op_reg(A_TST,S_B,tmpreg));
location.resflags:=F_E;
current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_NEG,S_B,tmpreg));
location_reset(location,LOC_REGISTER,OS_8);
location.register:=tmpreg;
end;
else
// softfpu should be handled in pass1, others are not yet supported...