mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-25 01:51:41 +02:00
* some m68k stuff updated
This commit is contained in:
parent
1fcd2cd8ad
commit
54ceea9e60
@ -29,7 +29,8 @@ unit cgcpu;
|
||||
uses
|
||||
cgbase,cgobj,globtype,
|
||||
aasmbase,aasmtai,aasmcpu,
|
||||
cpubase,cpuinfo,cpupara,
|
||||
cpubase,cpuinfo,
|
||||
parabase,cpupara,
|
||||
node,symconst,symtype,
|
||||
cgutils,cg64f32;
|
||||
|
||||
@ -50,7 +51,7 @@ unit cgcpu;
|
||||
procedure a_loadmm_reg_reg(list: taasmoutput;fromsize,tosize : tcgsize; reg1, reg2: tregister;shuffle : pmmshuffle); override;
|
||||
procedure a_loadmm_ref_reg(list: taasmoutput;fromsize,tosize : tcgsize; const ref: treference; reg: tregister;shuffle : pmmshuffle); override;
|
||||
procedure a_loadmm_reg_ref(list: taasmoutput;fromsize,tosize : tcgsize; reg: tregister; const ref: treference;shuffle : pmmshuffle); override;
|
||||
procedure a_parammm_reg(list: taasmoutput; size: tcgsize; reg: tregister;const locpara : tparalocation;shuffle : pmmshuffle); override;
|
||||
procedure a_parammm_reg(list: taasmoutput; size: tcgsize; reg: tregister;const locpara : TCGPara;shuffle : pmmshuffle); override;
|
||||
procedure a_op_const_reg(list : taasmoutput; Op: TOpCG; size: tcgsize; a: aint; reg: TRegister); override;
|
||||
procedure a_op_reg_reg(list : taasmoutput; Op: TOpCG; size: TCGSize; reg1, reg2: TRegister); override;
|
||||
procedure a_cmp_const_reg_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp;a : aint;reg : tregister;
|
||||
@ -70,7 +71,7 @@ unit cgcpu;
|
||||
procedure g_restore_standard_registers(list:Taasmoutput);override;
|
||||
procedure g_save_standard_registers(list:Taasmoutput);override;
|
||||
procedure g_save_all_registers(list : taasmoutput);override;
|
||||
procedure g_restore_all_registers(list : taasmoutput;const funcretparaloc:tparalocation);override;
|
||||
procedure g_restore_all_registers(list : taasmoutput;const funcretparaloc:TCGPara);override;
|
||||
protected
|
||||
function fixref(list: taasmoutput; var ref: treference): boolean;
|
||||
private
|
||||
@ -380,7 +381,7 @@ unit cgcpu;
|
||||
end;
|
||||
|
||||
|
||||
procedure tcg68k.a_parammm_reg(list: taasmoutput; size: tcgsize; reg: tregister;const locpara : tparalocation;shuffle : pmmshuffle);
|
||||
procedure tcg68k.a_parammm_reg(list: taasmoutput; size: tcgsize; reg: tregister;const locpara : TCGPara;shuffle : pmmshuffle);
|
||||
begin
|
||||
internalerror(20020729);
|
||||
end;
|
||||
@ -1134,7 +1135,7 @@ unit cgcpu;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure tcg68k.g_restore_all_registers(list : taasmoutput;const funcretparaloc:tparalocation);
|
||||
procedure tcg68k.g_restore_all_registers(list : taasmoutput;const funcretparaloc:TCGPara);
|
||||
begin
|
||||
end;
|
||||
|
||||
@ -1313,7 +1314,10 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.31 2004-11-09 22:32:59 peter
|
||||
Revision 1.32 2004-11-27 16:16:02 florian
|
||||
* some m68k stuff updated
|
||||
|
||||
Revision 1.31 2004/11/09 22:32:59 peter
|
||||
* small m68k updates to bring it up2date
|
||||
* give better error for external local variable
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ unit cpupara;
|
||||
uses
|
||||
globtype,
|
||||
cpubase,
|
||||
symconst,symdef,
|
||||
symconst,symdef,symsym,
|
||||
parabase,paramgr;
|
||||
|
||||
type
|
||||
@ -44,7 +44,7 @@ unit cpupara;
|
||||
procedure getintparaloc(calloption : tproccalloption; nr : longint;var cgpara : TCGPara);override;
|
||||
function create_paraloc_info(p : tabstractprocdef; side: tcallercallee):longint;override;
|
||||
private
|
||||
function parseparaloc(p : tparaitem;const s : string) : boolean;override;
|
||||
function parseparaloc(p : tparavarsym;const s : string) : boolean;override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -81,24 +81,42 @@ unit cpupara;
|
||||
function tm68kparamanager.create_paraloc_info(p : tabstractprocdef; side: tcallercallee):longint;
|
||||
var
|
||||
paraloc : pcgparalocation;
|
||||
hp : tparaitem;
|
||||
hp : tparavarsym;
|
||||
paracgsize : tcgsize;
|
||||
paralen : longint;
|
||||
parasize : longint;
|
||||
i : longint;
|
||||
begin
|
||||
parasize:=0;
|
||||
hp:=tparaitem(p.para.first);
|
||||
while assigned(hp) do
|
||||
for i:=0 to p.paras.count-1 do
|
||||
begin
|
||||
if push_addr_param(hp.paratyp,hp.paratype.def,p.proccalloption) then
|
||||
hp:=tparavarsym(p.paras[i]);
|
||||
|
||||
hp.paraloc[side].reset;
|
||||
{ currently only support C-style array of const }
|
||||
if (p.proccalloption in [pocall_cdecl,pocall_cppdecl]) and
|
||||
is_array_of_const(hp.vartype.def) then
|
||||
begin
|
||||
paraloc:=hp.paraloc[side].add_location;
|
||||
{ hack: the paraloc must be valid, but is not actually used }
|
||||
paraloc^.loc:=LOC_REFERENCE;
|
||||
if side=callerside then
|
||||
paraloc^.reference.index:=NR_STACK_POINTER_REG
|
||||
else
|
||||
paraloc^.reference.index:=NR_FRAME_POINTER_REG;
|
||||
paraloc^.size:=OS_ADDR;
|
||||
paraloc^.reference.offset:=0;
|
||||
break;
|
||||
end;
|
||||
|
||||
if push_addr_param(hp.varspez,hp.vartype.def,p.proccalloption) then
|
||||
paracgsize:=OS_ADDR
|
||||
else
|
||||
begin
|
||||
paracgsize:=def_cgSize(hp.paratype.def);
|
||||
paracgsize:=def_cgsize(hp.vartype.def);
|
||||
if paracgsize=OS_NO then
|
||||
paracgsize:=OS_ADDR;
|
||||
end;
|
||||
hp.paraloc[side].reset;
|
||||
hp.paraloc[side].size:=paracgsize;
|
||||
hp.paraloc[side].Alignment:=std_param_align;
|
||||
paraloc:=hp.paraloc[side].add_location;
|
||||
@ -109,13 +127,12 @@ unit cpupara;
|
||||
else
|
||||
paraloc^.reference.index:=NR_FRAME_POINTER_REG;
|
||||
paraloc^.reference.offset:=target_info.first_parm_offset+parasize;
|
||||
hp:=TParaItem(hp.Next);
|
||||
end;
|
||||
result:=parasize;
|
||||
end;
|
||||
|
||||
|
||||
function tm68kparamanager.parseparaloc(p : tparaitem;const s : string) : boolean;
|
||||
function tm68kparamanager.parseparaloc(p : tparavarsym;const s : string) : boolean;
|
||||
var
|
||||
paraloc : pcgparalocation;
|
||||
begin
|
||||
@ -126,7 +143,7 @@ unit cpupara;
|
||||
p.paraloc[callerside].alignment:=4;
|
||||
paraloc:=p.paraloc[callerside].add_location;
|
||||
paraloc^.loc:=LOC_REGISTER;
|
||||
paraloc^.size:=def_cgsize(p.paratype.def);
|
||||
paraloc^.size:=def_cgsize(p.vartype.def);
|
||||
{ pattern is always uppercase'd }
|
||||
if s='D0' then
|
||||
paraloc^.register:=NR_D0
|
||||
@ -179,7 +196,10 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.8 2004-11-09 22:32:59 peter
|
||||
Revision 1.9 2004-11-27 16:16:02 florian
|
||||
* some m68k stuff updated
|
||||
|
||||
Revision 1.8 2004/11/09 22:32:59 peter
|
||||
* small m68k updates to bring it up2date
|
||||
* give better error for external local variable
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user