* do not emit TST.L #ofs(dX) instructions for the Coldfire

fixes an assembler error while compiling packages/fpgtk/src/fpgtk.pp for the Coldfire

git-svn-id: trunk@25637 -
This commit is contained in:
Károly Balogh 2013-10-04 11:31:58 +00:00
parent 584e3638ab
commit 6c0581da49

View File

@ -165,6 +165,7 @@ implementation
hlabel,
oldTrueLabel,
oldFalseLabel : tasmlabel;
tmpreference : treference;
begin
oldTrueLabel:=current_procinfo.CurrTrueLabel;
oldFalseLabel:=current_procinfo.CurrFalseLabel;
@ -209,8 +210,18 @@ implementation
{ can we optimize it, or do we need to fix the ref. ? }
if isvalidrefoffset(left.location.reference) then
begin
current_asmdata.CurrAsmList.concat(taicpu.op_ref(A_TST,TCGSize2OpSize[opsize],
left.location.reference));
{ Coldfire cannot handle tst.l 123(dX) }
if (current_settings.cputype in cpu_coldfire) and
not (isaddressregister(left.location.reference.base)) then
begin
tmpreference:=left.location.reference;
hreg2:=cg.getaddressregister(current_asmdata.CurrAsmList);
tmpreference.base:=hreg2;
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_MOVE,S_L,left.location.reference.base,hreg2));
current_asmdata.CurrAsmList.concat(taicpu.op_ref(A_TST,TCGSize2OpSize[opsize],tmpreference));
end
else
current_asmdata.CurrAsmList.concat(taicpu.op_ref(A_TST,TCGSize2OpSize[opsize],left.location.reference));
end
else
begin