mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 10:49:09 +02:00
m68k/n68kcnv.pas, tm68ktypeconvnode.second_int_to_bool:
implement case "LOC_JUMP" (with a more or less blindly copy from x86/nx86cnv.pas, tx86typeconvnode.second.int_to_bool; this now allows that the system unit can be compiled, but not yet assembled git-svn-id: trunk@22728 -
This commit is contained in:
parent
9a9d941ee1
commit
07c3cff61d
@ -43,7 +43,7 @@ implementation
|
|||||||
verbose,globals,systems,
|
verbose,globals,systems,
|
||||||
symconst,symdef,aasmbase,aasmtai,aasmdata,
|
symconst,symdef,aasmbase,aasmtai,aasmdata,
|
||||||
defutil,
|
defutil,
|
||||||
cgbase,pass_1,pass_2,
|
cgbase,pass_1,pass_2,procinfo,
|
||||||
ncon,ncal,
|
ncon,ncal,
|
||||||
ncgutil,
|
ncgutil,
|
||||||
cpubase,aasmcpu,
|
cpubase,aasmcpu,
|
||||||
@ -160,7 +160,15 @@ implementation
|
|||||||
resflags : tresflags;
|
resflags : tresflags;
|
||||||
opsize : tcgsize;
|
opsize : tcgsize;
|
||||||
newsize : tcgsize;
|
newsize : tcgsize;
|
||||||
|
hlabel,
|
||||||
|
oldTrueLabel,
|
||||||
|
oldFalseLabel : tasmlabel;
|
||||||
begin
|
begin
|
||||||
|
oldTrueLabel:=current_procinfo.CurrTrueLabel;
|
||||||
|
oldFalseLabel:=current_procinfo.CurrFalseLabel;
|
||||||
|
current_asmdata.getjumplabel(current_procinfo.CurrTrueLabel);
|
||||||
|
current_asmdata.getjumplabel(current_procinfo.CurrFalseLabel);
|
||||||
|
|
||||||
secondpass(left);
|
secondpass(left);
|
||||||
|
|
||||||
{ TODO: needs LOC_JUMP support, because called for bool_to_bool from ncgcnv }
|
{ TODO: needs LOC_JUMP support, because called for bool_to_bool from ncgcnv }
|
||||||
@ -178,10 +186,10 @@ implementation
|
|||||||
hlcg.location_force_reg(current_asmdata.CurrAsmList,location,left.resultdef,resultdef,true)
|
hlcg.location_force_reg(current_asmdata.CurrAsmList,location,left.resultdef,resultdef,true)
|
||||||
else
|
else
|
||||||
location.size:=newsize;
|
location.size:=newsize;
|
||||||
{ ACTIVATE when loc_jump support is added
|
{ ACTIVATE when loc_jump support is added }
|
||||||
current_procinfo.CurrTrueLabel:=oldTrueLabel;
|
current_procinfo.CurrTrueLabel:=oldTrueLabel;
|
||||||
current_procinfo.CurrFalseLabel:=oldFalseLabel;
|
current_procinfo.CurrFalseLabel:=oldFalseLabel;
|
||||||
}
|
//}
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -221,6 +229,22 @@ implementation
|
|||||||
hreg1:=cg.getintregister(current_asmdata.CurrAsmList,opsize);
|
hreg1:=cg.getintregister(current_asmdata.CurrAsmList,opsize);
|
||||||
resflags:=left.location.resflags;
|
resflags:=left.location.resflags;
|
||||||
end;
|
end;
|
||||||
|
LOC_JUMP :
|
||||||
|
begin
|
||||||
|
{ for now blindly copied from nx86cnv }
|
||||||
|
location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
|
||||||
|
location.register:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
|
||||||
|
current_asmdata.getjumplabel(hlabel);
|
||||||
|
cg.a_label(current_asmdata.CurrAsmList,current_procinfo.CurrTrueLabel);
|
||||||
|
if not(is_cbool(resultdef)) then
|
||||||
|
cg.a_load_const_reg(current_asmdata.CurrAsmList,location.size,1,location.register)
|
||||||
|
else
|
||||||
|
cg.a_load_const_reg(current_asmdata.CurrAsmList,location.size,-1,location.register);
|
||||||
|
cg.a_jmp_always(current_asmdata.CurrAsmList,hlabel);
|
||||||
|
cg.a_label(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel);
|
||||||
|
cg.a_load_const_reg(current_asmdata.CurrAsmList,location.size,0,location.register);
|
||||||
|
cg.a_label(current_asmdata.CurrAsmList,hlabel);
|
||||||
|
end;
|
||||||
else
|
else
|
||||||
internalerror(200512182);
|
internalerror(200512182);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user