mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 09:29:26 +02:00
* fixed sparc compilation partially
This commit is contained in:
parent
24a5d569cd
commit
1770c1db0f
@ -78,7 +78,7 @@ specific processor ABI. It is overriden for each CPU target.
|
|||||||
procedure g_flags2reg(list:TAasmOutput;Size:TCgSize;CONST f:tresflags;reg:TRegister);override;
|
procedure g_flags2reg(list:TAasmOutput;Size:TCgSize;CONST f:tresflags;reg:TRegister);override;
|
||||||
procedure g_overflowCheck(List:TAasmOutput;const p:TNode);override;
|
procedure g_overflowCheck(List:TAasmOutput;const p:TNode);override;
|
||||||
procedure g_stackframe_entry(list:TAasmOutput;localsize:LongInt);override;
|
procedure g_stackframe_entry(list:TAasmOutput;localsize:LongInt);override;
|
||||||
procedure g_restore_all_registers(list:TAasmOutput;selfused,accused,acchiused:boolean);override;
|
procedure g_restore_all_registers(list:TAasmOutput;accused,acchiused:boolean);override;
|
||||||
procedure g_restore_frame_pointer(list:TAasmOutput);override;
|
procedure g_restore_frame_pointer(list:TAasmOutput);override;
|
||||||
procedure g_restore_standard_registers(list:taasmoutput;usedinproc:Tsupregset);override;
|
procedure g_restore_standard_registers(list:taasmoutput;usedinproc:Tsupregset);override;
|
||||||
procedure g_return_from_proc(list:TAasmOutput;parasize:aword);override;
|
procedure g_return_from_proc(list:TAasmOutput;parasize:aword);override;
|
||||||
@ -983,7 +983,7 @@ after execution of that instruction is the called function stack pointer}
|
|||||||
with list do
|
with list do
|
||||||
concat(Taicpu.Op_reg_const_reg(A_SAVE,r,-LocalSize,r));
|
concat(Taicpu.Op_reg_const_reg(A_SAVE,r,-LocalSize,r));
|
||||||
end;
|
end;
|
||||||
procedure TCgSparc.g_restore_all_registers(list:TaasmOutput;selfused,accused,acchiused:boolean);
|
procedure TCgSparc.g_restore_all_registers(list:TaasmOutput;accused,acchiused:boolean);
|
||||||
begin
|
begin
|
||||||
{$warning FIX ME TCgSparc.g_restore_all_registers}
|
{$warning FIX ME TCgSparc.g_restore_all_registers}
|
||||||
end;
|
end;
|
||||||
@ -1449,7 +1449,10 @@ BEGIN
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.48 2003-05-07 15:04:30 mazen
|
Revision 1.49 2003-05-22 16:11:22 florian
|
||||||
|
* fixed sparc compilation partially
|
||||||
|
|
||||||
|
Revision 1.48 2003/05/07 15:04:30 mazen
|
||||||
* invalid genrated code for CASE statement fixed
|
* invalid genrated code for CASE statement fixed
|
||||||
|
|
||||||
Revision 1.47 2003/05/06 20:25:20 mazen
|
Revision 1.47 2003/05/06 20:25:20 mazen
|
||||||
|
@ -289,11 +289,19 @@ const
|
|||||||
RS_I5=$16;
|
RS_I5=$16;
|
||||||
RS_I6=$17;
|
RS_I6=$17;
|
||||||
RS_I7=$18;
|
RS_I7=$18;
|
||||||
|
RS_G0=$19;
|
||||||
|
RS_G1=$1A;
|
||||||
|
RS_G2=$1B;
|
||||||
|
RS_G3=$1C;
|
||||||
|
RS_G4=$1D;
|
||||||
|
RS_G5=$1E;
|
||||||
|
RS_G6=$1F;
|
||||||
|
RS_G7=$20;
|
||||||
|
|
||||||
first_supreg = $01;
|
first_supreg = $01;
|
||||||
last_supreg = $18;
|
last_supreg = $20;
|
||||||
|
|
||||||
first_imreg = $19;
|
first_imreg = $21;
|
||||||
last_imreg = $ff;
|
last_imreg = $ff;
|
||||||
|
|
||||||
{Subregisters; nothing known about.}
|
{Subregisters; nothing known about.}
|
||||||
@ -584,11 +592,11 @@ VAR
|
|||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
const
|
const
|
||||||
maxvarregs=30;
|
maxvarregs=30;
|
||||||
VarRegs:array[1..maxvarregs]OF TCpuRegister=(
|
VarRegs:array[1..maxvarregs] of tnewregister = (
|
||||||
R_G0,R_G1,R_G2,R_G3,R_G4,R_G5,R_G6,R_G7,
|
RS_G0,RS_G1,RS_G2,RS_G3,RS_G4,RS_G5,RS_G6,RS_G7,
|
||||||
R_O0,R_O1,R_O2,R_O3,R_O4,R_O5,{R_R14=R_SP}R_O7,
|
RS_O0,RS_O1,RS_O2,RS_O3,RS_O4,RS_O5,{RS_R14=RS_SP}RS_O7,
|
||||||
R_L0,R_L1,R_L2,R_L3,R_L4,R_L5,R_L6,R_L7,
|
RS_L0,RS_L1,RS_L2,RS_L3,RS_L4,RS_L5,RS_L6,RS_L7,
|
||||||
R_I0,R_I1,R_I2,R_I3,R_I4,R_I5,{R_R30=R_FP}R_I7
|
RS_I0,RS_I1,RS_I2,RS_I3,RS_I4,RS_I5,{RS_R30=RS_FP}RS_I7
|
||||||
);
|
);
|
||||||
maxfpuvarregs = 8;
|
maxfpuvarregs = 8;
|
||||||
max_operands = 3;
|
max_operands = 3;
|
||||||
@ -670,7 +678,10 @@ end;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.30 2003-05-06 14:58:46 mazen
|
Revision 1.31 2003-05-22 16:11:22 florian
|
||||||
|
* fixed sparc compilation partially
|
||||||
|
|
||||||
|
Revision 1.30 2003/05/06 14:58:46 mazen
|
||||||
- non used constants OT_* removed
|
- non used constants OT_* removed
|
||||||
* some keywords moved lower case
|
* some keywords moved lower case
|
||||||
|
|
||||||
|
@ -59,14 +59,11 @@ interface
|
|||||||
{ constants }
|
{ constants }
|
||||||
aggas,cpubase,globtype
|
aggas,cpubase,globtype
|
||||||
;
|
;
|
||||||
Procedure FWaitWarning;
|
|
||||||
begin
|
|
||||||
if (target_info.system=system_i386_GO32V2) and (cs_fp_emulation in aktmoduleswitches) then
|
|
||||||
Message(asmr_w_fwait_emu_prob);
|
|
||||||
end;
|
|
||||||
function assemble : tnode;
|
function assemble : tnode;
|
||||||
|
|
||||||
var
|
var
|
||||||
|
uhs,
|
||||||
retstr,s,hs : string;
|
retstr,s,hs : string;
|
||||||
c : char;
|
c : char;
|
||||||
ende : boolean;
|
ende : boolean;
|
||||||
@ -139,8 +136,6 @@ end;
|
|||||||
else
|
else
|
||||||
Message(asmr_w_using_defined_as_local);
|
Message(asmr_w_using_defined_as_local);
|
||||||
end
|
end
|
||||||
else if upper(hs)='FWAIT' then
|
|
||||||
FwaitWarning
|
|
||||||
else
|
else
|
||||||
{ access to local variables }
|
{ access to local variables }
|
||||||
if assigned(current_procdef) then
|
if assigned(current_procdef) then
|
||||||
@ -148,7 +143,7 @@ end;
|
|||||||
{ is the last written character an special }
|
{ is the last written character an special }
|
||||||
{ char ? }
|
{ char ? }
|
||||||
if (s[length(s)]='%') and
|
if (s[length(s)]='%') and
|
||||||
paramanager.ret_in_acc(current_procdef.rettype.def,current_procdef.proccalloption) and
|
(not paramanager.ret_in_param(current_procdef.rettype.def,current_procdef.proccalloption)) and
|
||||||
((pos('AX',upper(hs))>0) or
|
((pos('AX',upper(hs))>0) or
|
||||||
(pos('AL',upper(hs))>0)) then
|
(pos('AL',upper(hs))>0)) then
|
||||||
tvarsym(current_procdef.funcretsym).varstate:=vs_assigned;
|
tvarsym(current_procdef.funcretsym).varstate:=vs_assigned;
|
||||||
@ -208,15 +203,54 @@ end;
|
|||||||
tvarsym(sym).varstate:=vs_used;
|
tvarsym(sym).varstate:=vs_used;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
{ I added that but it creates a problem in line.ppi
|
end
|
||||||
because there is a local label wbuffer and
|
end
|
||||||
a static variable WBUFFER ...
|
|
||||||
what would you decide, florian ?}
|
|
||||||
else
|
else
|
||||||
|
|
||||||
begin
|
begin
|
||||||
searchsym(upper(hs),sym,srsymtable);
|
uhs:=upper(hs);
|
||||||
if assigned(sym) and (sym.owner.symtabletype in [globalsymtable,staticsymtable]) then
|
if (uhs='__SELF') then
|
||||||
|
begin
|
||||||
|
if assigned(current_procdef._class) then
|
||||||
|
uhs:='self'
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Message(asmr_e_cannot_use_SELF_outside_a_method);
|
||||||
|
uhs:='';
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if (uhs='__OLDEBP') then
|
||||||
|
begin
|
||||||
|
if current_procdef.parast.symtablelevel>normal_function_level then
|
||||||
|
uhs:='parentframe'
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Message(asmr_e_cannot_use_OLDEBP_outside_nested_procedure);
|
||||||
|
uhs:='';
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if uhs='__RESULT' then
|
||||||
|
begin
|
||||||
|
if (not is_void(current_procdef.rettype.def)) then
|
||||||
|
uhs:='result'
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Message(asmr_e_void_function);
|
||||||
|
uhs:='';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if uhs<>'' then
|
||||||
|
searchsym(upper(hs),sym,srsymtable)
|
||||||
|
else
|
||||||
|
sym:=nil;
|
||||||
|
|
||||||
|
if assigned(sym) then
|
||||||
|
begin
|
||||||
|
case sym.owner.symtabletype of
|
||||||
|
globalsymtable,
|
||||||
|
staticsymtable :
|
||||||
begin
|
begin
|
||||||
case sym.typ of
|
case sym.typ of
|
||||||
varsym :
|
varsym :
|
||||||
@ -235,7 +269,7 @@ end;
|
|||||||
{ procs can be called or the address can be loaded }
|
{ procs can be called or the address can be loaded }
|
||||||
if ((pos('CALL',upper(s))>0) or (pos('LEA',upper(s))>0)) then
|
if ((pos('CALL',upper(s))>0) or (pos('LEA',upper(s))>0)) then
|
||||||
begin
|
begin
|
||||||
if assigned(tprocsym(sym).first_procdef) then
|
if tprocsym(sym).procdef_count>1 then
|
||||||
Message1(asmr_w_direct_global_is_overloaded_func,hs);
|
Message1(asmr_w_direct_global_is_overloaded_func,hs);
|
||||||
Message2(asmr_h_direct_global_to_mangled,hs,tprocsym(sym).first_procdef.mangledname);
|
Message2(asmr_h_direct_global_to_mangled,hs,tprocsym(sym).first_procdef.mangledname);
|
||||||
hs:=tprocsym(sym).first_procdef.mangledname;
|
hs:=tprocsym(sym).first_procdef.mangledname;
|
||||||
@ -244,31 +278,26 @@ end;
|
|||||||
else
|
else
|
||||||
Message(asmr_e_wrong_sym_type);
|
Message(asmr_e_wrong_sym_type);
|
||||||
end;
|
end;
|
||||||
end
|
end;
|
||||||
else if upper(hs)='__SELF' then
|
parasymtable,
|
||||||
|
localsymtable :
|
||||||
begin
|
begin
|
||||||
if assigned(current_procdef._class) then
|
case sym.typ of
|
||||||
hs:=tostr(current_procinfo.selfpointer_offset)+
|
varsym :
|
||||||
'('+std_reg2str[current_procinfo.framepointer.enum]+')'
|
|
||||||
else
|
|
||||||
Message(asmr_e_cannot_use_SELF_outside_a_method);
|
|
||||||
end
|
|
||||||
else if upper(hs)='__RESULT' then
|
|
||||||
begin
|
begin
|
||||||
if (not is_void(current_procdef.rettype.def)) then
|
hs:=tostr(tvarsym(sym).adjusted_address)+
|
||||||
hs:=retstr
|
'('+std_reg2str[framereg.enum]+')';
|
||||||
else
|
inc(tvarsym(sym).refs);
|
||||||
Message(asmr_e_void_function);
|
end;
|
||||||
end
|
typedconstsym :
|
||||||
else if upper(hs)='__OLDEBP' then
|
|
||||||
begin
|
begin
|
||||||
{ complicate to check there }
|
Message2(asmr_h_direct_global_to_mangled,hs,ttypedconstsym(sym).mangledname);
|
||||||
{ we do it: }
|
hs:=ttypedconstsym(sym).mangledname;
|
||||||
if current_procdef.parast.symtablelevel>normal_function_level then
|
end;
|
||||||
hs:=tostr(current_procinfo.framepointer_offset)+
|
|
||||||
'('+std_reg2str[current_procinfo.framepointer.enum]+')'
|
|
||||||
else
|
else
|
||||||
Message(asmr_e_cannot_use_OLDEBP_outside_nested_procedure);
|
Message(asmr_e_wrong_sym_type);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -314,7 +343,10 @@ initialization
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.7 2003-04-27 11:21:36 peter
|
Revision 1.8 2003-05-22 16:11:22 florian
|
||||||
|
* fixed sparc compilation partially
|
||||||
|
|
||||||
|
Revision 1.7 2003/04/27 11:21:36 peter
|
||||||
* aktprocdef renamed to current_procdef
|
* aktprocdef renamed to current_procdef
|
||||||
* procinfo renamed to current_procinfo
|
* procinfo renamed to current_procinfo
|
||||||
* procinfo will now be stored in current_module so it can be
|
* procinfo will now be stored in current_module so it can be
|
||||||
|
Loading…
Reference in New Issue
Block a user