mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 18:29:27 +02:00
* fixed arm compilation
* cleaned up code generation for exported linux procedures
This commit is contained in:
parent
72d0c3e839
commit
10e765329d
@ -81,8 +81,6 @@ unit agarmgas;
|
||||
begin
|
||||
with ref do
|
||||
begin
|
||||
inc(offset,offsetfixup);
|
||||
|
||||
{$ifdef extdebug}
|
||||
// if base=NR_NO then
|
||||
// internalerror(200308292);
|
||||
@ -171,17 +169,18 @@ unit agarmgas;
|
||||
getopstr:=getopstr+'}';
|
||||
end;
|
||||
top_ref:
|
||||
getopstr:=getreferencestring(o.ref^);
|
||||
top_symbol:
|
||||
begin
|
||||
hs:=o.sym.name;
|
||||
if o.symofs>0 then
|
||||
hs:=hs+'+'+tostr(o.symofs)
|
||||
else
|
||||
if o.symofs<0 then
|
||||
hs:=hs+tostr(o.symofs);
|
||||
getopstr:=hs;
|
||||
end;
|
||||
if o.ref^.refaddr=addr_full then
|
||||
begin
|
||||
hs:=o.ref^.symbol.name;
|
||||
if o.ref^.offset>0 then
|
||||
hs:=hs+'+'+tostr(o.ref^.offset)
|
||||
else
|
||||
if o.ref^.offset<0 then
|
||||
hs:=hs+tostr(o.ref^.offset);
|
||||
getopstr:=hs;
|
||||
end
|
||||
else
|
||||
getopstr:=getreferencestring(o.ref^);
|
||||
else
|
||||
internalerror(2002070604);
|
||||
end;
|
||||
@ -236,7 +235,11 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.17 2003-11-30 19:35:29 florian
|
||||
Revision 1.18 2004-03-06 20:35:19 florian
|
||||
* fixed arm compilation
|
||||
* cleaned up code generation for exported linux procedures
|
||||
|
||||
Revision 1.17 2003/11/30 19:35:29 florian
|
||||
* fixed several arm related problems
|
||||
|
||||
Revision 1.16 2003/11/29 17:36:56 peter
|
||||
|
@ -73,6 +73,7 @@ unit cgcpu;
|
||||
l : tasmlabel);override;
|
||||
procedure a_cmp_reg_reg_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp;reg1,reg2 : tregister;l : tasmlabel); override;
|
||||
|
||||
procedure a_jmp_name(list : taasmoutput;const s : string); override;
|
||||
procedure a_jmp_always(list : taasmoutput;l: tasmlabel); override;
|
||||
procedure a_jmp_flags(list : taasmoutput;const f : TResFlags;l: tasmlabel); override;
|
||||
|
||||
@ -122,6 +123,7 @@ unit cgcpu;
|
||||
symconst,symdef,symsym,
|
||||
tgobj,
|
||||
procinfo,cpupi,
|
||||
cgutils,
|
||||
paramgr;
|
||||
|
||||
|
||||
@ -798,6 +800,12 @@ unit cgcpu;
|
||||
end;
|
||||
|
||||
|
||||
procedure tcgarm.a_jmp_name(list : taasmoutput;const s : string);
|
||||
begin
|
||||
list.concat(taicpu.op_sym(A_B,objectlibrary.newasmsymbol(s,AB_EXTERNAL,AT_FUNCTION)));
|
||||
end;
|
||||
|
||||
|
||||
procedure tcgarm.a_jmp_always(list : taasmoutput;l: tasmlabel);
|
||||
begin
|
||||
list.concat(taicpu.op_sym(A_B,objectlibrary.newasmsymbol(l.name,AB_EXTERNAL,AT_FUNCTION)));
|
||||
@ -1273,7 +1281,11 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.45 2004-03-02 00:36:33 olle
|
||||
Revision 1.46 2004-03-06 20:35:19 florian
|
||||
* fixed arm compilation
|
||||
* cleaned up code generation for exported linux procedures
|
||||
|
||||
Revision 1.45 2004/03/02 00:36:33 olle
|
||||
* big transformation of Tai_[const_]Symbol.Create[data]name*
|
||||
|
||||
Revision 1.44 2004/02/04 22:01:13 peter
|
||||
|
@ -213,11 +213,14 @@ unit cpubase;
|
||||
preference = ^treference;
|
||||
treference = record
|
||||
symbol : tasmsymbol;
|
||||
{ symbol the symbol of this reference is relative to, nil if none }
|
||||
relsymbol : tasmsymbol;
|
||||
offset : longint;
|
||||
offsetfixup : longint;
|
||||
base,
|
||||
index : tregister;
|
||||
symboldata : tlinkedlistitem;
|
||||
{ reference type addr or symbol itself }
|
||||
refaddr : trefaddr;
|
||||
signindex : shortint;
|
||||
shiftimm : byte;
|
||||
options : trefoptions;
|
||||
@ -258,6 +261,7 @@ unit cpubase;
|
||||
tparalocation = record
|
||||
size : TCGSize;
|
||||
loc : TCGLoc;
|
||||
lochigh : TCGLoc;
|
||||
alignment : byte;
|
||||
case TCGLoc of
|
||||
LOC_REFERENCE : (reference : tparareference);
|
||||
@ -566,7 +570,11 @@ unit cpubase;
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.26 2004-02-12 13:24:44 florian
|
||||
Revision 1.27 2004-03-06 20:35:19 florian
|
||||
* fixed arm compilation
|
||||
* cleaned up code generation for exported linux procedures
|
||||
|
||||
Revision 1.26 2004/02/12 13:24:44 florian
|
||||
* small compilation fix
|
||||
|
||||
Revision 1.25 2004/01/29 17:09:14 florian
|
||||
|
@ -23,7 +23,9 @@ Interface
|
||||
Type
|
||||
{ Architecture word - Native unsigned type }
|
||||
AWord = Longword;
|
||||
AInt = longint;
|
||||
PAWord = ^AWord;
|
||||
PAInt = ^AInt;
|
||||
|
||||
{ this must be an ordinal type with the same size as a pointer }
|
||||
{ to allow some dirty type casts for example when using }
|
||||
@ -112,7 +114,11 @@ Implementation
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.5 2003-12-01 18:43:32 peter
|
||||
Revision 1.6 2004-03-06 20:35:19 florian
|
||||
* fixed arm compilation
|
||||
* cleaned up code generation for exported linux procedures
|
||||
|
||||
Revision 1.5 2003/12/01 18:43:32 peter
|
||||
* s128real type is not compatible with s80real
|
||||
|
||||
Revision 1.4 2003/11/17 23:23:47 florian
|
||||
|
@ -34,8 +34,6 @@ unit cpupi;
|
||||
|
||||
type
|
||||
tarmprocinfo = class(tcgprocinfo)
|
||||
{ max. of space need for parameters, currently used by the PowerPC port only }
|
||||
maxpushedparasize : aword;
|
||||
constructor create(aparent:tprocinfo);override;
|
||||
// procedure handle_body_start;override;
|
||||
// procedure after_pass1;override;
|
||||
@ -137,7 +135,11 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.5 2003-12-03 17:39:05 florian
|
||||
Revision 1.6 2004-03-06 20:35:20 florian
|
||||
* fixed arm compilation
|
||||
* cleaned up code generation for exported linux procedures
|
||||
|
||||
Revision 1.5 2003/12/03 17:39:05 florian
|
||||
* fixed several arm calling conventions issues
|
||||
* fixed reference reading in the assembler reader
|
||||
* fixed a_loadaddr_ref_reg
|
||||
|
@ -48,7 +48,8 @@ unit rgcpu;
|
||||
implementation
|
||||
|
||||
uses
|
||||
cgobj, verbose, cutils,
|
||||
verbose, cutils,
|
||||
cgutils,cgobj,
|
||||
procinfo,
|
||||
aasmcpu;
|
||||
|
||||
@ -220,7 +221,11 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.8 2004-02-08 23:06:59 florian
|
||||
Revision 1.9 2004-03-06 20:35:20 florian
|
||||
* fixed arm compilation
|
||||
* cleaned up code generation for exported linux procedures
|
||||
|
||||
Revision 1.8 2004/02/08 23:06:59 florian
|
||||
* fixed compilation problem
|
||||
|
||||
Revision 1.7 2004/01/28 15:36:47 florian
|
||||
|
@ -278,6 +278,7 @@ unit cgobj;
|
||||
procedure a_cmp_ref_loc_label(list: taasmoutput; size: tcgsize;cmp_op: topcmp; const ref: treference; const loc: tlocation;
|
||||
l : tasmlabel);
|
||||
|
||||
procedure a_jmp_name(list : taasmoutput;const s : string); virtual; abstract;
|
||||
procedure a_jmp_always(list : taasmoutput;l: tasmlabel); virtual; abstract;
|
||||
procedure a_jmp_flags(list : taasmoutput;const f : TResFlags;l: tasmlabel); virtual; abstract;
|
||||
|
||||
@ -2109,7 +2110,11 @@ finalization
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.160 2004-03-02 00:36:33 olle
|
||||
Revision 1.161 2004-03-06 20:35:19 florian
|
||||
* fixed arm compilation
|
||||
* cleaned up code generation for exported linux procedures
|
||||
|
||||
Revision 1.160 2004/03/02 00:36:33 olle
|
||||
* big transformation of Tai_[const_]Symbol.Create[data]name*
|
||||
|
||||
Revision 1.159 2004/02/27 10:21:05 florian
|
||||
|
@ -133,7 +133,7 @@ implementation
|
||||
|
||||
uses
|
||||
cpuinfo,systems,
|
||||
cgobj,tgobj,
|
||||
cgutils,cgobj,tgobj,
|
||||
defutil,verbose;
|
||||
|
||||
{ true if uses a parameter as return value }
|
||||
@ -532,7 +532,11 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.71 2004-02-17 19:14:09 florian
|
||||
Revision 1.72 2004-03-06 20:35:19 florian
|
||||
* fixed arm compilation
|
||||
* cleaned up code generation for exported linux procedures
|
||||
|
||||
Revision 1.71 2004/02/17 19:14:09 florian
|
||||
* temp. fix for lochigh para
|
||||
|
||||
Revision 1.70 2004/02/09 22:48:45 florian
|
||||
|
@ -66,7 +66,7 @@ implementation
|
||||
verbose,systems,globtype,globals,
|
||||
symconst,script,
|
||||
fmodule,dos
|
||||
,aasmbase,aasmtai,aasmcpu,cpubase
|
||||
,aasmbase,aasmtai,aasmcpu,cpubase,cgobj
|
||||
,i_linux
|
||||
;
|
||||
|
||||
@ -175,31 +175,11 @@ begin
|
||||
is declared with cdecl }
|
||||
if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
|
||||
begin
|
||||
{$ifdef i386}
|
||||
{ place jump in codesegment }
|
||||
codesegment.concat(Tai_align.Create_op(4,$90));
|
||||
codesegment.concat(tai_align.create(target_info.alignment.procalign));
|
||||
codeSegment.concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
|
||||
codeSegment.concat(Taicpu.Op_sym(A_JMP,S_NO,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
|
||||
cg.a_jmp_name(codesegment,tprocsym(hp2.sym).first_procdef.mangledname);
|
||||
codeSegment.concat(Tai_symbol_end.Createname(hp2.name^));
|
||||
{$else i386}
|
||||
{$ifdef m68k}
|
||||
{ place jump in codesegment }
|
||||
codesegment.concat(tai_align.create(4));
|
||||
codesegment.concat(tai_symbol.createname_global(hp2.name^,AT_FUNCTION,0));
|
||||
codesegment.concat(taicpu.op_sym(A_JMP,S_NO,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
|
||||
codesegment.concat(tai_symbol_end.createname(hp2.name^));
|
||||
{$else m68k}
|
||||
{$ifdef powerpc}
|
||||
{ place jump in codesegment }
|
||||
codesegment.concat(tai_align.create(4));
|
||||
codesegment.concat(tai_symbol.createname_global(hp2.name^,AT_FUNCTION,0));
|
||||
codesegment.concat(taicpu.op_sym(A_B,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
|
||||
codesegment.concat(tai_symbol_end.createname(hp2.name^));
|
||||
{$else powerpc}
|
||||
{$error Exportliblinux.generatelib not yet implemented for target processor}
|
||||
{$endif powerpc}
|
||||
{$endif m68k}
|
||||
{$endif i386}
|
||||
end;
|
||||
end
|
||||
else
|
||||
@ -578,7 +558,11 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.16 2004-03-04 16:32:59 peter
|
||||
Revision 1.17 2004-03-06 20:35:20 florian
|
||||
* fixed arm compilation
|
||||
* cleaned up code generation for exported linux procedures
|
||||
|
||||
Revision 1.16 2004/03/04 16:32:59 peter
|
||||
* misplaced $Ifdef
|
||||
|
||||
Revision 1.15 2004/03/02 00:36:33 olle
|
||||
|
@ -103,6 +103,7 @@ unit cgx86;
|
||||
procedure a_cmp_reg_reg_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp;reg1,reg2 : tregister;l : tasmlabel); override;
|
||||
procedure a_cmp_ref_reg_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp;const ref: treference; reg : tregister; l : tasmlabel); override;
|
||||
|
||||
procedure a_jmp_name(list : taasmoutput;const s : string);override;
|
||||
procedure a_jmp_always(list : taasmoutput;l: tasmlabel); override;
|
||||
procedure a_jmp_flags(list : taasmoutput;const f : TResFlags;l: tasmlabel); override;
|
||||
|
||||
@ -426,6 +427,12 @@ unit cgx86;
|
||||
Assembler code
|
||||
****************************************************************************}
|
||||
|
||||
procedure tcgx86.a_jmp_name(list : taasmoutput;const s : string);
|
||||
begin
|
||||
list.concat(taicpu.op_sym(A_JMP,S_NO,objectlibrary.newasmsymbol(s,AB_EXTERNAL,AT_FUNCTION)));
|
||||
end;
|
||||
|
||||
|
||||
{ currently does nothing }
|
||||
procedure tcgx86.a_jmp_always(list : taasmoutput;l: tasmlabel);
|
||||
begin
|
||||
@ -1781,7 +1788,11 @@ unit cgx86;
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.116 2004-03-02 00:36:33 olle
|
||||
Revision 1.117 2004-03-06 20:35:20 florian
|
||||
* fixed arm compilation
|
||||
* cleaned up code generation for exported linux procedures
|
||||
|
||||
Revision 1.116 2004/03/02 00:36:33 olle
|
||||
* big transformation of Tai_[const_]Symbol.Create[data]name*
|
||||
|
||||
Revision 1.115 2004/02/27 10:21:06 florian
|
||||
|
Loading…
Reference in New Issue
Block a user