mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-06 14:47:55 +02:00
+ support for the PREFETCHTW1 instruction based on a patch by Emelyanov Roman, resolves #30933
git-svn-id: trunk@34917 -
This commit is contained in:
parent
63b0024e4c
commit
56252d59f0
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -10413,6 +10413,7 @@ tests/tbf/tb0248.pp svneol=native#text/pascal
|
||||
tests/tbf/tb0249.pp svneol=native#text/pascal
|
||||
tests/tbf/tb0250.pp svneol=native#text/pascal
|
||||
tests/tbf/tb0251.pp svneol=native#text/pascal
|
||||
tests/tbf/tb0252.pp svneol=native#text/pascal
|
||||
tests/tbf/tb0252a.pp svneol=native#text/plain
|
||||
tests/tbf/tb0252b.pp svneol=native#text/plain
|
||||
tests/tbf/tb0252c.pp svneol=native#text/plain
|
||||
@ -15258,6 +15259,7 @@ tests/webtbs/tw30832.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw30889.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw30923.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3093.pp svneol=native#text/plain
|
||||
tests/webtbs/tw30933.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw30936.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw30936a.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw30936b.pp svneol=native#text/pascal
|
||||
|
@ -1034,5 +1034,6 @@
|
||||
'xtest',
|
||||
'rdrand',
|
||||
'rdseed',
|
||||
'xgetbv'
|
||||
'xgetbv',
|
||||
'prefetchwt1'
|
||||
);
|
||||
|
@ -1034,5 +1034,6 @@ attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE
|
||||
attsufNONE,
|
||||
attsufINT
|
||||
);
|
||||
|
@ -1034,5 +1034,6 @@
|
||||
'xtest',
|
||||
'rdrand',
|
||||
'rdseed',
|
||||
'xgetbv'
|
||||
'xgetbv',
|
||||
'prefetchwt1'
|
||||
);
|
||||
|
@ -1,2 +1,2 @@
|
||||
{ don't edit, this file is generated from x86ins.dat }
|
||||
1952;
|
||||
1953;
|
||||
|
@ -1034,5 +1034,6 @@ A_XEND,
|
||||
A_XTEST,
|
||||
A_RDRAND,
|
||||
A_RDSEED,
|
||||
A_XGETBV
|
||||
A_XGETBV,
|
||||
A_PREFETCHWT1
|
||||
);
|
||||
|
@ -1034,5 +1034,6 @@
|
||||
(Ch: (Ch_WFlags, Ch_None, Ch_None)),
|
||||
(Ch: (Ch_Wop1, Ch_WFlags, CH_None)),
|
||||
(Ch: (Ch_Wop1, Ch_WFlags, CH_None)),
|
||||
(Ch: (Ch_WEAX, Ch_WEDX, Ch_RECX))
|
||||
(Ch: (Ch_WEAX, Ch_WEDX, Ch_RECX)),
|
||||
(Ch: (Ch_All, Ch_None, Ch_None))
|
||||
);
|
||||
|
@ -13663,5 +13663,12 @@
|
||||
optypes : (ot_none,ot_none,ot_none,ot_none);
|
||||
code : #3#15#1#208;
|
||||
flags : if_xsave
|
||||
),
|
||||
(
|
||||
opcode : A_PREFETCHWT1;
|
||||
ops : 1;
|
||||
optypes : (ot_memory,ot_none,ot_none,ot_none);
|
||||
code : #2#15#13#130;
|
||||
flags : if_prefetchwt1
|
||||
)
|
||||
);
|
||||
|
@ -1048,5 +1048,6 @@
|
||||
'xtest',
|
||||
'rdrand',
|
||||
'rdseed',
|
||||
'xgetbv'
|
||||
'xgetbv',
|
||||
'prefetchwt1'
|
||||
);
|
||||
|
@ -1048,5 +1048,6 @@ attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE
|
||||
attsufNONE,
|
||||
attsufINT
|
||||
);
|
||||
|
@ -1048,5 +1048,6 @@
|
||||
'xtest',
|
||||
'rdrand',
|
||||
'rdseed',
|
||||
'xgetbv'
|
||||
'xgetbv',
|
||||
'prefetchwt1'
|
||||
);
|
||||
|
@ -1,2 +1,2 @@
|
||||
{ don't edit, this file is generated from x86ins.dat }
|
||||
1984;
|
||||
1985;
|
||||
|
@ -1048,5 +1048,6 @@ A_XEND,
|
||||
A_XTEST,
|
||||
A_RDRAND,
|
||||
A_RDSEED,
|
||||
A_XGETBV
|
||||
A_XGETBV,
|
||||
A_PREFETCHWT1
|
||||
);
|
||||
|
@ -1048,5 +1048,6 @@
|
||||
(Ch: (Ch_WFlags, Ch_None, Ch_None)),
|
||||
(Ch: (Ch_Wop1, Ch_WFlags, CH_None)),
|
||||
(Ch: (Ch_Wop1, Ch_WFlags, CH_None)),
|
||||
(Ch: (Ch_WEAX, Ch_WEDX, Ch_RECX))
|
||||
(Ch: (Ch_WEAX, Ch_WEDX, Ch_RECX)),
|
||||
(Ch: (Ch_All, Ch_None, Ch_None))
|
||||
);
|
||||
|
@ -13887,5 +13887,12 @@
|
||||
optypes : (ot_none,ot_none,ot_none,ot_none);
|
||||
code : #3#15#1#208;
|
||||
flags : if_xsave
|
||||
),
|
||||
(
|
||||
opcode : A_PREFETCHWT1;
|
||||
ops : 1;
|
||||
optypes : (ot_memory,ot_none,ot_none,ot_none);
|
||||
code : #2#15#13#130;
|
||||
flags : if_prefetchwt1
|
||||
)
|
||||
);
|
||||
|
@ -508,6 +508,7 @@ implementation
|
||||
IF_TSX = $00200000;
|
||||
IF_RAND = $00200000;
|
||||
IF_XSAVE = $00200000;
|
||||
IF_PREFETCHWT1 = $00200000;
|
||||
|
||||
IF_PLEVEL = $0F000000; { mask for processor level }
|
||||
IF_8086 = $00000000; { 8086 instruction }
|
||||
|
@ -5418,3 +5418,10 @@ reg16|32|64 \320\2\x0F\xC7\207 RAND
|
||||
(Ch_WEAX, Ch_WEDX, Ch_RECX)
|
||||
void \3\x0F\x01\xD0 XSAVE
|
||||
|
||||
;*******************************************************************************
|
||||
;********** PREFETCHWT1 ********************************************************
|
||||
;*******************************************************************************
|
||||
[PREFETCHWT1,prefetchwt1X]
|
||||
(Ch_All, Ch_None, Ch_None)
|
||||
mem \2\x0F\x0D\202 PREFETCHWT1
|
||||
|
||||
|
@ -1028,5 +1028,6 @@ attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE
|
||||
attsufNONE,
|
||||
attsufINT
|
||||
);
|
||||
|
@ -1028,5 +1028,6 @@
|
||||
'xtest',
|
||||
'rdrand',
|
||||
'rdseed',
|
||||
'xgetbv'
|
||||
'xgetbv',
|
||||
'prefetchwt1'
|
||||
);
|
||||
|
@ -1028,5 +1028,6 @@
|
||||
'xtest',
|
||||
'rdrand',
|
||||
'rdseed',
|
||||
'xgetbv'
|
||||
'xgetbv',
|
||||
'prefetchwt1'
|
||||
);
|
||||
|
@ -1,2 +1,2 @@
|
||||
{ don't edit, this file is generated from x86ins.dat }
|
||||
1973;
|
||||
1974;
|
||||
|
@ -1028,5 +1028,6 @@ A_XEND,
|
||||
A_XTEST,
|
||||
A_RDRAND,
|
||||
A_RDSEED,
|
||||
A_XGETBV
|
||||
A_XGETBV,
|
||||
A_PREFETCHWT1
|
||||
);
|
||||
|
@ -1028,5 +1028,6 @@
|
||||
(Ch: (Ch_WFlags, Ch_None, Ch_None)),
|
||||
(Ch: (Ch_Wop1, Ch_WFlags, CH_None)),
|
||||
(Ch: (Ch_Wop1, Ch_WFlags, CH_None)),
|
||||
(Ch: (Ch_WEAX, Ch_WEDX, Ch_RECX))
|
||||
(Ch: (Ch_WEAX, Ch_WEDX, Ch_RECX)),
|
||||
(Ch: (Ch_All, Ch_None, Ch_None))
|
||||
);
|
||||
|
@ -13810,5 +13810,12 @@
|
||||
optypes : (ot_none,ot_none,ot_none,ot_none);
|
||||
code : #3#15#1#208;
|
||||
flags : if_xsave
|
||||
),
|
||||
(
|
||||
opcode : A_PREFETCHWT1;
|
||||
ops : 1;
|
||||
optypes : (ot_memory,ot_none,ot_none,ot_none);
|
||||
code : #2#15#13#130;
|
||||
flags : if_prefetchwt1
|
||||
)
|
||||
);
|
||||
|
8
tests/tbf/tb0252.pp
Normal file
8
tests/tbf/tb0252.pp
Normal file
@ -0,0 +1,8 @@
|
||||
{ %fail }
|
||||
var
|
||||
b : bytebool;
|
||||
|
||||
begin
|
||||
for b:=false to true do
|
||||
;
|
||||
end.
|
30
tests/webtbs/tw30933.pp
Normal file
30
tests/webtbs/tw30933.pp
Normal file
@ -0,0 +1,30 @@
|
||||
{ %cpu=x86_64,i386 }
|
||||
|
||||
procedure p1;assembler;nostackframe;
|
||||
asm
|
||||
{$ifdef cpux86_64}
|
||||
prefetchwt1 (%rax)
|
||||
{$else cpux86_64}
|
||||
prefetchwt1 (%eax)
|
||||
{$endif cpux86_64}
|
||||
end;
|
||||
|
||||
const
|
||||
test_expected : array[0..2] of byte = (
|
||||
$0f,$0d,$10);
|
||||
|
||||
var
|
||||
i : longint;
|
||||
|
||||
|
||||
begin
|
||||
for i:=0 to high(test_expected) do
|
||||
if test_expected[i]<>pbyte(@p1)[i] then
|
||||
begin
|
||||
writeln('mismatch at offset $',hexstr(i,4), ', expected=$',
|
||||
hexstr(test_expected[i],2),' actual=$',hexstr(pbyte(@p1)[i],2));
|
||||
halt(1);
|
||||
end;
|
||||
writeln('ok');
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user