Răsfoiți Sursa

Fix default CPU for assembler blocks (init_settings.asmcputype) to be the same as init_settings.cputype

git-svn-id: trunk@33612 -
pierre 9 ani în urmă
părinte
comite
e1814305bd
2 a modificat fișierele cu 12 adăugiri și 1 ștergeri
  1. 5 1
      compiler/globals.pas
  2. 7 0
      compiler/options.pas

+ 5 - 1
compiler/globals.pas

@@ -493,7 +493,11 @@ interface
   {$ifdef i8086}
   {$ifdef i8086}
         cputype : cpu_8086;
         cputype : cpu_8086;
         optimizecputype : cpu_8086;
         optimizecputype : cpu_8086;
-        asmcputype : cpu_8086;
+        { Use cpu_none by default,
+        because using cpu_8086 by default means
+        that we reject any instruction above bare 8086 instruction set
+        for all assembler code PM }
+        asmcputype : cpu_none;
         fputype : fpu_x87;
         fputype : fpu_x87;
   {$endif i8086}
   {$endif i8086}
 {$endif not GENERIC_CPU}
 {$endif not GENERIC_CPU}

+ 7 - 0
compiler/options.pas

@@ -3913,6 +3913,13 @@ begin
   { now we can define cpu and fpu type }
   { now we can define cpu and fpu type }
   def_system_macro('CPU'+Cputypestr[init_settings.cputype]);
   def_system_macro('CPU'+Cputypestr[init_settings.cputype]);
 
 
+  { Use init_settings cpu type for asm cpu type,
+    if asmcputype is cpu_none,
+    at least as long as there is no explicit 
+    option to set it on command line PM }
+  if init_settings.asmcputype = cpu_none then
+    init_settings.asmcputype:=init_settings.cputype;
+
   def_system_macro('FPU'+fputypestr[init_settings.fputype]);
   def_system_macro('FPU'+fputypestr[init_settings.fputype]);
 
 
 {$ifdef llvm}
 {$ifdef llvm}