瀏覽代碼

+ initial AArch64 support in systemh.inc, options.pas, version.pas and
psystem.pas

git-svn-id: trunk@29903 -

Jonas Maebe 10 年之前
父節點
當前提交
b0112fa63f
共有 4 個文件被更改,包括 31 次插入2 次删除
  1. 8 2
      compiler/options.pas
  2. 4 0
      compiler/psystem.pas
  3. 3 0
      compiler/version.pas
  4. 16 0
      rtl/inc/systemh.inc

+ 8 - 2
compiler/options.pas

@@ -885,7 +885,7 @@ begin
   if MacVersionSet then
   if MacVersionSet then
     exit;
     exit;
   { check for deployment target set via environment variable }
   { check for deployment target set via environment variable }
-  if not(target_info.system in [system_i386_iphonesim,system_arm_darwin]) then
+  if not(target_info.system in [system_i386_iphonesim,system_arm_darwin,system_aarch64_darwin]) then
     begin
     begin
       envstr:=GetEnvironmentVariable('MACOSX_DEPLOYMENT_TARGET');
       envstr:=GetEnvironmentVariable('MACOSX_DEPLOYMENT_TARGET');
       if envstr<>'' then
       if envstr<>'' then
@@ -2240,7 +2240,7 @@ begin
                       end;
                       end;
                     'P':
                     'P':
                       begin
                       begin
-                        if (target_info.system in [system_i386_iphonesim,system_arm_darwin]) and
+                        if (target_info.system in [system_i386_iphonesim,system_arm_darwin,system_aarch64_darwin]) and
                            ParseMacVersionMin(iPhoneOSVersionMin,MacOSXVersionMin,'IPHONE_OS_VERSION_MIN_REQUIRED',copy(More,2,255),true) then
                            ParseMacVersionMin(iPhoneOSVersionMin,MacOSXVersionMin,'IPHONE_OS_VERSION_MIN_REQUIRED',copy(More,2,255),true) then
                           begin
                           begin
                             break;
                             break;
@@ -3399,6 +3399,12 @@ begin
     mm_huge:    def_system_macro('FPC_MM_HUGE');
     mm_huge:    def_system_macro('FPC_MM_HUGE');
   end;
   end;
 {$endif i8086}
 {$endif i8086}
+{$ifdef aarch64}
+  def_system_macro('CPUAARCH64');
+  def_system_macro('CPU64');
+  def_system_macro('FPC_CURRENCY_IS_INT64');
+  def_system_macro('FPC_COMP_IS_INT64');
+{$endif aarch64}
 
 
   if tf_cld in target_info.flags then
   if tf_cld in target_info.flags then
     if not UpdateTargetSwitchStr('CLD', init_settings.targetswitches, true) then
     if not UpdateTargetSwitchStr('CLD', init_settings.targetswitches, true) then

+ 4 - 0
compiler/psystem.pas

@@ -268,6 +268,10 @@ implementation
         create_fpu_types;
         create_fpu_types;
         s64currencytype:=corddef.create(scurrency,low(int64),high(int64));
         s64currencytype:=corddef.create(scurrency,low(int64),high(int64));
 {$endif arm}
 {$endif arm}
+{$ifdef aarch64}
+        create_fpu_types;
+        s64currencytype:=corddef.create(scurrency,low(int64),high(int64));
+{$endif aarch64}
 {$ifdef avr}
 {$ifdef avr}
         s32floattype:=cfloatdef.create(s32real);
         s32floattype:=cfloatdef.create(s32real);
         s64floattype:=cfloatdef.create(s64real);
         s64floattype:=cfloatdef.create(s64real);

+ 3 - 0
compiler/version.pas

@@ -77,6 +77,9 @@ interface
 {$ifdef cpumipsel}
 {$ifdef cpumipsel}
         source_cpu_string = 'mipsel';
         source_cpu_string = 'mipsel';
 {$endif cpumipsel}
 {$endif cpumipsel}
+{$ifdef cpuaarch64}
+        source_cpu_string = 'aarch64';
+{$endif cpuaarch64}
 
 
 function version_string:string;
 function version_string:string;
 function full_version_string:string;
 function full_version_string:string;

+ 16 - 0
rtl/inc/systemh.inc

@@ -332,6 +332,22 @@ Type
   FarPointer = Pointer;
   FarPointer = Pointer;
 {$endif CPUAVR}
 {$endif CPUAVR}
 
 
+{$ifdef CPUAARCH64}
+  {$define DEFAULT_DOUBLE}
+
+  {$define SUPPORT_SINGLE}
+  {$define SUPPORT_DOUBLE}
+
+  ValReal = Double;
+
+  { map comp to int64, but this doesn't mean we compile the comp support in! }
+  Comp = Int64;
+  PComp = ^Comp;
+
+  FarPointer = Pointer;
+{$endif CPUAARCH64}
+
+
 {$ifdef CPU64}
 {$ifdef CPU64}
   SizeInt = Int64;
   SizeInt = Int64;
   SizeUInt = QWord;
   SizeUInt = QWord;