Browse Source

+ a_call_ref for ppc32 and ppc64

git-svn-id: trunk@3392 -
Jonas Maebe 19 years ago
parent
commit
a387be19a0
4 changed files with 60 additions and 4 deletions
  1. 1 0
      .gitattributes
  2. 2 2
      compiler/powerpc/cgcpu.pas
  3. 2 2
      compiler/powerpc64/cgcpu.pas
  4. 55 0
      compiler/ppcgen/cgppc.pas

+ 1 - 0
.gitattributes

@@ -369,6 +369,7 @@ compiler/ppc.cfg -text
 compiler/ppc.conf -text
 compiler/ppc.conf -text
 compiler/ppc.dof -text
 compiler/ppc.dof -text
 compiler/ppc.dpr -text
 compiler/ppc.dpr -text
+compiler/ppcgen/cgppc.pas svneol=native#text/plain
 compiler/ppheap.pas svneol=native#text/plain
 compiler/ppheap.pas svneol=native#text/plain
 compiler/ppu.pas svneol=native#text/plain
 compiler/ppu.pas svneol=native#text/plain
 compiler/procinfo.pas svneol=native#text/plain
 compiler/procinfo.pas svneol=native#text/plain

+ 2 - 2
compiler/powerpc/cgcpu.pas

@@ -27,13 +27,13 @@ unit cgcpu;
 
 
     uses
     uses
        globtype,symtype,symdef,
        globtype,symtype,symdef,
-       cgbase,cgobj,
+       cgbase,cgobj,cgppc,
        aasmbase,aasmcpu,aasmtai,aasmdata,
        aasmbase,aasmcpu,aasmtai,aasmdata,
        cpubase,cpuinfo,cgutils,cg64f32,rgcpu,
        cpubase,cpuinfo,cgutils,cg64f32,rgcpu,
        parabase;
        parabase;
 
 
     type
     type
-      tcgppc = class(tcg)
+      tcgppc = class(tcgppcgen)
         procedure init_register_allocators;override;
         procedure init_register_allocators;override;
         procedure done_register_allocators;override;
         procedure done_register_allocators;override;
 
 

+ 2 - 2
compiler/powerpc64/cgcpu.pas

@@ -27,13 +27,13 @@ interface
 
 
 uses
 uses
   globtype, symtype, symdef, symsym,
   globtype, symtype, symdef, symsym,
-  cgbase, cgobj,
+  cgbase, cgobj,cgppc,
   aasmbase, aasmcpu, aasmtai,aasmdata,
   aasmbase, aasmcpu, aasmtai,aasmdata,
   cpubase, cpuinfo, cgutils, rgcpu,
   cpubase, cpuinfo, cgutils, rgcpu,
   parabase;
   parabase;
 
 
 type
 type
-  tcgppc = class(tcg)
+  tcgppc = class(tcgppcgen)
     procedure init_register_allocators; override;
     procedure init_register_allocators; override;
     procedure done_register_allocators; override;
     procedure done_register_allocators; override;
 
 

+ 55 - 0
compiler/ppcgen/cgppc.pas

@@ -0,0 +1,55 @@
+{
+    Copyright (c) 2006 by Florian Klaempfl
+
+    This unit implements the common part of the code generator for the PowerPC
+
+    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 cgppc;
+
+{$i fpcdefs.inc}
+
+  interface
+
+    uses
+       globtype,symtype,symdef,
+       cgbase,cgobj,
+       aasmbase,aasmcpu,aasmtai,aasmdata,
+       cpubase,cpuinfo,cgutils,cg64f32,rgcpu,
+       parabase;
+
+    type
+      tcgppcgen = class(tcg)
+        procedure a_call_ref(list : TAsmList;ref: treference); override;
+     end;
+
+  implementation
+
+    uses
+       globals,verbose,systems,cutils,
+       symconst,symsym,fmodule,
+       rgobj,tgobj,cpupi,procinfo,paramgr;
+
+  procedure tcgppcgen.a_call_ref(list : TAsmList;ref: treference);
+    begin
+      a_reg_alloc(list,NR_R0);
+      a_load_ref_reg(list,OS_ADDR,OS_ADDR,ref,NR_R0);
+      a_call_reg(list,NR_R0);
+      a_reg_dealloc(list,NR_R0);
+    end;
+
+end.