diff --git a/compiler/systems.pas b/compiler/systems.pas index b7795df192..94a564500f 100644 --- a/compiler/systems.pas +++ b/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; diff --git a/compiler/x86/aasmcpu.pas b/compiler/x86/aasmcpu.pas index a7156247b0..d27d88b97a 100644 --- a/compiler/x86/aasmcpu.pas +++ b/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