Revert commit #47257, Disable use of cmov instructions in alignment patterns for some i386 targets (it prevents use of some emulators)

Replace it by a new set of i386 targets, for which the default cpu is set to i80486 instead of pentium2
  to avoid (for default configuration) use of CMOVxx or PREFETCHyyy instructions, not supported by some emulators.

git-svn-id: trunk@47433 -
This commit is contained in:
pierre 2020-11-16 17:04:46 +00:00
parent 2a733aa751
commit f0b22a1569
3 changed files with 16 additions and 9 deletions

View File

@ -4309,6 +4309,14 @@ begin
{$endif cpufpemu}
{$ifdef i386}
if target_info.system in systems_i386_default_486 then
begin
{ Avoid use of MMX/CMOVcc instructions on older systems.
Some systems might not handle these instructions correctly,
Used emulators might also be problematic. PM }
if not option.CPUSetExplicitly then
init_settings.cputype:=cpu_486;
end;
case target_info.system of
system_i386_android:
begin

View File

@ -344,13 +344,13 @@ 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];
{ Default to i80846 instead of pentium2 for all old i386 systems for which
some newer instructions (like CMOVcc or PREFECTXXX) lead to troubles,
related to OS or emulator lack of support. }
systems_i386_default_486 = [system_i386_go32v2, system_i386_watcom,
system_i386_emx, system_i386_wdosx,
system_i386_beos, system_i386_netware,
system_i386_netwlibc, system_i386_symbian];
{ systems supporting Objective-C }
systems_objc_supported = systems_darwin;

View File

@ -965,8 +965,7 @@ implementation
while (localsize>0) do
begin
{$ifndef i8086}
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
if (CPUX86_HAS_CMOV in cpu_capabilities[current_settings.cputype]) then
begin
for j:=low(alignarray_cmovcpus) to high(alignarray_cmovcpus) do
if (localsize>=length(alignarray_cmovcpus[j])) then