瀏覽代碼

* define cpu32bit for the JVM target (used by psystem to initialise
default integer types)
* define CPUDEFINED in pp.pas if JVM is defined
* initialise the fpu types and currency in psystem for the JVM target

* set uinttype/sinttype to 32 bit types also for all cpu32bitaddr cpus
by default (required for JVM, which has a 64 bit alu but 32 bit
"addresses" -- an address takes up 1 stack slot, a 64 bit int two;
also, array indices are limited to 32 bit)

git-svn-id: branches/jvmbackend@18296 -

Jonas Maebe 14 年之前
父節點
當前提交
dc8df7fe79
共有 3 個文件被更改,包括 13 次插入0 次删除
  1. 1 0
      compiler/fpcdefs.inc
  2. 6 0
      compiler/pp.pas
  3. 6 0
      compiler/psystem.pas

+ 1 - 0
compiler/fpcdefs.inc

@@ -153,6 +153,7 @@
 {$endif mips}
 
 {$ifdef jvm}
+  {$define cpu32bit}
   {$define cpu64bitalu}
   {$define cpu32bitaddr}
   {$define cpuhighleveltarget}

+ 6 - 0
compiler/pp.pas

@@ -135,6 +135,12 @@ program pp;
   {$endif CPUDEFINED}
   {$define CPUDEFINED}
 {$endif AVR}
+{$ifdef JVM}
+  {$ifdef CPUDEFINED}
+    {$fatal ONLY one of the switches for the CPU type must be defined}
+  {$endif CPUDEFINED}
+  {$define CPUDEFINED}
+{$endif}
 {$ifndef CPUDEFINED}
   {$fatal A CPU type switch must be defined}
 {$endif CPUDEFINED}

+ 6 - 0
compiler/psystem.pas

@@ -214,6 +214,10 @@ implementation
         sc80floattype:=tfloatdef.create(sc80real);
         s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
 {$endif avr}
+{$ifdef jvm}
+        create_fpu_types;
+        s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
+{$endif POWERPC64}
 {$ifdef cpu64bitaddr}
         uinttype:=u64inttype;
         sinttype:=s64inttype;
@@ -221,6 +225,8 @@ implementation
         ptrsinttype:=s64inttype;
 {$endif cpu64bitaddr}
 {$ifdef cpu32bitaddr}
+        uinttype:=u32inttype;
+        sinttype:=s32inttype;
         ptruinttype:=u32inttype;
         ptrsinttype:=s32inttype;
 {$endif cpu32bitaddr}