mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 03:29:33 +02:00
Introduce USE_REAL_INSTRUCTIONS to handle expressions not accepted by old assemblers
git-svn-id: trunk@48430 -
This commit is contained in:
parent
bbbdbb9efa
commit
5dbd9eb2e0
@ -74,13 +74,24 @@ unit cpu;
|
|||||||
if _RTMSupport then
|
if _RTMSupport then
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
.Lretry:
|
{$ifdef USE_REAL_INSTRUCTIONS}
|
||||||
|
.Lretry:
|
||||||
xbegin .Lretry
|
xbegin .Lretry
|
||||||
|
{$else}
|
||||||
|
{ 3d: c7 f8 fa ff ff ff xbegin }
|
||||||
|
.byte 0xc7,0xf8, 0xfa, 0xff, 0xff, 0xff
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
Result:=Target;
|
Result:=Target;
|
||||||
if (Result.Lo=Comperand.Lo) and (Result.Hi=Comperand.Hi) then
|
if (Result.Lo=Comperand.Lo) and (Result.Hi=Comperand.Hi) then
|
||||||
Target:=NewValue;
|
Target:=NewValue;
|
||||||
asm
|
asm
|
||||||
|
{$ifdef USE_REAL_INSTRUCTIONS}
|
||||||
|
xend
|
||||||
|
{$else}
|
||||||
|
{ 8a: 0f 01 d5 xend }
|
||||||
|
.byte 0x0f, 0x01, 0xd5
|
||||||
|
{$endif}
|
||||||
xend
|
xend
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
@ -119,7 +130,11 @@ unit cpu;
|
|||||||
|
|
||||||
function cr0 : longint;assembler;
|
function cr0 : longint;assembler;
|
||||||
asm
|
asm
|
||||||
|
{$ifdef USE_REAL_INSTRUCTIONS}
|
||||||
|
mov eax,cr0
|
||||||
|
{$else}
|
||||||
DB 0Fh,20h,0C0h
|
DB 0Fh,20h,0C0h
|
||||||
|
{$endif}
|
||||||
{ mov eax,cr0
|
{ mov eax,cr0
|
||||||
special registers are not allowed in the assembler
|
special registers are not allowed in the assembler
|
||||||
parsers }
|
parsers }
|
||||||
@ -138,8 +153,12 @@ unit cpu;
|
|||||||
function XGETBV(i : dword) : int64;assembler;
|
function XGETBV(i : dword) : int64;assembler;
|
||||||
asm
|
asm
|
||||||
movl %eax,%ecx
|
movl %eax,%ecx
|
||||||
|
{$ifdef USE_REAL_INSTRUCTIONS}
|
||||||
|
xgetbv
|
||||||
|
{$else}
|
||||||
// older FPCs don't know the xgetbv opcode
|
// older FPCs don't know the xgetbv opcode
|
||||||
.byte 0x0f,0x01,0xd0
|
.byte 0x0f,0x01,0xd0
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user