m68k: support loading of refs to data registers, also when explicit paraloc is set and it's a register, use that directly, this fixes several syscall-related corner cases on Amiga

git-svn-id: trunk@28582 -
This commit is contained in:
Károly Balogh 2014-09-02 17:38:34 +00:00
parent 02f39c667a
commit 9991ee4165
2 changed files with 15 additions and 2 deletions

View File

@ -945,10 +945,18 @@ unit cgcpu;
procedure tcg68k.a_loadaddr_ref_reg(list : TAsmList;const ref : treference;r : tregister);
var
href : treference;
hreg : tregister;
begin
href:=ref;
fixref(list, href);
list.concat(taicpu.op_ref_reg(A_LEA,S_L,href,r));
if not isaddressregister(r) then
begin
hreg:=getaddressregister(list);
list.concat(taicpu.op_ref_reg(A_LEA,S_L,href,hreg));
a_load_reg_reg(list, OS_ADDR, OS_ADDR, hreg, r);
end
else
list.concat(taicpu.op_ref_reg(A_LEA,S_L,href,r));
end;

View File

@ -420,7 +420,12 @@ implementation
newparaloc^.loc:=paraloc^.loc;
case newparaloc^.loc of
LOC_REGISTER :
newparaloc^.register:=cg.getintregister(list,paraloc^.size);
begin
if (vo_has_explicit_paraloc in parasym.varoptions) and (paraloc^.loc = LOC_REGISTER) then
newparaloc^.register:=paraloc^.register
else
newparaloc^.register:=cg.getintregister(list,paraloc^.size);
end;
LOC_FPUREGISTER :
newparaloc^.register:=cg.getfpuregister(list,paraloc^.size);
LOC_MMREGISTER :