mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 05:49:12 +02:00
* fix some small flaws which prevent sparc linux system unit from compiling
* some reformatting done
This commit is contained in:
parent
b6088901a6
commit
995f7e0f11
@ -1560,6 +1560,14 @@ implementation
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
initasmmode:=asmmode_direct;
|
initasmmode:=asmmode_direct;
|
||||||
{$endif powerpc}
|
{$endif powerpc}
|
||||||
|
{$ifdef sparc}
|
||||||
|
initoptprocessor:=SPARC_V8;
|
||||||
|
initpackenum:=4;
|
||||||
|
{$IFDEF testvarsets}
|
||||||
|
initsetalloc:=0;
|
||||||
|
{$ENDIF}
|
||||||
|
initasmmode:=asmmode_direct;
|
||||||
|
{$endif sparc}
|
||||||
initinterfacetype:=it_interfacecom;
|
initinterfacetype:=it_interfacecom;
|
||||||
initdefproccall:=pocall_none;
|
initdefproccall:=pocall_none;
|
||||||
initdefines:=TStringList.Create;
|
initdefines:=TStringList.Create;
|
||||||
@ -1575,7 +1583,11 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.91 2003-05-23 15:03:31 peter
|
Revision 1.92 2003-05-23 22:33:48 florian
|
||||||
|
* fix some small flaws which prevent sparc linux system unit from compiling
|
||||||
|
* some reformatting done
|
||||||
|
|
||||||
|
Revision 1.91 2003/05/23 15:03:31 peter
|
||||||
* fix previous commit for unix
|
* fix previous commit for unix
|
||||||
|
|
||||||
Revision 1.90 2003/05/23 14:39:56 peter
|
Revision 1.90 2003/05/23 14:39:56 peter
|
||||||
|
@ -794,7 +794,6 @@ implementation
|
|||||||
End;
|
End;
|
||||||
asmstat:=tasmnode(radirect.assemble);
|
asmstat:=tasmnode(radirect.assemble);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
else
|
else
|
||||||
Message(parser_f_assembler_reader_not_supported);
|
Message(parser_f_assembler_reader_not_supported);
|
||||||
end;
|
end;
|
||||||
@ -1175,7 +1174,11 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.101 2003-05-23 15:15:36 peter
|
Revision 1.102 2003-05-23 22:33:48 florian
|
||||||
|
* fix some small flaws which prevent sparc linux system unit from compiling
|
||||||
|
* some reformatting done
|
||||||
|
|
||||||
|
Revision 1.101 2003/05/23 15:15:36 peter
|
||||||
* better error for undefined ordinal labels
|
* better error for undefined ordinal labels
|
||||||
|
|
||||||
Revision 1.100 2003/05/17 13:30:08 jonas
|
Revision 1.100 2003/05/17 13:30:08 jonas
|
||||||
|
@ -962,74 +962,86 @@ procedure TCgSparc.g_overflowCheck(List:TAasmOutput;const p:TNode);
|
|||||||
a_call_name(list,'FPC_OVERFLOW');
|
a_call_name(list,'FPC_OVERFLOW');
|
||||||
a_label(list,hl);
|
a_label(list,hl);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ *********** entry/exit code and address loading ************ }
|
{ *********** entry/exit code and address loading ************ }
|
||||||
|
|
||||||
procedure TCgSparc.g_stackframe_entry(list:TAasmOutput;LocalSize:LongInt);
|
procedure TCgSparc.g_stackframe_entry(list:TAasmOutput;LocalSize:LongInt);
|
||||||
var
|
var
|
||||||
href:TReference;
|
r : tregister;
|
||||||
r:Tregister;
|
|
||||||
i:integer;
|
|
||||||
again:tasmlabel;
|
|
||||||
begin
|
begin
|
||||||
{Althogh the SPARC architecture require only word alignment, software
|
{ Althogh the SPARC architecture require only word alignment, software
|
||||||
convention and the operating system require every stack frame to be double word
|
convention and the operating system require every stack frame to be double word
|
||||||
aligned}
|
aligned }
|
||||||
LocalSize:=(LocalSize+7)and $FFFFFFF8;
|
LocalSize:=align(LocalSize,8);
|
||||||
{Execute the SAVE instruction to get a new register window and create a new
|
{ Execute the SAVE instruction to get a new register window and create a new
|
||||||
stack frame. In the "SAVE %i6,size,%i6" the first %i6 is related to the state
|
stack frame. In the "SAVE %i6,size,%i6" the first %i6 is related to the state
|
||||||
before execution of the SAVE instrucion so it is the caller %i6, when the %i6
|
before execution of the SAVE instrucion so it is the caller %i6, when the %i6
|
||||||
after execution of that instruction is the called function stack pointer}
|
after execution of that instruction is the called function stack pointer}
|
||||||
r.enum:=stack_pointer_reg;
|
r.enum:=R_INTREGISTER;
|
||||||
with list do
|
r.number:=NR_STACK_POINTER_REG;
|
||||||
concat(Taicpu.Op_reg_const_reg(A_SAVE,r,-LocalSize,r));
|
list.concat(Taicpu.Op_reg_const_reg(A_SAVE,r,-LocalSize,r));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TCgSparc.g_restore_all_registers(list:TaasmOutput;accused,acchiused:boolean);
|
procedure TCgSparc.g_restore_all_registers(list:TaasmOutput;accused,acchiused:boolean);
|
||||||
begin
|
begin
|
||||||
{$warning FIX ME TCgSparc.g_restore_all_registers}
|
{ The sparc port uses the sparc standard calling convetions so this function has no used }
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TCgSparc.g_restore_frame_pointer(list:TAasmOutput);
|
procedure TCgSparc.g_restore_frame_pointer(list:TAasmOutput);
|
||||||
begin
|
begin
|
||||||
{This function intontionally does nothing as frame pointer is restored in the
|
{ This function intontionally does nothing as frame pointer is restored in the
|
||||||
delay slot of the return instrucion done in g_return_from_proc}
|
delay slot of the return instrucion done in g_return_from_proc}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TCgSparc.g_restore_standard_registers(list:taasmoutput;usedinproc:Tsupregset);
|
procedure TCgSparc.g_restore_standard_registers(list:taasmoutput;usedinproc:Tsupregset);
|
||||||
begin
|
begin
|
||||||
{$WARNING FIX ME TCgSparc.g_restore_standard_registers}
|
{ The sparc port uses the sparc standard calling convetions so this function has no used }
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TCgSparc.g_return_from_proc(list:TAasmOutput;parasize:aword);
|
procedure TCgSparc.g_return_from_proc(list:TAasmOutput;parasize:aword);
|
||||||
|
var
|
||||||
var r,r2:Tregister;
|
r,r2:Tregister;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
{According to the SPARC ABI, the stack is cleared using the RESTORE instruction
|
{ According to the SPARC ABI, the stack is cleared using the RESTORE instruction
|
||||||
which is genereted in the g_restore_frame_pointer. Notice that SPARC has no
|
which is genereted in the g_restore_frame_pointer. Notice that SPARC has no
|
||||||
RETURN instruction and that JMPL is used instead. The JMPL instrucion have one
|
RETURN instruction and that JMPL is used instead. The JMPL instrucion have one
|
||||||
delay slot, so an inversion is possible such as
|
delay slot, so an inversion is possible such as
|
||||||
JMPL %i7+8,%g0
|
JMPL %i7+8,%g0
|
||||||
RESTORE %g0,0,%g0
|
RESTORE %g0,0,%g0
|
||||||
If no inversion we can use just
|
If no inversion we can use just
|
||||||
RESTORE %g0,0,%g0
|
RESTORE %g0,0,%g0
|
||||||
JMPL %i7+8,%g0
|
JMPL %i7+8,%g0
|
||||||
NOP}
|
NOP
|
||||||
|
}
|
||||||
with list do
|
with list do
|
||||||
begin
|
begin
|
||||||
{Return address is computed by adding 8 to the CALL address saved onto %i6}
|
{ Return address is computed by adding 8 to the CALL address saved onto %i6}
|
||||||
r.enum:=R_G0;
|
r.enum:=R_G0;
|
||||||
r2.enum:=R_I7;
|
r2.enum:=R_I7;
|
||||||
concat(Taicpu.Op_caddr_reg(A_JMPL,r,8,r));
|
concat(Taicpu.Op_caddr_reg(A_JMPL,r,8,r));
|
||||||
{We use trivial restore in the delay slot of the JMPL instruction, as we
|
{ We use trivial restore in the delay slot of the JMPL instruction, as we
|
||||||
already set result onto %i0}
|
already set result onto %i0 }
|
||||||
concat(Taicpu.Op_reg_const_reg(A_RESTORE,r,0,r));
|
concat(Taicpu.Op_reg_const_reg(A_RESTORE,r,0,r));
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TCgSparc.g_save_all_registers(list : taasmoutput);
|
procedure TCgSparc.g_save_all_registers(list : taasmoutput);
|
||||||
begin
|
begin
|
||||||
{$warning FIX ME TCgSparc.g_save_all_registers}
|
{ The sparc port uses the sparc standard calling convetions so this function has no used }
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TCgSparc.g_save_standard_registers(list : taasmoutput; usedinproc:Tsupregset);
|
procedure TCgSparc.g_save_standard_registers(list : taasmoutput; usedinproc:Tsupregset);
|
||||||
begin
|
begin
|
||||||
{$warning FIX ME tcgppc.g_save_standard_registers}
|
{ The sparc port uses the sparc standard calling convetions so this function has no used }
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TCgSparc.a_loadaddr_ref_reg(list:TAasmOutput;CONST ref:TReference;r:tregister);
|
procedure TCgSparc.a_loadaddr_ref_reg(list:TAasmOutput;CONST ref:TReference;r:tregister);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -1449,7 +1461,11 @@ BEGIN
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.49 2003-05-22 16:11:22 florian
|
Revision 1.50 2003-05-23 22:33:48 florian
|
||||||
|
* fix some small flaws which prevent sparc linux system unit from compiling
|
||||||
|
* some reformatting done
|
||||||
|
|
||||||
|
Revision 1.49 2003/05/22 16:11:22 florian
|
||||||
* fixed sparc compilation partially
|
* fixed sparc compilation partially
|
||||||
|
|
||||||
Revision 1.48 2003/05/07 15:04:30 mazen
|
Revision 1.48 2003/05/07 15:04:30 mazen
|
||||||
|
@ -39,9 +39,10 @@ TYPE
|
|||||||
ts64comp = extended;
|
ts64comp = extended;
|
||||||
pbestreal=^bestreal;
|
pbestreal=^bestreal;
|
||||||
|
|
||||||
{ possible supported processors for this target }
|
{ possible supported processors for this target }
|
||||||
tprocessors=(no_processor,SPARC_V8,SPARC_V9);
|
tprocessors=(no_processor,SPARC_V8,SPARC_V9);
|
||||||
CONST
|
|
||||||
|
const
|
||||||
{# Size of native extended floating point type }
|
{# Size of native extended floating point type }
|
||||||
{SPARC architecture uses IEEE double floating point numbers}
|
{SPARC architecture uses IEEE double floating point numbers}
|
||||||
extended_size = 8;
|
extended_size = 8;
|
||||||
@ -61,7 +62,11 @@ IMPLEMENTATION
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.6 2002-11-16 20:07:57 florian
|
Revision 1.7 2003-05-23 22:33:48 florian
|
||||||
|
* fix some small flaws which prevent sparc linux system unit from compiling
|
||||||
|
* some reformatting done
|
||||||
|
|
||||||
|
Revision 1.6 2002/11/16 20:07:57 florian
|
||||||
* made target_cpu_name lowercase
|
* made target_cpu_name lowercase
|
||||||
|
|
||||||
Revision 1.5 2002/10/16 12:36:54 mazen
|
Revision 1.5 2002/10/16 12:36:54 mazen
|
||||||
|
@ -21,33 +21,39 @@
|
|||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
{ This unit contains the CPU specific part of tprocinfo. }
|
{ This unit contains the CPU specific part of tprocinfo. }
|
||||||
unit cpupi;
|
unit cpupi;
|
||||||
{$INCLUDE fpcdefs.inc}
|
|
||||||
|
{$I fpcdefs.inc}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
uses
|
|
||||||
cutils,
|
uses
|
||||||
cgbase,cpuinfo;
|
cutils,
|
||||||
type
|
cgbase,cpuinfo,
|
||||||
TSparcProcInfo=class(TProcInfo)
|
psub;
|
||||||
{overall size of allocated stack space, currently this is used for the
|
|
||||||
PowerPC only}
|
type
|
||||||
LocalSize:aword;
|
TSparcProcInfo=class(tcgprocinfo)
|
||||||
{max of space need for parameters, currently used by the PowerPC port only}
|
{ overall size of allocated stack space, currently this is used for the
|
||||||
maxpushedparasize:aword;
|
PowerPC only }
|
||||||
constructor create(aparent:tprocinfo);override;
|
LocalSize:aword;
|
||||||
{According the the SPARC ABI the standard stack frame must include :
|
{max of space need for parameters, currently used by the PowerPC port only}
|
||||||
* 16 word save for the in and local registers in case of overflow/underflow.
|
maxpushedparasize:aword;
|
||||||
this save area always must exist at the %o6+0,
|
constructor create(aparent:tprocinfo);override;
|
||||||
* software conventions requires space for the aggregate return value pointer, even if the word is not used,
|
{ According the the SPARC ABI the standard stack frame must include :
|
||||||
* althogh the first six words of arguments reside in registers, the standard
|
* 16 word save for the in and local registers in case of overflow/underflow.
|
||||||
stack frame reserves space for them. Arguments beond the sixth reside on the
|
this save area always must exist at the %o6+0,
|
||||||
stack as in the Intel architecture,
|
* software conventions requires space for the aggregate return value pointer, even if the word is not used,
|
||||||
* other areas depend on the compiler and the code being compiled. The
|
* althogh the first six words of arguments reside in registers, the standard
|
||||||
standard calling sequence does not define a maximum stack frame size, nor does
|
stack frame reserves space for them. Arguments beond the sixth reside on the
|
||||||
it restrict how a language system uses the "unspecified" areas of the standard
|
stack as in the Intel architecture,
|
||||||
stack frame.}
|
* other areas depend on the compiler and the code being compiled. The
|
||||||
procedure after_header;override;
|
standard calling sequence does not define a maximum stack frame size, nor does
|
||||||
procedure after_pass1;override;
|
it restrict how a language system uses the "unspecified" areas of the standard
|
||||||
end;
|
stack frame.}
|
||||||
|
procedure after_header;override;
|
||||||
|
procedure after_pass1;override;
|
||||||
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
uses
|
uses
|
||||||
tgobj,paramgr,symsym,systems;
|
tgobj,paramgr,symsym,systems;
|
||||||
@ -95,7 +101,11 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.14 2003-04-27 11:21:36 peter
|
Revision 1.15 2003-05-23 22:33:48 florian
|
||||||
|
* fix some small flaws which prevent sparc linux system unit from compiling
|
||||||
|
* some reformatting done
|
||||||
|
|
||||||
|
Revision 1.14 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
|
||||||
|
@ -338,19 +338,22 @@ interface
|
|||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
|
|
||||||
const
|
const
|
||||||
asmmode_i386_direct_info : tasmmodeinfo =
|
asmmode_sparc_direct_info : tasmmodeinfo =
|
||||||
(
|
(
|
||||||
id : asmmode_direct;
|
id : asmmode_direct;
|
||||||
idtxt : 'DIRECT'
|
idtxt : 'DIRECT'
|
||||||
);
|
);
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterAsmMode(asmmode_i386_direct_info);
|
RegisterAsmMode(asmmode_sparc_direct_info);
|
||||||
|
|
||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.9 2003-05-23 21:10:50 florian
|
Revision 1.10 2003-05-23 22:33:48 florian
|
||||||
|
* fix some small flaws which prevent sparc linux system unit from compiling
|
||||||
|
* some reformatting done
|
||||||
|
|
||||||
|
Revision 1.9 2003/05/23 21:10:50 florian
|
||||||
* fixed sparc compiler compilation
|
* fixed sparc compiler compilation
|
||||||
|
|
||||||
Revision 1.8 2003/05/22 16:11:22 florian
|
Revision 1.8 2003/05/22 16:11:22 florian
|
||||||
|
Loading…
Reference in New Issue
Block a user