瀏覽代碼

Disable use of cmov instructions in alignment patterns for some i386 targets (it prevents use of some emulators)

git-svn-id: trunk@47257 -
pierre 4 年之前
父節點
當前提交
f674ed0324
共有 2 個文件被更改,包括 10 次插入1 次删除
  1. 8 0
      compiler/systems.pas
  2. 2 1
      compiler/x86/aasmcpu.pas

+ 8 - 0
compiler/systems.pas

@@ -344,6 +344,14 @@ interface
        { all native nt systems }
        systems_nativent = [system_i386_nativent];
 
+       { all i386 systems for which cmov instructions for alignment should not be used.
+         This is a problem for several emulators }
+       systems_i386_no_cmov_align = [system_i386_go32v2,
+                                     system_i386_watcom, system_i386_wdosx,
+                                     system_i386_os2, system_i386_emx,
+                                     system_i386_beos, system_i386_haiku,
+                                     system_i386_solaris];
+
        { systems supporting Objective-C }
        systems_objc_supported = systems_darwin;
 

+ 2 - 1
compiler/x86/aasmcpu.pas

@@ -963,7 +963,8 @@ implementation
            while (localsize>0) do
             begin
 {$ifndef i8086}
-              if CPUX86_HAS_CMOV in cpu_capabilities[current_settings.cputype] then
+              if (CPUX86_HAS_CMOV in cpu_capabilities[current_settings.cputype])
+                 {$ifdef i386} and not (target_info.system in systems_i386_no_cmov_align) {$endif} then
                 begin
                   for j:=low(alignarray_cmovcpus) to high(alignarray_cmovcpus) do
                    if (localsize>=length(alignarray_cmovcpus[j])) then