michael vor 26 Jahren
Ursprung
Commit
de05bb1a56
4 geänderte Dateien mit 123 neuen und 570 gelöschten Zeilen
  1. 11 510
      compiler/new/alpha/agas.pas
  2. 35 23
      compiler/new/alpha/cgcpu.pas
  3. 68 34
      compiler/new/alpha/cpuasm.pas
  4. 9 3
      compiler/new/alpha/cpubase.pas

+ 11 - 510
compiler/new/alpha/agas.pas

@@ -25,20 +25,13 @@ unit agas;
   interface
 
     uses
-       dos,globals,systems,errors,cobjects,aasm,alpha,strings,files
-{$ifdef GDB}
-       ,gdb
-{$endif GDB}
-       ;
+       globals,systems,cobjects,aasm,strings,files
+       agatt,cpubase;
 
     type
       palphaattasmlist=^talphaattasmlist;
-      talphaattasmlist=object(tasmlist)
-        procedure WriteTree(p:paasmoutput);virtual;
-        procedure WriteAsmList;virtual;
-{$ifdef GDB}
-        procedure WriteFileLineInfo(var fileinfo : tfileposinfo);
-{$endif}
+      talphaattasmlist=object(tattasmlist)
+        procedure WriteInstruction(P : PAI);virtual;
       end;
 
   implementation
@@ -79,361 +72,9 @@ unit agas;
           'subq','subs','subt','trapb','umulh','unpkbl',
           'unpkbw','wh64','wmb','xor','zap','zapnot');
 
-{$ifdef GDB}
-      procedure talphaattasmlist.WriteFileLineInfo(var fileinfo : tfileposinfo);
-        var
-          curr_n : byte;
+      procedure tAlphaattasmlist.WriteInstruction (P : PAi);
         begin
-          if not (cs_debuginfo in aktmoduleswitches) then
-           exit;
-        { file changed ? (must be before line info) }
-          if (fileinfo.fileindex<>0) and
-             (stabslastfileinfo.fileindex<>fileinfo.fileindex) then
-           begin
-             infile:=current_module^.sourcefiles^.get_file(fileinfo.fileindex);
-             if includecount=0 then
-              curr_n:=n_sourcefile
-             else
-              curr_n:=n_includefile;
-             if (infile^.path^<>'') then
-              begin
-                AsmWriteLn(#9'.stabs "'+lower(BsToSlash(FixPath(infile^.path^,false)))+'",'+
-                  tostr(curr_n)+',0,0,'+'Ltext'+ToStr(IncludeCount));
-              end;
-             AsmWriteLn(#9'.stabs "'+lower(FixFileName(infile^.name^))+'",'+
-               tostr(curr_n)+',0,0,'+'Ltext'+ToStr(IncludeCount));
-             AsmWriteLn('Ltext'+ToStr(IncludeCount)+':');
-             inc(includecount);
-           end;
-        { line changed ? }
-          if (stabslastfileinfo.line<>fileinfo.line) and (fileinfo.line<>0) then
-           begin
-             if (n_line=n_textline) and assigned(funcname) and
-                (target_os.use_function_relative_addresses) then
-              begin
-                AsmWriteLn(target_asm.labelprefix+'l'+tostr(linecount)+':');
-                AsmWrite(#9'.stabn '+tostr(n_line)+',0,'+tostr(fileinfo.line)+','+
-                           target_asm.labelprefix+'l'+tostr(linecount)+' - ');
-                AsmWritePChar(FuncName);
-                AsmLn;
-                inc(linecount);
-              end
-             else
-              AsmWriteLn(#9'.stabd'#9+tostr(n_line)+',0,'+tostr(fileinfo.line));
-           end;
-          stabslastfileinfo:=fileinfo;
-        end;
-{$endif GDB}
-
-    procedure talphaattasmlist.WriteTree(p:paasmoutput);
-    const
-      allocstr : array[boolean] of string[10]=(' released',' allocated');
-    type
-      t64bitarray = array[0..7] of byte;
-      t32bitarray = array[0..3] of byte;
-    var
-      ch       : char;
-      hp       : pai;
-      consttyp : tait;
-      s        : string;
-      found    : boolean;
-      i,pos,l  : longint;
-      co       : comp;
-      sin      : single;
-      d        : double;
-      e        : extended;
-      op       : tasmop;
-      calljmp,
-      do_line  : boolean;
-      sep      : char;
-    begin
-      if not assigned(p) then
-       exit;
-      do_line:=(cs_debuginfo in aktmoduleswitches) or (cs_asm_source in aktglobalswitches);
-      hp:=pai(p^.first);
-      while assigned(hp) do
-       begin
-         aktfilepos:=hp^.fileinfo;
-         if do_line then
-          begin
-          { I think it is better to write stabs before source line PM }
-{$ifdef GDB}
-          { write stabs }
-            if cs_debuginfo in aktmoduleswitches then
-             begin
-               if not (hp^.typ in  [
-                      ait_label,
-                      ait_regalloc,ait_tempalloc,
-                      ait_stabn,ait_stabs,ait_section,
-                      ait_cut,ait_marker,ait_align,ait_stab_function_name]) then
-                 begin
-                    WriteFileLineInfo(hp^.fileinfo);
-                 end;
-             end;
-{$endif GDB}
-          { load infile }
-            if lastfileinfo.fileindex<>hp^.fileinfo.fileindex then
-             begin
-               infile:=current_module^.sourcefiles^.get_file(hp^.fileinfo.fileindex);
-               { open only if needed !! }
-               if (cs_asm_source in aktglobalswitches) then
-                 infile^.open;
-               { avoid unnecessary reopens of the same file !! }
-               lastfileinfo.fileindex:=hp^.fileinfo.fileindex;
-               { be sure to change line !! }
-               lastfileinfo.line:=-1;
-             end;
-          { write source }
-            if (cs_asm_source in aktglobalswitches) and
-                not (hp^.typ in  [
-                      ait_label,
-                      ait_stabn,ait_stabs,ait_section,
-                      ait_cut,ait_align,ait_stab_function_name]) then
-             begin
-               if (infile<>lastinfile) and assigned(lastinfile) then
-                 begin
-                   AsmWriteLn(target_asm.comment+'['+infile^.name^+']');
-                   lastinfile^.close;
-                 end;
-               if (hp^.fileinfo.line<>lastfileinfo.line) and
-                  (hp^.fileinfo.line<infile^.maxlinebuf) then
-                 begin
-                   if (hp^.fileinfo.line<>0) and
-                      (infile^.linebuf^[hp^.fileinfo.line]>=0) then
-                     AsmWriteLn(target_asm.comment+'['+tostr(hp^.fileinfo.line)+'] '+
-                       fixline(infile^.GetLineStr(hp^.fileinfo.line)));
-                   { set it to a negative value !
-                   to make that is has been read already !! PM }
-                   infile^.linebuf^[hp^.fileinfo.line]:=-infile^.linebuf^[hp^.fileinfo.line]-1;
-                end;
-               lastfileinfo:=hp^.fileinfo;
-               lastinfile:=infile;
-             end;
-          end;
-
-         case hp^.typ of
-
-           ait_comment :
-             Begin
-               AsmWrite(target_asm.comment);
-               AsmWritePChar(pai_asm_comment(hp)^.str);
-               AsmLn;
-             End;
-
-           ait_regalloc :
-             begin
-               if (cs_asm_regalloc in aktglobalswitches) then
-                 AsmWriteLn(target_asm.comment+'Register '+att_reg2str[pairegalloc(hp)^.reg]+
-                   allocstr[pairegalloc(hp)^.allocation]);
-             end;
-
-           ait_tempalloc :
-             begin
-               if (cs_asm_tempalloc in aktglobalswitches) then
-                 AsmWriteLn(target_asm.comment+'Temp '+tostr(paitempalloc(hp)^.temppos)+','+
-                   tostr(paitempalloc(hp)^.tempsize)+allocstr[paitempalloc(hp)^.allocation]);
-             end;
-
-           ait_align :
-             begin
-               AsmWrite(#9'.balign '+tostr(pai_align(hp)^.aligntype));
-               if pai_align(hp)^.use_op then
-                AsmWrite(','+tostr(pai_align(hp)^.fillop));
-               AsmLn;
-             end;
-
-           ait_section :
-             begin
-               if pai_section(hp)^.sec<>sec_none then
-                begin
-                  AsmLn;
-                  AsmWriteLn(ait_section2str(pai_section(hp)^.sec));
-{$ifdef GDB}
-                  lastfileinfo.line:=-1;
-{$endif GDB}
-                end;
-             end;
-
-           ait_datablock :
-             begin
-               if pai_datablock(hp)^.is_global then
-                AsmWrite(#9'.comm'#9)
-               else
-                AsmWrite(#9'.lcomm'#9);
-               AsmWrite(pai_datablock(hp)^.sym^.name);
-               AsmWriteLn(','+tostr(pai_datablock(hp)^.size));
-             end;
-
-           ait_const_32bit,
-           ait_const_16bit,
-           ait_const_8bit :
-             begin
-               AsmWrite(ait_const2str[hp^.typ]+tostr(pai_const(hp)^.value));
-               consttyp:=hp^.typ;
-               l:=0;
-               repeat
-                 found:=(not (Pai(hp^.next)=nil)) and (Pai(hp^.next)^.typ=consttyp);
-                 if found then
-                  begin
-                    hp:=Pai(hp^.next);
-                    s:=','+tostr(pai_const(hp)^.value);
-                    AsmWrite(s);
-                    inc(l,length(s));
-                  end;
-               until (not found) or (l>line_length);
-               AsmLn;
-             end;
-
-           ait_const_symbol :
-             begin
-               AsmWrite(#9'.long'#9+pai_const_symbol(hp)^.sym^.name);
-               if pai_const_symbol(hp)^.offset>0 then
-                 AsmWrite('+'+tostr(pai_const_symbol(hp)^.offset))
-               else if pai_const_symbol(hp)^.offset<0 then
-                 AsmWrite(tostr(pai_const_symbol(hp)^.offset));
-               AsmLn;
-             end;
-
-           ait_const_rva :
-             AsmWriteLn(#9'.rva'#9+pai_const_symbol(hp)^.sym^.name);
-
-           ait_real_64bit :
-             begin
-               if do_line then
-                AsmWriteLn(target_asm.comment+double2str(pai_real_64bit(hp)^.value));
-               d:=pai_real_64bit(hp)^.value;
-               AsmWrite(#9'.byte'#9);
-               for i:=0 to 7 do
-                begin
-                  if i<>0 then
-                   AsmWrite(',');
-                  AsmWrite(tostr(t64bitarray(d)[i]));
-                end;
-               AsmLn;
-             end;
-
-           ait_real_32bit :
-             begin
-               if do_line then
-                AsmWriteLn(target_asm.comment+single2str(pai_real_32bit(hp)^.value));
-               sin:=pai_real_32bit(hp)^.value;
-               AsmWrite(#9'.byte'#9);
-               for i:=0 to 3 do
-                begin
-                  if i<>0 then
-                   AsmWrite(',');
-                  AsmWrite(tostr(t32bitarray(sin)[i]));
-                end;
-               AsmLn;
-             end;
-
-           ait_comp_64bit :
-             begin
-               if do_line then
-                AsmWriteLn(target_asm.comment+comp2str(pai_comp_64bit(hp)^.value));
-               AsmWrite(#9'.byte'#9);
-{$ifdef FPC}
-               co:=comp(pai_comp_64bit(hp)^.value);
-{$else}
-               co:=pai_comp_64bit(hp)^.value;
-{$endif}
-               for i:=0 to 7 do
-                begin
-                  if i<>0 then
-                   AsmWrite(',');
-                  AsmWrite(tostr(t64bitarray(co)[i]));
-                end;
-               AsmLn;
-             end;
-
-           ait_direct :
-             begin
-               AsmWritePChar(pai_direct(hp)^.str);
-               AsmLn;
-{$IfDef GDB}
-               if strpos(pai_direct(hp)^.str,'.data')<>nil then
-                 n_line:=n_dataline
-               else if strpos(pai_direct(hp)^.str,'.text')<>nil then
-                 n_line:=n_textline
-               else if strpos(pai_direct(hp)^.str,'.bss')<>nil then
-                 n_line:=n_bssline;
-{$endif GDB}
-             end;
-
-           ait_string :
-             begin
-               pos:=0;
-               for i:=1 to pai_string(hp)^.len do
-                begin
-                  if pos=0 then
-                   begin
-                     AsmWrite(#9'.ascii'#9'"');
-                     pos:=20;
-                   end;
-                  ch:=pai_string(hp)^.str[i-1];
-                  case ch of
-                     #0, {This can't be done by range, because a bug in FPC}
-                #1..#31,
-             #128..#255 : s:='\'+tostr(ord(ch) shr 6)+tostr((ord(ch) and 63) shr 3)+tostr(ord(ch) and 7);
-                    '"' : s:='\"';
-                    '\' : s:='\\';
-                  else
-                   s:=ch;
-                  end;
-                  AsmWrite(s);
-                  inc(pos,length(s));
-                  if (pos>line_length) or (i=pai_string(hp)^.len) then
-                   begin
-                     AsmWriteLn('"');
-                     pos:=0;
-                   end;
-                end;
-             end;
-
-           ait_label :
-             begin
-               if (pai_label(hp)^.l^.is_used) then
-                begin
-                  if pai_label(hp)^.l^.typ=AS_GLOBAL then
-                    AsmWriteLn('.globl'#9+pai_label(hp)^.l^.name);
-                  AsmWriteLn(pai_label(hp)^.l^.name+':');
-                end;
-             end;
-
-           ait_symbol :
-             begin
-               if pai_symbol(hp)^.is_global then
-                AsmWriteLn('.globl'#9+pai_symbol(hp)^.sym^.name);
-               if target_info.target=target_i386_linux then
-                begin
-                   AsmWrite(#9'.type'#9+pai_symbol(hp)^.sym^.name);
-                   if assigned(pai(hp^.next)) and
-                      (pai(hp^.next)^.typ in [ait_const_symbol,ait_const_rva,
-                         ait_const_32bit,ait_const_16bit,ait_const_8bit,ait_datablock,
-                         ait_real_32bit,ait_real_64bit,ait_real_80bit,ait_comp_64bit]) then
-                    AsmWriteLn(',@object')
-                   else
-                    AsmWriteLn(',@function');
-                   if pai_symbol(hp)^.sym^.size>0 then
-                    AsmWriteLn(#9'.size'#9+pai_symbol(hp)^.sym^.name+', '+tostr(pai_symbol(hp)^.sym^.size));
-                end;
-               AsmWriteLn(pai_symbol(hp)^.sym^.name+':');
-             end;
-
-           ait_symbol_end :
-             begin
-               if target_info.target=target_i386_linux then
-                begin
-                  s:=target_asm.labelprefix+'e'+tostr(symendcount);
-                  inc(symendcount);
-                  AsmWriteLn(s+':');
-                  AsmWriteLn(#9'.size'#9+pai_symbol(hp)^.sym^.name+', '+s+' - '+pai_symbol(hp)^.sym^.name);
-                end;
-             end;
-
-           ait_instruction :
-             begin
-
+(*
                op:=pai386(hp)^.opcode;
                calljmp:=is_calljmp(op);
              { call maybe not translated to calll }
@@ -465,154 +106,14 @@ unit agas;
                    end;
                 end;
                AsmWriteLn(s);
+*)
              end;
 
-{$ifdef GDB}
-           ait_stabs :
-             begin
-               AsmWrite(#9'.stabs ');
-               AsmWritePChar(pai_stabs(hp)^.str);
-               AsmLn;
-             end;
-
-           ait_stabn :
-             begin
-               AsmWrite(#9'.stabn ');
-               AsmWritePChar(pai_stabn(hp)^.str);
-               AsmLn;
-             end;
-
-           ait_force_line :
-             stabslastfileinfo.line:=0;
-
-           ait_stab_function_name:
-             funcname:=pai_stab_function_name(hp)^.str;
-{$endif GDB}
-
-           ait_cut :
-             begin
-               if SmartAsm then
-                begin
-                { only reset buffer if nothing has changed }
-                  if AsmSize=AsmStartSize then
-                   AsmClear
-                  else
-                   begin
-                     AsmClose;
-                     DoAssemble;
-                     if pai_cut(hp)^.EndName then
-                      IsEndFile:=true;
-                     AsmCreate;
-                   end;
-                { avoid empty files }
-                  while assigned(hp^.next) and (pai(hp^.next)^.typ in [ait_cut,ait_section,ait_comment]) do
-                   begin
-                     if pai(hp^.next)^.typ=ait_section then
-                       lastsec:=pai_section(hp^.next)^.sec;
-                     hp:=pai(hp^.next);
-                   end;
-{$ifdef GDB}
-                  { force write of filename }
-                  FillChar(stabslastfileinfo,sizeof(stabslastfileinfo),0);
-                  includecount:=0;
-                  funcname:=nil;
-                  WriteFileLineInfo(hp^.fileinfo);
-{$endif GDB}
-                  if lastsec<>sec_none then
-                    AsmWriteLn(ait_section2str(lastsec));
-                  AsmStartSize:=AsmSize;
-                end;
-             end;
-
-           ait_marker :
-             ;
-
-           else
-             internalerror(10000);
-         end;
-         hp:=pai(hp^.next);
-       end;
-    end;
-
-
-    procedure talphaattasmlist.WriteAsmList;
-    var
-      p:dirstr;
-      n:namestr;
-      e:extstr;
-{$ifdef GDB}
-      fileinfo : tfileposinfo;
-{$endif GDB}
-
-    begin
-{$ifdef EXTDEBUG}
-      if assigned(current_module^.mainsource) then
-       Comment(v_info,'Start writing att-styled assembler output for '+current_module^.mainsource^);
-{$endif}
-
-      LastSec:=sec_none;
-{$ifdef GDB}
-      FillChar(stabslastfileinfo,sizeof(stabslastfileinfo),0);
-{$endif GDB}
-      FillChar(lastfileinfo,sizeof(lastfileinfo),0);
-      LastInfile:=nil;
-
-      if assigned(current_module^.mainsource) then
-       fsplit(current_module^.mainsource^,p,n,e)
-      else
-       begin
-         p:=inputdir;
-         n:=inputfile;
-         e:=inputextension;
-       end;
-    { to get symify to work }
-      AsmWriteLn(#9'.file "'+FixFileName(n+e)+'"');
-
-{$ifdef GDB}
-      n_line:=n_bssline;
-      funcname:=nil;
-      linecount:=1;
-      includecount:=0;
-      fileinfo.fileindex:=1;
-      fileinfo.line:=1;
-      { Write main file }
-      WriteFileLineInfo(fileinfo);
-{$endif GDB}
-      AsmStartSize:=AsmSize;
-      symendcount:=0;
-
-      countlabelref:=false;
-      If (cs_debuginfo in aktmoduleswitches) then
-        WriteTree(debuglist);
-      WriteTree(codesegment);
-      WriteTree(datasegment);
-      WriteTree(consts);
-      WriteTree(rttilist);
-      Writetree(resourcestringlist);
-      WriteTree(bsssegment);
-      Writetree(importssection);
-      Writetree(exportssection);
-      Writetree(resourcesection);
-      countlabelref:=true;
-
-      AsmLn;
-{$ifdef EXTDEBUG}
-      if assigned(current_module^.mainsource) then
-       comment(v_info,'Done writing att-styled assembler output for '+current_module^.mainsource^);
-{$endif EXTDEBUG}
-    end;
-
-
 end.
+
 {
   $Log$
-  Revision 1.2  1999-08-03 13:20:53  florian
-    * initial revision for the alpha
-
-  Revision 1.1  1999/08/02 23:19:53  michael
-  Initial implementation
+  Revision 1.3  1999-08-05 15:50:31  michael
+  * more changes
 
-  Revision 1.2  1998/09/09 20:14:01  peter
-    - dup files already used elsewhere
-
-}
+}

+ 35 - 23
compiler/new/alpha/cgcpu.pas

@@ -41,6 +41,9 @@ unit cgcpu;
           procedure a_load_const64_ref(list : paasmoutput;q : qword;const ref : treference);virtual;
 
           procedure g_stackframe_entry(list : paasmoutput;localsize : longint);virtual;
+          procedure g_exite_entry(list : paasmoutput;localsize : longint);virtual;
+          procedure g_exitcode(list : paasmoutput;parasize : longint;
+            nostackframe,inlined : boolean);
           constructor init;
        end;
 
@@ -57,28 +60,34 @@ unit cgcpu;
 
     procedure tcgalpha.g_stackframe_entry(list : paasmoutput;localsize : longint);
 
-      begin
-         {
-         if localsize<>0 then
-           begin
-              if (cs_littlesize in aktglobalswitches) and (localsize<=65535) then
-                list^.insert(new(pai386,op_const_const(A_ENTER,S_NO,localsize,0)))
-              else
-                begin
-                   list^.concat(new(pai386,op_reg(A_PUSH,S_L,R_EBP)));
-                   list^.concat(new(pai386,op_reg_reg(A_MOV,S_L,R_ESP,R_EBP)));
-                   list^.concat(new(pai386,op_const_reg(A_SUB,S_L,localsize,R_ESP)));
-                end;
-             end
-         else
-           begin
-              list^.concat(new(pai386,op_reg(A_PUSH,S_L,R_EBP)));
-              list^.concat(new(pai386,op_reg_reg(A_MOV,S_L,R_ESP,R_EBP)));
-           end;
-         }
-         abstract;
-       end;
-
+    begin
+      With List^ do 
+        begin
+        concat(new(paialpha,op_reg_ref(A_LDGP,Global_pointer,new_reference(R_27,0)));
+        concat(new(paialpha,op_reg_ref(A_LDA,Stack_Pointer,new_reference(Stack_pointer,-LocalSize))));
+        If LocalSize<>0 then
+          concat(new(paiframe,Init(Global_pinter,LocalSize,R27,0)));
+        // Always generate a frame pointer.
+        concat(new(paiframe,op_reg_reg_reg(A_BIS,Stackpointer,Stack_pointer,Frame_pointer)))
+        end;
+    end;
+
+    procedure g_exitcode(list : paasmoutput;parasize : longint; nostackframe,inlined : boolean);
+ 
+    begin
+      With List^ do
+        begin
+        // Restore stack pointer from frame pointer
+        Concat (new(paialpha,op_reg_reg_reg(A_BIS,Frame_Pointer,Frame_Pointer,Stack_Pointer)));
+        // Restore previous stack position
+        Concat (new(paialpha,op_reg_const_reg(A_ADDQ,Stack_Pointer,Parasize,Stack_pointer)));
+        // return...
+        Concat (new(paialpha,op_reg_ref_const(A_RET,Stack_pointer,new_reference(Return_pointer,0),1)));
+        // end directive
+        Concat (new(paiend,init(''));
+        end;
+    end;
+    
      procedure tcgalpha.a_call_name(list : paasmoutput;const s : string;
        offset : longint);
 
@@ -122,7 +131,10 @@ unit cgcpu;
 end.
 {
   $Log$
-  Revision 1.2  1999-08-04 00:24:00  florian
+  Revision 1.3  1999-08-05 15:50:32  michael
+  * more changes
+
+  Revision 1.2  1999/08/04 00:24:00  florian
     * renamed i386asm and i386base to cpuasm and cpubase
 
   Revision 1.1  1999/08/03 22:39:46  florian

+ 68 - 34
compiler/new/alpha/cpuasm.pas

@@ -38,8 +38,22 @@ type
      constructor dealloc(r : tregister);
   end;
 
-  paalpha = ^taalpha;
-  taalpha = object(tai)
+  paiframe = ^taiframe;
+  taiframe = object(tai)
+     G,R : TRegister;
+     LS,LU : longint;
+    Constructor init (GP : Tregister; Localsize : Longint; RA : TRegister; L : longint);
+    end;
+    
+  paient = ^taient;
+  taient = object(tai)
+    Name : string;
+    Constructor Init (ProcName : String);
+    end;
+     
+
+  paialpha = ^taialpha;
+  taialpha = object(tai)
      is_jmp    : boolean; { is this instruction a jump? (needed for optimizer) }
      opcode    : tasmop;
      ops       : longint;
@@ -86,8 +100,6 @@ type
 
 
 implementation
-uses
-  og386;
 
 {*****************************************************************************
                                  TaiRegAlloc
@@ -112,10 +124,10 @@ uses
 
 
 {*****************************************************************************
-                                 Taalpha Constructors
+                                 taialpha Constructors
 *****************************************************************************}
 
-    procedure taalpha.init(op : tasmop);
+    procedure taialpha.init(op : tasmop);
       begin
          typ:=ait_instruction;
          is_jmp:=false;
@@ -126,14 +138,14 @@ uses
          fillchar(oper,sizeof(oper),0);
       end;
 
-    constructor taalpha.op_none(op : tasmop);
+    constructor taialpha.op_none(op : tasmop);
       begin
          inherited init;
          init(op);
       end;
 
 
-    constructor taalpha.op_reg(op : tasmop;_op1 : tregister);
+    constructor taialpha.op_reg(op : tasmop;_op1 : tregister);
       begin
          inherited init;
          init(op);
@@ -141,7 +153,7 @@ uses
       end;
 
 
-    constructor taalpha.op_const(op : tasmop;_op1 : longint);
+    constructor taialpha.op_const(op : tasmop;_op1 : longint);
       begin
          inherited init;
          init(op);
@@ -149,7 +161,7 @@ uses
       end;
 
 
-    constructor taalpha.op_ref(op : tasmop;_op1 : preference);
+    constructor taialpha.op_ref(op : tasmop;_op1 : preference);
       begin
          inherited init;
          init(op);
@@ -157,7 +169,7 @@ uses
       end;
 
 
-    constructor taalpha.op_reg_reg(op : tasmop;_op1,_op2 : tregister);
+    constructor taialpha.op_reg_reg(op : tasmop;_op1,_op2 : tregister);
       begin
          inherited init;
          init(op);
@@ -165,7 +177,7 @@ uses
       end;
 
 
-    constructor taalpha.op_reg_const(op:tasmop; _op1: tregister; _op2: longint);
+    constructor taialpha.op_reg_const(op:tasmop; _op1: tregister; _op2: longint);
       begin
          inherited init;
          init(op);
@@ -173,7 +185,7 @@ uses
       end;
 
 
-    constructor taalpha.op_reg_ref(op : tasmop;_op1 : tregister;_op2 : preference);
+    constructor taialpha.op_reg_ref(op : tasmop;_op1 : tregister;_op2 : preference);
       begin
          inherited init;
          init(op);
@@ -181,7 +193,7 @@ uses
       end;
 
 
-    constructor taalpha.op_const_reg(op : tasmop;_op1 : longint;_op2 : tregister);
+    constructor taialpha.op_const_reg(op : tasmop;_op1 : longint;_op2 : tregister);
       begin
          inherited init;
          init(op);
@@ -189,7 +201,7 @@ uses
       end;
 
 
-    constructor taalpha.op_const_const(op : tasmop;_op1,_op2 : longint);
+    constructor taialpha.op_const_const(op : tasmop;_op1,_op2 : longint);
       begin
          inherited init;
          init(op);
@@ -197,14 +209,14 @@ uses
       end;
 
 
-    constructor taalpha.op_const_ref(op : tasmop;_op1 : longint;_op2 : preference);
+    constructor taialpha.op_const_ref(op : tasmop;_op1 : longint;_op2 : preference);
       begin
          inherited init;
          init(op);
          ops:=2;
       end;
 
-    constructor taalpha.op_ref_reg(op : tasmop;_op1 : preference;_op2 : tregister);
+    constructor taialpha.op_ref_reg(op : tasmop;_op1 : preference;_op2 : tregister);
       begin
          inherited init;
          init(op);
@@ -212,7 +224,7 @@ uses
       end;
 
 
-    constructor taalpha.op_ref_ref(op : tasmop;_op1,_op2 : preference);
+    constructor taialpha.op_ref_ref(op : tasmop;_op1,_op2 : preference);
       begin
          inherited init;
          init(op);
@@ -220,35 +232,35 @@ uses
       end;
 
 
-    constructor taalpha.op_reg_reg_reg(op : tasmop;_op1,_op2,_op3 : tregister);
+    constructor taialpha.op_reg_reg_reg(op : tasmop;_op1,_op2,_op3 : tregister);
       begin
          inherited init;
          init(op);
          ops:=3;
       end;
 
-    constructor taalpha.op_const_reg_reg(op : tasmop;_op1 : longint;_op2 : tregister;_op3 : tregister);
+    constructor taialpha.op_const_reg_reg(op : tasmop;_op1 : longint;_op2 : tregister;_op3 : tregister);
       begin
          inherited init;
          init(op);
          ops:=3;
       end;
 
-     constructor taalpha.op_reg_reg_ref(op : tasmop;_op1,_op2 : tregister;_op3 : preference);
+     constructor taialpha.op_reg_reg_ref(op : tasmop;_op1,_op2 : tregister;_op3 : preference);
       begin
          inherited init;
          init(op);
          ops:=3;
       end;
 
-     constructor taalpha.op_const_ref_reg(op : tasmop;_op1 : longint;_op2 : preference;_op3 : tregister);
+     constructor taialpha.op_const_ref_reg(op : tasmop;_op1 : longint;_op2 : preference;_op3 : tregister);
       begin
          inherited init;
          init(op);
          ops:=3;
       end;
 
-     constructor taalpha.op_const_reg_ref(op : tasmop;_op1 : longint;_op2 : tregister;_op3 : preference);
+     constructor taialpha.op_const_reg_ref(op : tasmop;_op1 : longint;_op2 : tregister;_op3 : preference);
       begin
          inherited init;
          init(op);
@@ -256,7 +268,7 @@ uses
       end;
 
 
-    constructor taalpha.op_cond_sym(op : tasmop;cond:TAsmCond;_op1 : pasmsymbol);
+    constructor taialpha.op_cond_sym(op : tasmop;cond:TAsmCond;_op1 : pasmsymbol);
       begin
          inherited init;
          init(op);
@@ -265,7 +277,7 @@ uses
       end;
 
 
-    constructor taalpha.op_sym(op : tasmop;_op1 : pasmsymbol);
+    constructor taialpha.op_sym(op : tasmop;_op1 : pasmsymbol);
       begin
          inherited init;
          init(op);
@@ -273,7 +285,7 @@ uses
       end;
 
 
-    constructor taalpha.op_sym_ofs(op : tasmop;_op1 : pasmsymbol;_op1ofs:longint);
+    constructor taialpha.op_sym_ofs(op : tasmop;_op1 : pasmsymbol;_op1ofs:longint);
       begin
          inherited init;
          init(op);
@@ -281,7 +293,7 @@ uses
       end;
 
 
-    constructor taalpha.op_sym_ofs_reg(op : tasmop;_op1 : pasmsymbol;_op1ofs:longint;_op2 : tregister);
+    constructor taialpha.op_sym_ofs_reg(op : tasmop;_op1 : pasmsymbol;_op1ofs:longint;_op2 : tregister);
       begin
          inherited init;
          init(op);
@@ -289,14 +301,14 @@ uses
       end;
 
 
-    constructor taalpha.op_sym_ofs_ref(op : tasmop;_op1 : pasmsymbol;_op1ofs:longint;_op2 : preference);
+    constructor taialpha.op_sym_ofs_ref(op : tasmop;_op1 : pasmsymbol;_op1ofs:longint;_op2 : preference);
       begin
          inherited init;
          init(op);
          ops:=2;
       end;
 
-    destructor taalpha.done;
+    destructor taialpha.done;
       var
         i : longint;
       begin
@@ -306,7 +318,7 @@ uses
         inherited done;
       end;
 
-    function taalpha.getcopy:plinkedlist_item;
+    function taialpha.getcopy:plinkedlist_item;
       var
         i : longint;
         p : plinkedlist_item;
@@ -314,18 +326,40 @@ uses
         p:=inherited getcopy;
         { make a copy of the references }
         for i:=1 to ops do
-         if (paalpha(p)^.oper[i-1].typ=top_ref) then
+         if (paialpha(p)^.oper[i-1].typ=top_ref) then
           begin
-            new(paalpha(p)^.oper[i-1].ref);
-            paalpha(p)^.oper[i-1].ref^:=oper[i-1].ref^;
+            new(paialpha(p)^.oper[i-1].ref);
+            paialpha(p)^.oper[i-1].ref^:=oper[i-1].ref^;
           end;
         getcopy:=p;
       end;
 
+    Constructor taiframe.init (GP : Tregister; Localsize : Longint; RA : TRegister; L : longint);
+
+    begin
+      Inherited Init;
+      typ:=ait_frame;
+      G:=GP;
+      R:=RA;
+      LS:=LocalSize;
+      LU:=L;
+    end;
+
+    Constructor taient.Init (ProcName : String);
+    
+    begin
+      Inherited init;
+      typ:=ait_ent;
+      Name:=ProcName;
+    end;
+
 end.
 {
   $Log$
-  Revision 1.1  1999-08-03 00:24:01  michael
+  Revision 1.2  1999-08-05 15:50:33  michael
+  * more changes
+
+  Revision 1.1  1999/08/03 00:24:01  michael
   + Initial implementation
 
 }

+ 9 - 3
compiler/new/alpha/cpubase.pas

@@ -61,7 +61,9 @@ type
             A_STT,A_STW,A_SUBF,A_SUBG,A_SUBL,
             A_SUBQ,A_SUBS,A_SUBT,A_TRAPB,A_UMULH,
             A_UNPKBL,A_UNPKBW,A_WH64,A_WMB,A_XOR,A_ZAP,
-            A_ZAPNOT);
+            A_ZAPNOT
+            { Psuedo code understood by the gnu assembler }
+            ,A_LDGP);
 
 Const
   firstop = low(tasmop);
@@ -101,7 +103,8 @@ Const
   frame_pointer = R_15;
   self_pointer  = R_16;
   accumulator   = R_0;
-  scratchregister = R_14;
+  global_pointer = R_29;
+  scratchregister = R_1;
 
   { sizes }
   pointersize   = 8;
@@ -232,7 +235,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.6  1999-08-05 14:58:17  florian
+  Revision 1.7  1999-08-05 15:50:34  michael
+  * more changes
+
+  Revision 1.6  1999/08/05 14:58:17  florian
     * some fixes for the floating point registers
     * more things for the new code generator