* the alpha compiler can be compiled now

This commit is contained in:
florian 1999-08-03 17:09:34 +00:00
parent b309bf03cc
commit 1cf1665d73
14 changed files with 131 additions and 48 deletions

View File

@ -150,6 +150,10 @@ begin
{$ifdef m68k} {$ifdef m68k}
target_m68k_Linux : target_m68k_Linux :
exportlib:=new(pexportlib,Init); exportlib:=new(pexportlib,Init);
{$endif m68k}
{$ifdef alpha}
target_m68k_Linux :
exportlib:=new(pexportlib,Init);
{$endif m68k} {$endif m68k}
else else
exportlib:=new(pexportlib,Init); exportlib:=new(pexportlib,Init);
@ -160,7 +164,10 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.4 1998-11-30 09:43:09 pierre Revision 1.5 1999-08-03 17:09:34 florian
* the alpha compiler can be compiled now
Revision 1.4 1998/11/30 09:43:09 pierre
* some range check bugs fixed (still not working !) * some range check bugs fixed (still not working !)
+ added DLL writing support for win32 (also accepts variables) + added DLL writing support for win32 (also accepts variables)
+ TempAnsi for code that could be used for Temporary ansi strings + TempAnsi for code that could be used for Temporary ansi strings

View File

@ -1165,31 +1165,27 @@ unit globals;
description:='Compiled by FPC '+version_string+' - '+target_cpu_string; description:='Compiled by FPC '+version_string+' - '+target_cpu_string;
{ Init values } { Init values }
{$ifdef i386} initmodeswitches:=fpcmodeswitches;
initoptprocessor:=Class386;
initlocalswitches:=[]; initlocalswitches:=[];
initmoduleswitches:=[cs_extsyntax,cs_browser]; initmoduleswitches:=[cs_extsyntax,cs_browser];
initglobalswitches:=[cs_check_unit_name,cs_link_static]; initglobalswitches:=[cs_check_unit_name,cs_link_static];
initmodeswitches:=fpcmodeswitches; {$ifdef i386}
initoptprocessor:=Class386;
initpackenum:=4; initpackenum:=4;
initpackrecords:=packrecord_2; initpackrecords:=packrecord_2;
initoutputformat:=target_asm.id; initoutputformat:=target_asm.id;
initasmmode:=asmmode_i386_att; initasmmode:=asmmode_i386_att;
initdefines.init;
{$else not i386} {$else not i386}
{$ifdef m68k} {$ifdef m68k}
initoptprocessor:=MC68000; initoptprocessor:=MC68000;
initlocalswitches:=[]; include(initmoduleswitches,cs_fp_emulation);
initmoduleswitches:=[cs_extsyntax,cs_browser,cs_fp_emulation];
initglobalswitches:=[cs_check_unit_name,cs_link_static];
initmodeswitches:=fpcmodeswitches;
initpackenum:=4; initpackenum:=4;
initpackrecords:=packrecord_2; initpackrecords:=packrecord_2;
initoutputformat:=as_m68k_as; initoutputformat:=as_m68k_as;
initasmmode:=asmmode_m68k_mot; initasmmode:=asmmode_m68k_mot;
initdefines.init;
{$endif m68k} {$endif m68k}
{$endif i386} {$endif i386}
initdefines.init;
{ memory sizes, will be overriden by parameter or default for target { memory sizes, will be overriden by parameter or default for target
in options or init_parser } in options or init_parser }
@ -1210,7 +1206,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.14 1999-07-23 16:05:19 peter Revision 1.15 1999-08-03 17:09:35 florian
* the alpha compiler can be compiled now
Revision 1.14 1999/07/23 16:05:19 peter
* alignment is now saved in the symtable * alignment is now saved in the symtable
* C alignment added for records * C alignment added for records
* PPU version increased to solve .12 <-> .13 probs * PPU version increased to solve .12 <-> .13 probs

View File

@ -90,13 +90,13 @@ Type
R_F30,R_F31); R_F30,R_F31);
TRegisterset = Set of TRegister; TRegisterset = Set of TRegister;
{ Constants describing the registers } { Constants describing the registers }
Const Const
Firstreg = R_0; Firstreg = R_0;
LastReg = R_F31; LastReg = R_F31;
stack_pointer = R_30; stack_pointer = R_30;
frame_pointer = R_15; frame_pointer = R_15;
self_pointer = R_16; self_pointer = R_16;
@ -167,8 +167,6 @@ Type
top_symbol : (sym:pasmsymbol;symofs:longint); top_symbol : (sym:pasmsymbol;symofs:longint);
end; end;
Const Const
{ offsets for the integer and floating point registers } { offsets for the integer and floating point registers }
INT_REG = 0; INT_REG = 0;
@ -178,7 +176,7 @@ Const
OQ_CHOPPED_ROUNDING = $01; { /C } OQ_CHOPPED_ROUNDING = $01; { /C }
OQ_ROUNDING_MODE_DYNAMIC = $02; { /D } OQ_ROUNDING_MODE_DYNAMIC = $02; { /D }
OQ_ROUND_TOWARD_MINUS_INFINITY = $04; { /M } OQ_ROUND_TOWARD_MINUS_INFINITY = $04; { /M }
OQ_INEXACT_RSULT_ENABLE = $08; { /I } OQ_INEXACT_RESULT_ENABLE = $08; { /I }
OQ_SOFTWARE_COMPLETION_ENABLE = $10; { /S } OQ_SOFTWARE_COMPLETION_ENABLE = $10; { /S }
OQ_FLOATING_UNDERFLOW_ENABLE = $20; { /U } OQ_FLOATING_UNDERFLOW_ENABLE = $20; { /U }
OQ_INTEGER_OVERFLOW_ENABLE = $40; { /V } OQ_INTEGER_OVERFLOW_ENABLE = $40; { /V }
@ -189,9 +187,23 @@ procedure reset_reference(var ref : treference);
function new_reference(base : tregister;offset : longint) : preference; function new_reference(base : tregister;offset : longint) : preference;
procedure disposereference(var r : preference); procedure disposereference(var r : preference);
function reg2str(r : tregister) : string;
implementation implementation
uses
verbose;
function reg2str(r : tregister) : string;
begin
if r in [R_0..R_31] then
reg2str:='R'+tostr(longint(r)-longint(R_0))
else if r in [R_F0..R_F31] then
reg2str:='F'+tostr(longint(r)-longint(R_F0))
else internalerror(38991);
end;
procedure reset_reference(var ref : treference); procedure reset_reference(var ref : treference);
begin begin
FillChar(ref,sizeof(treference),0); FillChar(ref,sizeof(treference),0);
@ -219,7 +231,10 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.4 1999-08-03 15:52:40 michael Revision 1.5 1999-08-03 17:09:48 florian
* the alpha compiler can be compiled now
Revision 1.4 1999/08/03 15:52:40 michael
* Additional changes * Additional changes
Revision 1.3 1999/08/03 00:35:54 michael Revision 1.3 1999/08/03 00:35:54 michael

View File

@ -4,7 +4,7 @@
Copyright (c) 1999 by the Free Pascal development team Copyright (c) 1999 by the Free Pascal development team
Basic Processor information Basic Processor information
See the file COPYING.FPC, included in this distribution, See the file COPYING.FPC, included in this distribution,
for details about the copyright. for details about the copyright.
@ -20,8 +20,12 @@ Interface
Type Type
{ Architecture word - Native unsigned type } { Architecture word - Native unsigned type }
{$ifdef FPC}
AWord = Qword; AWord = Qword;
{$else FPC}
AWord = Longint;
{$endif FPC}
Const Const
{ Size of native extended type } { Size of native extended type }
extended_size = 16; extended_size = 16;

View File

@ -48,8 +48,6 @@ unit tgcpu;
var var
tg : ttgobji386; tg : ttgobji386;
reg_pushes : array[R_EAX..R_MM6] of longint;
is_reg_var : array[R_EAX..R_MM6] of boolean;
implementation implementation
@ -74,7 +72,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.2 1999-08-02 23:13:24 florian Revision 1.3 1999-08-03 17:09:50 florian
* the alpha compiler can be compiled now
Revision 1.2 1999/08/02 23:13:24 florian
* more changes to compile for the Alpha * more changes to compile for the Alpha
Revision 1.1 1999/08/02 17:14:14 florian Revision 1.1 1999/08/02 17:14:14 florian

View File

@ -48,7 +48,6 @@ unit nmem;
uses uses
cobjects,aasm,cgbase,cgobj,types,verbose,tgobj,tgcpu cobjects,aasm,cgbase,cgobj,types,verbose,tgobj,tgcpu
{$I cpuunit.inc} {$I cpuunit.inc}
{$I tempgen.inc}
; ;
{**************************************************************************** {****************************************************************************
@ -131,6 +130,7 @@ unit nmem;
{$endif i386} {$endif i386}
else else
begin begin
{$ifdef i386}
symtabletype:=symtable^.symtabletype; symtabletype:=symtable^.symtabletype;
{ in case it is a register variable: } { in case it is a register variable: }
if pvarsym(symtableentry)^.reg<>R_NO then if pvarsym(symtableentry)^.reg<>R_NO then
@ -254,6 +254,7 @@ unit nmem;
reset_reference(location.reference); reset_reference(location.reference);
location.reference.base:=hregister; location.reference.base:=hregister;
end; end;
{$endif i386}
end; end;
end; end;
procsym: procsym:
@ -271,7 +272,10 @@ unit nmem;
end. end.
{ {
$Log$ $Log$
Revision 1.3 1999-08-02 17:14:08 florian Revision 1.4 1999-08-03 17:09:45 florian
* the alpha compiler can be compiled now
Revision 1.3 1999/08/02 17:14:08 florian
+ changed the temp. generator to an object + changed the temp. generator to an object
Revision 1.2 1999/08/01 18:22:35 florian Revision 1.2 1999/08/01 18:22:35 florian

View File

@ -391,15 +391,17 @@ implementation
include(tg.usedinproc,varregs[i]); include(tg.usedinproc,varregs[i]);
end; end;
nextreg: nextreg:
{$ifdef i386}
{ dummy } { dummy }
regsize:=S_W; regsize:=S_W;
{$endif i386}
end; end;
if (status.verbosity and v_debug)=v_debug then if (status.verbosity and v_debug)=v_debug then
begin begin
for i:=1 to maxvarregs do for i:=1 to maxvarregs do
begin begin
if assigned(regvars[i]) then if assigned(regvars[i]) then
Message3(cg_d_register_weight,reg2str(regvars[i]^.reg), Message3(cg_d_register_weight,reg2str(regvars[i]^.reg),
tostr(regvars[i]^.refs),regvars[i]^.name); tostr(regvars[i]^.refs),regvars[i]^.name);
end; end;
end; end;
@ -423,7 +425,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.3 1999-08-03 00:30:36 florian Revision 1.4 1999-08-03 17:09:46 florian
* the alpha compiler can be compiled now
Revision 1.3 1999/08/03 00:30:36 florian
* again a fix for the alpha * again a fix for the alpha
Revision 1.2 1999/08/03 00:28:03 florian Revision 1.2 1999/08/03 00:28:03 florian

View File

@ -25,5 +25,5 @@
{$ifdef i386} {$ifdef i386}
,tgeni386 ,tgeni386
{$else} {$else}
,tgencpu ,tgcpu
{$endif i386} {$endif i386}

View File

@ -964,12 +964,12 @@ begin
{$endif Delphi} {$endif Delphi}
{$ifdef i386} {$ifdef i386}
option:=new(poption386,Init); option:=new(poption386,Init);
{$else} {$endif}
{$ifdef m68k} {$ifdef m68k}
option:=new(poption68k,Init); option:=new(poption68k,Init);
{$else} {$endif}
option:=new(poption,Init); {$ifdef alpha}
{$endif} option:=new(poption,Init);
{$endif} {$endif}
{ Load messages } { Load messages }
if (cmd='') and (paramcount=0) then if (cmd='') and (paramcount=0) then
@ -999,6 +999,9 @@ begin
{$ifdef m68k} {$ifdef m68k}
def_symbol('CPU68'); def_symbol('CPU68');
{$endif} {$endif}
{$ifdef ALPHA}
def_symbol('ALPHA');
{$endif}
{ get default messagefile } { get default messagefile }
{$ifdef Delphi} {$ifdef Delphi}
@ -1016,8 +1019,12 @@ begin
begin begin
{$ifdef i386} {$ifdef i386}
ppccfg:='ppc386.cfg'; ppccfg:='ppc386.cfg';
{$else} {$endif i386}
{$ifdef m68k}
ppccfg:='ppc.cfg'; ppccfg:='ppc.cfg';
{$endif}
{$ifdef alpha}
ppccfg:='ppcalpha.cfg';
{$endif} {$endif}
end; end;
@ -1144,7 +1151,10 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.7 1999-08-02 23:13:19 florian Revision 1.8 1999-08-03 17:09:36 florian
* the alpha compiler can be compiled now
Revision 1.7 1999/08/02 23:13:19 florian
* more changes to compile for the Alpha * more changes to compile for the Alpha
Revision 1.6 1999/07/23 22:56:27 michael Revision 1.6 1999/07/23 22:56:27 michael

View File

@ -60,9 +60,7 @@ unit parser;
{$endif UseExcept} {$endif UseExcept}
{$ifdef newcg} {$ifdef newcg}
cgobj, cgobj,
{$ifdef i386}
cgcpu, cgcpu,
{$endif i386}
{$endif newcg} {$endif newcg}
comphook,tree,scanner,pbase,pdecl,psystem,pmodules,cresstr; comphook,tree,scanner,pbase,pdecl,psystem,pmodules,cresstr;
@ -298,6 +296,9 @@ unit parser;
{$ifdef i386} {$ifdef i386}
cg:=new(pcg386,init); cg:=new(pcg386,init);
{$endif i386} {$endif i386}
{$ifdef alpha}
cg:=new(pcgalpha,init);
{$endif alpha}
{$endif newcg} {$endif newcg}
{ If the compile level > 1 we get a nice "unit expected" error { If the compile level > 1 we get a nice "unit expected" error
@ -471,7 +472,10 @@ unit parser;
end. end.
{ {
$Log$ $Log$
Revision 1.79 1999-08-01 23:36:40 florian Revision 1.80 1999-08-03 17:09:37 florian
* the alpha compiler can be compiled now
Revision 1.79 1999/08/01 23:36:40 florian
* some changes to compile the new code generator * some changes to compile the new code generator
Revision 1.78 1999/07/24 16:22:18 michael Revision 1.78 1999/07/24 16:22:18 michael

View File

@ -44,6 +44,11 @@ unit pmodules;
{$ifdef m68k} {$ifdef m68k}
,m68k ,m68k
{$endif} {$endif}
{$ifdef newcg}
{$ifndef i386}
,cpubase
{$endif}
{$endif newcg}
,scanner,pbase,psystem,pdecl,psub,parser; ,scanner,pbase,psystem,pdecl,psub,parser;
@ -178,6 +183,10 @@ unit pmodules;
target_i386_OS2: target_i386_OS2:
; ;
{$endif i386} {$endif i386}
{$ifdef alpha}
target_alpha_linux:
;
{$endif alpha}
{$ifdef m68k} {$ifdef m68k}
target_m68k_Mac: target_m68k_Mac:
bsssegment^.concat(new(pai_datablock,init_global('HEAP',4))); bsssegment^.concat(new(pai_datablock,init_global('HEAP',4)));
@ -187,16 +196,15 @@ unit pmodules;
else else
bsssegment^.concat(new(pai_datablock,init_global('HEAP',heapsize))); bsssegment^.concat(new(pai_datablock,init_global('HEAP',heapsize)));
end; end;
{$ifdef i386}
datasegment^.concat(new(pai_symbol,initname_global('HEAPSIZE',4)));
datasegment^.concat(new(pai_const,init_32bit(heapsize)));
{$endif i386}
{$ifdef m68k} {$ifdef m68k}
if target_info.target<>target_m68k_PalmOS then if target_info.target<>target_m68k_PalmOS then
begin begin
datasegment^.concat(new(pai_symbol,init_global('HEAP_SIZE'))); datasegment^.concat(new(pai_symbol,init_global('HEAP_SIZE')));
datasegment^.concat(new(pai_const,init_32bit(heapsize))); datasegment^.concat(new(pai_const,init_32bit(heapsize)));
end; end;
{$else m68k}
datasegment^.concat(new(pai_symbol,initname_global('HEAPSIZE',4)));
datasegment^.concat(new(pai_const,init_32bit(heapsize)));
{$endif m68k} {$endif m68k}
end; end;
@ -204,6 +212,10 @@ unit pmodules;
procedure inserttargetspecific; procedure inserttargetspecific;
begin begin
case target_info.target of case target_info.target of
{$ifdef alpha}
target_alpha_linux:
;
{$endif alpha}
{$ifdef i386} {$ifdef i386}
target_i386_GO32V2 : target_i386_GO32V2 :
begin begin
@ -1352,7 +1364,10 @@ unit pmodules;
end. end.
{ {
$Log$ $Log$
Revision 1.136 1999-08-02 17:17:10 florian Revision 1.137 1999-08-03 17:09:38 florian
* the alpha compiler can be compiled now
Revision 1.136 1999/08/02 17:17:10 florian
* small changes for the new code generator * small changes for the new code generator
Revision 1.135 1999/07/29 20:54:04 peter Revision 1.135 1999/07/29 20:54:04 peter

View File

@ -62,6 +62,10 @@ unit pstatmnt;
,ra68kmot ,ra68kmot
{$endif NoRa68kMot} {$endif NoRa68kMot}
{$endif m68k} {$endif m68k}
{$ifdef alpha}
,cpubase,cpuasm
,tgeni386
{$endif alpha}
; ;
@ -1284,7 +1288,10 @@ unit pstatmnt;
end. end.
{ {
$Log$ $Log$
Revision 1.93 1999-08-02 21:28:59 florian Revision 1.94 1999-08-03 17:09:39 florian
* the alpha compiler can be compiled now
Revision 1.93 1999/08/02 21:28:59 florian
* the main branch psub.pas is now used for * the main branch psub.pas is now used for
newcg compiler newcg compiler

View File

@ -76,7 +76,10 @@ uses
{ parser specific stuff } { parser specific stuff }
,pbase,pdecl,pexpr,pstatmnt ,pbase,pdecl,pexpr,pstatmnt
{$ifdef newcg} {$ifdef newcg}
,tgcpu,convtree,cgobj ,tgcpu,convtree,cgobj,tgeni386 { for the new code generator tgeni386 is only a dummy }
{$ifndef i386}
,cpubase
{$endif i386}
{$endif newcg} {$endif newcg}
; ;
@ -1904,7 +1907,10 @@ end.
{ {
$Log$ $Log$
Revision 1.7 1999-08-02 21:29:01 florian Revision 1.8 1999-08-03 17:09:42 florian
* the alpha compiler can be compiled now
Revision 1.7 1999/08/02 21:29:01 florian
* the main branch psub.pas is now used for * the main branch psub.pas is now used for
newcg compiler newcg compiler

View File

@ -1613,6 +1613,9 @@ begin
{$endif atari} {$endif atari}
{$endif amiga} {$endif amiga}
{$endif m68k} {$endif m68k}
{$ifdef alpha}
default_os(target_alpha_linux);
{$endif i386}
end; end;
@ -1621,7 +1624,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.86 1999-08-03 15:52:00 michael Revision 1.87 1999-08-03 17:09:43 florian
* the alpha compiler can be compiled now
Revision 1.86 1999/08/03 15:52:00 michael
* changed shortname for linux alpha * changed shortname for linux alpha
Revision 1.85 1999/08/03 13:50:19 michael Revision 1.85 1999/08/03 13:50:19 michael