mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-10 00:47:20 +01:00
* m68k: fixed the register save/restore for larger than 32K stackframes on subarchs which has no long displacement, to not trash register A0
This commit is contained in:
parent
14ae44c362
commit
be2c1c751d
@ -2099,11 +2099,12 @@ unit cgcpu;
|
||||
{ Copy registers to temp }
|
||||
{ NOTE: virtual registers allocated here won't be translated --> no higher-level stuff. }
|
||||
href:=current_procinfo.save_regs_ref;
|
||||
if (href.offset<low(smallint)) and (current_settings.cputype in cpu_coldfire+[cpu_mc68000]) then
|
||||
if (abs(current_procinfo.save_regs_ref.offset)>abs(low(smallint))) and
|
||||
not (CPUM68K_HAS_BASEDISP in cpu_capabilities[current_settings.cputype]) then
|
||||
begin
|
||||
list.concat(taicpu.op_reg_reg(A_MOVE,S_L,href.base,NR_A0));
|
||||
list.concat(taicpu.op_const_reg(A_ADDA,S_L,href.offset,NR_A0));
|
||||
reference_reset_base(href,NR_A0,0,ctempposinvalid,sizeof(pint),[]);
|
||||
href.offset:=0;
|
||||
//list.concat(tai_comment.create(strpnew('g_save_registers: large offset')));
|
||||
list.concat(taicpu.op_const_reg(A_SUBA,S_L,-current_procinfo.save_regs_ref.offset,href.base));
|
||||
end;
|
||||
|
||||
if size > 0 then
|
||||
@ -2121,6 +2122,12 @@ unit cgcpu;
|
||||
else
|
||||
list.concat(taicpu.op_regset_ref(A_FMOVEM,fpuregopsize,[],[],fpuregs,href));
|
||||
end;
|
||||
|
||||
if (abs(current_procinfo.save_regs_ref.offset)>abs(low(smallint))) and
|
||||
not (CPUM68K_HAS_BASEDISP in cpu_capabilities[current_settings.cputype]) then
|
||||
begin
|
||||
list.concat(taicpu.op_const_reg(A_ADDA,S_L,-current_procinfo.save_regs_ref.offset,href.base));
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -2193,11 +2200,12 @@ unit cgcpu;
|
||||
|
||||
{ Restore registers from temp }
|
||||
href:=current_procinfo.save_regs_ref;
|
||||
if (href.offset<low(smallint)) and (current_settings.cputype in cpu_coldfire+[cpu_mc68000]) then
|
||||
if (abs(current_procinfo.save_regs_ref.offset)>abs(low(smallint))) and
|
||||
not (CPUM68K_HAS_BASEDISP in cpu_capabilities[current_settings.cputype]) then
|
||||
begin
|
||||
list.concat(taicpu.op_reg_reg(A_MOVE,S_L,href.base,NR_A0));
|
||||
list.concat(taicpu.op_const_reg(A_ADDA,S_L,href.offset,NR_A0));
|
||||
reference_reset_base(href,NR_A0,0,ctempposinvalid,sizeof(pint),[]);
|
||||
href.offset:=0;
|
||||
//list.concat(tai_comment.create(strpnew('g_restore_registers: large offset')));
|
||||
list.concat(taicpu.op_const_reg(A_SUBA,S_L,-current_procinfo.save_regs_ref.offset,href.base));
|
||||
end;
|
||||
|
||||
if size > 0 then
|
||||
@ -2216,6 +2224,12 @@ unit cgcpu;
|
||||
list.concat(taicpu.op_ref_regset(A_FMOVEM,fpuregopsize,href,[],[],fpuregs));
|
||||
end;
|
||||
|
||||
if (abs(current_procinfo.save_regs_ref.offset)>abs(low(smallint))) and
|
||||
not (CPUM68K_HAS_BASEDISP in cpu_capabilities[current_settings.cputype]) then
|
||||
begin
|
||||
list.concat(taicpu.op_const_reg(A_ADDA,S_L,-current_procinfo.save_regs_ref.offset,href.base));
|
||||
end;
|
||||
|
||||
tg.UnGetTemp(list,current_procinfo.save_regs_ref);
|
||||
end;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user