mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-23 11:49:12 +02:00
+ added a new x86-specific compiler option 'enablecld', which controls whether
the compiler should emit a CLD before using the x86 string instructions. git-svn-id: trunk@25590 -
This commit is contained in:
parent
4d1fb1573e
commit
52fcc0a407
@ -154,6 +154,12 @@ 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)}
|
||||
@ -485,6 +491,13 @@ 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)}
|
||||
|
@ -485,7 +485,8 @@ unit cgcpu;
|
||||
else
|
||||
list.concat(Taicpu.op_const_reg(A_IMUL,S_L,len,NR_ECX));
|
||||
end;
|
||||
list.concat(Taicpu.op_none(A_CLD,S_NO));
|
||||
if current_settings.enablecld then
|
||||
list.concat(Taicpu.op_none(A_CLD,S_NO));
|
||||
list.concat(Taicpu.op_none(A_REP,S_NO));
|
||||
case opsize of
|
||||
S_B : list.concat(Taicpu.Op_none(A_MOVSB,S_NO));
|
||||
|
@ -1504,7 +1504,8 @@ unit cgcpu;
|
||||
else
|
||||
list.concat(Taicpu.op_const_reg(A_IMUL,S_W,len,NR_CX));
|
||||
end;
|
||||
list.concat(Taicpu.op_none(A_CLD,S_NO));
|
||||
if current_settings.enablecld then
|
||||
list.concat(Taicpu.op_none(A_CLD,S_NO));
|
||||
list.concat(Taicpu.op_none(A_REP,S_NO));
|
||||
case opsize of
|
||||
S_B : list.concat(Taicpu.Op_none(A_MOVSB,S_NO));
|
||||
|
@ -3475,6 +3475,10 @@ 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 }
|
||||
|
@ -2233,9 +2233,8 @@ unit cgx86;
|
||||
end;
|
||||
|
||||
getcpuregister(list,REGCX);
|
||||
{$if defined(i8086) or defined(i386)}
|
||||
list.concat(Taicpu.op_none(A_CLD,S_NO));
|
||||
{$endif i8086 or i386}
|
||||
if current_settings.enablecld 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
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user