소스 검색

x86: MovMovMov2XChg optimisation now makes use of the CPUX86_HAS_FAST_XCHG flag

J. Gareth "Curious Kit" Moreton 2 년 전
부모
커밋
e942c00f82
1개의 변경된 파일2개의 추가작업 그리고 9개의 파일을 삭제
  1. 2 9
      compiler/x86/aoptx86.pas

+ 2 - 9
compiler/x86/aoptx86.pas

@@ -8611,17 +8611,10 @@ unit aoptx86;
        begin
          { Always accept if optimising for size }
          Result := (cs_opt_size in current_settings.optimizerswitches) or
-           (
-{$ifdef x86_64}
-             { XCHG takes 3 cycles on AMD Athlon64 }
-             (current_settings.optimizecputype >= cpu_core_i)
-{$else x86_64}
-             { From the Pentium M onwards, XCHG only has a latency of 2 rather
+           { From the Pentium M onwards, XCHG only has a latency of 2 rather
              than 3, so it becomes a saving compared to three MOVs with two of
              them able to execute simultaneously. [Kit] }
-             (current_settings.optimizecputype >= cpu_PentiumM)
-{$endif x86_64}
-           );
+           (CPUX86_HAS_FAST_XCHG in cpu_capabilities[current_settings.optimizecputype]);
        end;
 
       var