Bladeren bron

* tsettings.enablecld converted to a targetswitch ts_cld

git-svn-id: trunk@25592 -
nickysn 12 jaren geleden
bovenliggende
commit
bd0585274e
6 gewijzigde bestanden met toevoegingen van 8 en 22 verwijderingen
  1. 0 13
      compiler/globals.pas
  2. 5 2
      compiler/globtype.pas
  3. 1 1
      compiler/i386/cgcpu.pas
  4. 1 1
      compiler/i8086/cgcpu.pas
  5. 0 4
      compiler/options.pas
  6. 1 1
      compiler/x86/cgx86.pas

+ 0 - 13
compiler/globals.pas

@@ -154,12 +154,6 @@ interface
 
          disabledircache : boolean;
 
-{$if defined(x86)}
-         { setting this to true causes the compiler to emit a CLD instruction
-           before using the x86 string instructions. }
-         enablecld       : boolean;
-{$endif defined(x86)}
-
 {$if defined(i8086)}
          x86memorymodel  : tx86memorymodel;
 {$endif defined(i8086)}
@@ -491,13 +485,6 @@ interface
         minfpconstprec : s32real;
 
         disabledircache : false;
-{$if defined(i8086)}
-        enablecld      : true;
-{$elseif defined(i386)}
-        enablecld      : true;
-{$elseif defined(x86_64)}
-        enablecld      : false;
-{$endif}
 {$if defined(i8086)}
         x86memorymodel : mm_small;
 {$endif defined(i8086)}

+ 5 - 2
compiler/globtype.pas

@@ -239,7 +239,9 @@ interface
          ts_lowercase_proc_start,
          { initialise local variables on the JVM target so you won't get
            accidental uses of uninitialised values }
-         ts_init_locals
+         ts_init_locals,
+         { emit a CLD instruction before using the x86 string instructions }
+         ts_cld
        );
        ttargetswitches = set of ttargetswitch;
 
@@ -322,7 +324,8 @@ interface
          (name: 'AUTOSETTERPREFIX';    hasvalue: true ; isglobal: false),
          (name: 'THUMBINTERWORKING';   hasvalue: false; isglobal: true ),
          (name: 'LOWERCASEPROCSTART';  hasvalue: false; isglobal: true ),
-         (name: 'INITLOCALS';          hasvalue: false; isglobal: true )
+         (name: 'INITLOCALS';          hasvalue: false; isglobal: true ),
+         (name: 'CLD';                 hasvalue: false; isglobal: true )
        );
 
        { switches being applied to all CPUs at the given level }

+ 1 - 1
compiler/i386/cgcpu.pas

@@ -485,7 +485,7 @@ unit cgcpu;
             else
               list.concat(Taicpu.op_const_reg(A_IMUL,S_L,len,NR_ECX));
           end;
-        if current_settings.enablecld then
+        if ts_cld in current_settings.targetswitches then
           list.concat(Taicpu.op_none(A_CLD,S_NO));
         list.concat(Taicpu.op_none(A_REP,S_NO));
         case opsize of

+ 1 - 1
compiler/i8086/cgcpu.pas

@@ -1504,7 +1504,7 @@ unit cgcpu;
             else
               list.concat(Taicpu.op_const_reg(A_IMUL,S_W,len,NR_CX));
           end;
-        if current_settings.enablecld then
+        if ts_cld in current_settings.targetswitches then
           list.concat(Taicpu.op_none(A_CLD,S_NO));
         list.concat(Taicpu.op_none(A_REP,S_NO));
         case opsize of

+ 0 - 4
compiler/options.pas

@@ -3475,10 +3475,6 @@ if (target_info.abi = abi_eabihf) then
     mm_huge:    def_system_macro('FPC_MM_HUGE');
   end;
 {$endif}
-{$if defined(x86)}
-  if current_settings.enablecld then
-    def_system_macro('FPC_ENABLED_CLD');
-{$endif}
 
 
   { Section smartlinking conflicts with import sections on Windows }

+ 1 - 1
compiler/x86/cgx86.pas

@@ -2233,7 +2233,7 @@ unit cgx86;
               end;
 
             getcpuregister(list,REGCX);
-            if current_settings.enablecld then
+            if ts_cld in current_settings.targetswitches then
               list.concat(Taicpu.op_none(A_CLD,S_NO));
             if (cs_opt_size in current_settings.optimizerswitches) and
                (len>sizeof(aint)+(sizeof(aint) div 2)) then