Browse Source

- unit cga no more used in sparc compiler.

mazen 23 years ago
parent
commit
9978ebc539
4 changed files with 29 additions and 100 deletions
  1. 0 91
      compiler/sparc/cga.pas
  2. 19 5
      compiler/sparc/ncpuadd.pas
  3. 5 2
      compiler/sparc/ncpuinln.pas
  4. 5 2
      compiler/sparc/ncpumat.pas

+ 0 - 91
compiler/sparc/cga.pas

@@ -1,91 +0,0 @@
-{******************************************************************************
-    $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- *****************************************************************************}
-unit cga;
-{$INCLUDE fpcdefs.inc}
-interface
-uses
-  cpuinfo,cpubase,cginfo,
-  symconst,symtype,symdef,aasmbase,aasmtai,aasmcpu;
-function def_opsize(p1:tdef):topsize;
-function def_getreg(p1:tdef):tregister;
-procedure emitjmp(c:tasmcond;var l:tasmlabel);
-implementation
-uses
-  cutils,
-  systems,globals,verbose,
-  cgbase,cgobj,tgobj,rgobj,rgcpu;
-{*****************************************************************************
-                                Helpers
-*****************************************************************************}
-function def_opsize(p1:tdef):topsize;
-  begin
-    case p1.size of
-      1:def_opsize:=S_B;
-      2:def_opsize:=S_W;
-      4:def_opsize:=S_L;
-      8:def_opsize:=S_L;
-      else
-        InternalError(130820001);
-    end;
-  end;
-function def_getreg(p1:tdef):tregister;
-  begin
-    with rg do
-      def_getreg:=makeregsize(getregisterint(exprasmlist),int_cgsize(p1.size));
-  end;
-{*****************************************************************************
-                              Emit Assembler
-*****************************************************************************}
-procedure emitjmp(c:tasmcond;var l:tasmlabel);
-  var
-    ai:taicpu;
-  begin
-    if c=C_None
-    then
-      ai:= Taicpu.Op_sym(A_JMPL,S_NO,l)
-    else
-      begin
-        ai:=Taicpu.Op_sym(A_JMPL,S_NO,l);
-        ai.SetCondition(c);
-      end;
-    ai.is_jmp:=true;
-    exprasmList.concat(ai);
-  end;
-end.
-{
-  $Log$
-  Revision 1.6  2002-12-25 20:59:49  mazen
-  - many emitXXX removed from cga.pas in order to remove that file.
-
-  Revision 1.5  2002/11/10 19:07:46  mazen
-  * SPARC calling mechanism almost OK (as in GCC./mppcsparc )
-
-  Revision 1.4  2002/11/06 11:31:24  mazen
-  * op_reg_reg_reg don't need any more a TOpSize parameter
-
-  Revision 1.3  2002/10/22 13:43:01  mazen
-  - cga.pas redueced to an empty unit
-
-  Revision 1.2  2002/10/13 19:47:34  mazen
-  - logs removed
-
-  Revision 1.1  2002/08/22 08:30:50  mazen
-  first insertion 2002\08\22
-}

+ 19 - 5
compiler/sparc/ncpuadd.pas

@@ -40,12 +40,12 @@ implementation
 uses
 uses
   globtype,systems,
   globtype,systems,
   cutils,verbose,globals,
   cutils,verbose,globals,
-  symconst,symdef,paramgr,
+  symconst,symdef,SymType,paramgr,
   aasmbase,aasmtai,aasmcpu,defutil,htypechk,
   aasmbase,aasmtai,aasmcpu,defutil,htypechk,
   cgbase,pass_2,regvars,
   cgbase,pass_2,regvars,
   cpupara,
   cpupara,
   ncon,nset,
   ncon,nset,
-  cga,ncgutil,tgobj,rgobj,rgcpu,cgobj,cg64f32;
+  ncgutil,tgobj,rgobj,rgcpu,cgobj,cg64f32;
 const
 const
   opsize_2_cgSize:array[S_B..S_L]of TCgSize=(OS_8,OS_16,OS_32);
   opsize_2_cgSize:array[S_B..S_L]of TCgSize=(OS_8,OS_16,OS_32);
 procedure TSparcAddNode.second_addboolean;
 procedure TSparcAddNode.second_addboolean;
@@ -376,9 +376,9 @@ procedure TSparcAddNode.emit_generic_code(op:TAsmOp;OpSize:TOpSize;unsigned,extr
       //      getlabel(hl4);
       //      getlabel(hl4);
             IF unsigned
             IF unsigned
             THEN
             THEN
-              emitjmp(C_NB,hl4)
+              exprasmList.concat(Taicpu.Op_sym(A_JMPL,S_NO,hl4))
             ELSE
             ELSE
-              emitjmp(C_NO,hl4);
+              exprasmList.concat(Taicpu.Op_sym(A_JMPL,S_NO,hl4));
             cg.a_call_name(exprasmlist,'FPC_OVERFLOW');
             cg.a_call_name(exprasmlist,'FPC_OVERFLOW');
             cg.a_label(exprasmlist,hl4);
             cg.a_label(exprasmlist,hl4);
           end;
           end;
@@ -413,6 +413,17 @@ procedure TSparcAddNode.set_result_location(cmpOp,unsigned:Boolean);
     ELSE
     ELSE
       location_copy(location,left.location);
       location_copy(location,left.location);
   end;
   end;
+function def_opsize(p1:tdef):topsize;
+  begin
+    case p1.size of
+      1:def_opsize:=S_B;
+      2:def_opsize:=S_W;
+      4:def_opsize:=S_L;
+      8:def_opsize:=S_L;
+      else
+        InternalError(130820001);
+    end;
+  end;
 procedure TSparcAddNode.pass_2;
 procedure TSparcAddNode.pass_2;
 {is also being used for "xor", and "mul", "sub", or and comparative operators}
 {is also being used for "xor", and "mul", "sub", or and comparative operators}
   var
   var
@@ -558,7 +569,10 @@ begin
 end.
 end.
 {
 {
     $Log$
     $Log$
-    Revision 1.3  2002-12-25 20:59:49  mazen
+    Revision 1.4  2002-12-30 21:17:22  mazen
+    - unit cga no more used in sparc compiler.
+
+    Revision 1.3  2002/12/25 20:59:49  mazen
     - many emitXXX removed from cga.pas in order to remove that file.
     - many emitXXX removed from cga.pas in order to remove that file.
 
 
     Revision 1.2  2002/12/22 19:26:32  mazen
     Revision 1.2  2002/12/22 19:26:32  mazen

+ 5 - 2
compiler/sparc/ncpuinln.pas

@@ -45,7 +45,7 @@ uses
   cginfo,cgbase,pass_1,pass_2,
   cginfo,cgbase,pass_1,pass_2,
   cpubase,paramgr,
   cpubase,paramgr,
   nbas,ncon,ncal,ncnv,nld,
   nbas,ncon,ncal,ncnv,nld,
-  cga,tgobj,ncgutil,cgobj,cg64f32,rgobj,rgcpu;
+  tgobj,ncgutil,cgobj,cg64f32,rgobj,rgcpu;
 {*****************************************************************************
 {*****************************************************************************
                               TSparcInlineNode
                               TSparcInlineNode
 *****************************************************************************}
 *****************************************************************************}
@@ -120,7 +120,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.1  2002-11-30 20:03:49  mazen
+  Revision 1.2  2002-12-30 21:17:22  mazen
+  - unit cga no more used in sparc compiler.
+
+  Revision 1.1  2002/11/30 20:03:49  mazen
   + ncpuinln node
   + ncpuinln node
 
 
   Revision 1.3  2002/09/18 09:19:37  jonas
   Revision 1.3  2002/09/18 09:19:37  jonas

+ 5 - 2
compiler/sparc/ncpumat.pas

@@ -59,7 +59,7 @@ implementation
       cgbase,cgobj,pass_1,pass_2,
       cgbase,cgobj,pass_1,pass_2,
       ncon,
       ncon,
       cpubase,cpuinfo,cginfo,
       cpubase,cpuinfo,cginfo,
-      ncgutil,cga,cgcpu,cg64f32,rgobj;
+      ncgutil,cgcpu,cg64f32,rgobj;
 
 
 {*****************************************************************************
 {*****************************************************************************
                              TSparcMODDIVNODE
                              TSparcMODDIVNODE
@@ -475,7 +475,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.1  2002-12-21 23:22:59  mazen
+  Revision 1.2  2002-12-30 21:17:22  mazen
+  - unit cga no more used in sparc compiler.
+
+  Revision 1.1  2002/12/21 23:22:59  mazen
   + added shift support
   + added shift support
 
 
   Revision 1.20  2002/11/25 17:43:28  peter
   Revision 1.20  2002/11/25 17:43:28  peter