Jelajahi Sumber

* Give access to CPU specific fields of tsettings record
in GENERIC_CPU mode, to be used by ppudump utility.

generic/cpuinfo.pas: Add tinstructionset, used for ARM cpu.
globals.pas: Put all CPU specific fields of tsettings record
inside a variant part when GENERIC_CPU is defined.
Also import llvm unit when GENERIC_CPU is defined.

+ utils/Makefile.fpc: Add -Fu../llvm option to compile ppudump,
as it now also needs llvm specific code decause of globals unit change.

git-svn-id: trunk@47438 -

pierre 4 tahun lalu
induk
melakukan
c44095733c
4 mengubah file dengan 32 tambahan dan 20 penghapusan
  1. 4 0
      compiler/generic/cpuinfo.pas
  2. 26 18
      compiler/globals.pas
  3. 1 1
      compiler/utils/Makefile
  4. 1 1
      compiler/utils/Makefile.fpc

+ 4 - 0
compiler/generic/cpuinfo.pas

@@ -44,6 +44,10 @@ Type
       (cpu_none
       );
 
+   { copied from arm/cpuinfo unit for arm specific
+     TSettings field }
+   tinstructionset = (is_thumb,is_arm);
+
 
 Type
    tfputype =

+ 26 - 18
compiler/globals.pas

@@ -44,9 +44,9 @@ interface
       { comphook pulls in sysutils anyways }
       cutils,cclasses,cfileutl,
       cpuinfo,
-{$if defined(LLVM) and not defined(GENERIC_CPU)}
+{$if defined(LLVM) or defined(GENERIC_CPU)}
       llvminfo,
-{$endif LLVM and not GENERIC_CPU}
+{$endif LLVM or GENERIC_CPU}
       globtype,version,systems;
 
     const
@@ -166,23 +166,31 @@ interface
 
          tlsmodel : ttlsmodel;
 
-{$if defined(i8086)}
-         x86memorymodel  : tx86memorymodel;
-{$endif defined(i8086)}
-
-{$if defined(ARM)}
-         instructionset : tinstructionset;
-{$endif defined(ARM)}
-
-{$if defined(LLVM) and not defined(GENERIC_CPU)}
-         llvmversion: tllvmversion;
-{$endif defined(LLVM) and not defined(GENERIC_CPU)}
-
         { CPU targets with microcontroller support can add a controller specific unit }
          controllertype   : tcontrollertype;
 
          { WARNING: this pointer cannot be written as such in record token }
          pmessage : pmessagestaterecord;
+{$if defined(generic_cpu)}
+         case byte of
+{$endif}
+{$if defined(i8086) or defined(generic_cpu)}
+   {$ifdef generic_cpu} 1:({$endif}
+           x86memorymodel  : tx86memorymodel;
+   {$ifdef generic_cpu}   );{$endif}
+{$endif defined(i8086) or defined(generic_cpu)}
+
+{$if defined(ARM) or defined(generic_cpu)}
+   {$ifdef generic_cpu} 2:({$endif}
+         instructionset : tinstructionset;
+   {$ifdef generic_cpu}   );{$endif}
+{$endif defined(ARM) or defined(generic_cpu)}
+
+{$if defined(LLVM) or defined(GENERIC_CPU)}
+   {$ifdef generic_cpu} 3:({$endif}
+         llvmversion: tllvmversion;
+   {$ifdef generic_cpu}   );{$endif}
+{$endif defined(LLVM) or defined(GENERIC_CPU)}
        end;
 
     const
@@ -591,17 +599,17 @@ interface
         disabledircache : false;
 
         tlsmodel : tlsm_none;
-{$if defined(i8086)}
+        controllertype : ct_none;
+        pmessage : nil;
+{$if defined(i8086) or defined(GENERIC_CPU)}
         x86memorymodel : mm_small;
-{$endif defined(i8086)}
+{$endif defined(i8086) or defined(GENERIC_CPU)}
 {$if defined(ARM)}
         instructionset : is_arm;
 {$endif defined(ARM)}
 {$if defined(LLVM) and not defined(GENERIC_CPU)}
         llvmversion    : llvmver_7_0;
 {$endif defined(LLVM) and not defined(GENERIC_CPU)}
-        controllertype : ct_none;
-        pmessage : nil;
       );
 
     var

+ 1 - 1
compiler/utils/Makefile

@@ -3236,7 +3236,7 @@ else
 ppu$(PPUEXT): ../ppu.pas
 	$(COMPILER) ../ppu.pas -Fu../generic -dGENERIC_CPU -Fi..
 ppudump$(EXEEXT): ppuutils/ppudump.pp ppu$(PPUEXT)
-	$(COMPILER) ppuutils/ppudump.pp -Fu../generic -dGENERIC_CPU -Fi..
+	$(COMPILER) ppuutils/ppudump.pp -Fu../llvm -Fu../generic -dGENERIC_CPU -Fi..
 ppufiles$(EXEEXT): ppufiles.pp ppu$(PPUEXT)
 	$(COMPILER) ppufiles.pp -Fu../generic -dGENERIC_CPU -Fi..
 ppumove$(EXEEXT): ppumove.pp ppu$(PPUEXT)

+ 1 - 1
compiler/utils/Makefile.fpc

@@ -60,7 +60,7 @@ ppu$(PPUEXT): ../ppu.pas
         $(COMPILER) ../ppu.pas -Fu../generic -dGENERIC_CPU -Fi..
 
 ppudump$(EXEEXT): ppuutils/ppudump.pp ppu$(PPUEXT)
-        $(COMPILER) ppuutils/ppudump.pp -Fu../generic -dGENERIC_CPU -Fi..
+        $(COMPILER) ppuutils/ppudump.pp -Fu../llvm -Fu../generic -dGENERIC_CPU -Fi..
 
 ppufiles$(EXEEXT): ppufiles.pp ppu$(PPUEXT)
         $(COMPILER) ppufiles.pp -Fu../generic -dGENERIC_CPU -Fi..