mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-06 09:07:59 +02:00
+ support xgetbv instruction, resolves issue #29958
git-svn-id: trunk@33418 -
This commit is contained in:
parent
1e1b36515e
commit
406e3c4ac1
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -14997,6 +14997,7 @@ tests/webtbs/tw29893.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw29912.pp svneol=native#text/plain
|
||||
tests/webtbs/tw29923.pp svneol=native#text/plain
|
||||
tests/webtbs/tw29930.pp svneol=native#text/plain
|
||||
tests/webtbs/tw29958.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw2998.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2999.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3004.pp svneol=native#text/plain
|
||||
|
@ -1033,5 +1033,6 @@
|
||||
'xend',
|
||||
'xtest',
|
||||
'rdrand',
|
||||
'rdseed'
|
||||
'rdseed',
|
||||
'xgetbv'
|
||||
);
|
||||
|
@ -1033,5 +1033,6 @@ attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE
|
||||
);
|
||||
|
@ -1033,5 +1033,6 @@
|
||||
'xend',
|
||||
'xtest',
|
||||
'rdrand',
|
||||
'rdseed'
|
||||
'rdseed',
|
||||
'xgetbv'
|
||||
);
|
||||
|
@ -1,2 +1,2 @@
|
||||
{ don't edit, this file is generated from x86ins.dat }
|
||||
1951;
|
||||
1952;
|
||||
|
@ -1033,5 +1033,6 @@ A_XABORT,
|
||||
A_XEND,
|
||||
A_XTEST,
|
||||
A_RDRAND,
|
||||
A_RDSEED
|
||||
A_RDSEED,
|
||||
A_XGETBV
|
||||
);
|
||||
|
@ -1033,5 +1033,6 @@
|
||||
(Ch: (Ch_None, Ch_None, Ch_None)),
|
||||
(Ch: (Ch_WFlags, Ch_None, Ch_None)),
|
||||
(Ch: (Ch_Wop1, Ch_WFlags, CH_None)),
|
||||
(Ch: (Ch_Wop1, Ch_WFlags, CH_None))
|
||||
(Ch: (Ch_Wop1, Ch_WFlags, CH_None)),
|
||||
(Ch: (Ch_WEAX, Ch_WEDX, Ch_RECX))
|
||||
);
|
||||
|
@ -13656,5 +13656,12 @@
|
||||
optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_none,ot_none,ot_none);
|
||||
code : #208#2#15#199#135;
|
||||
flags : if_rand
|
||||
),
|
||||
(
|
||||
opcode : A_XGETBV;
|
||||
ops : 0;
|
||||
optypes : (ot_none,ot_none,ot_none,ot_none);
|
||||
code : #3#15#1#208;
|
||||
flags : if_xsave
|
||||
)
|
||||
);
|
||||
|
@ -1047,5 +1047,6 @@
|
||||
'xend',
|
||||
'xtest',
|
||||
'rdrand',
|
||||
'rdseed'
|
||||
'rdseed',
|
||||
'xgetbv'
|
||||
);
|
||||
|
@ -1047,5 +1047,6 @@ attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE
|
||||
);
|
||||
|
@ -1047,5 +1047,6 @@
|
||||
'xend',
|
||||
'xtest',
|
||||
'rdrand',
|
||||
'rdseed'
|
||||
'rdseed',
|
||||
'xgetbv'
|
||||
);
|
||||
|
@ -1,2 +1,2 @@
|
||||
{ don't edit, this file is generated from x86ins.dat }
|
||||
1983;
|
||||
1984;
|
||||
|
@ -1047,5 +1047,6 @@ A_XABORT,
|
||||
A_XEND,
|
||||
A_XTEST,
|
||||
A_RDRAND,
|
||||
A_RDSEED
|
||||
A_RDSEED,
|
||||
A_XGETBV
|
||||
);
|
||||
|
@ -1047,5 +1047,6 @@
|
||||
(Ch: (Ch_None, Ch_None, Ch_None)),
|
||||
(Ch: (Ch_WFlags, Ch_None, Ch_None)),
|
||||
(Ch: (Ch_Wop1, Ch_WFlags, CH_None)),
|
||||
(Ch: (Ch_Wop1, Ch_WFlags, CH_None))
|
||||
(Ch: (Ch_Wop1, Ch_WFlags, CH_None)),
|
||||
(Ch: (Ch_WEAX, Ch_WEDX, Ch_RECX))
|
||||
);
|
||||
|
@ -13880,5 +13880,12 @@
|
||||
optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_none,ot_none,ot_none);
|
||||
code : #208#2#15#199#135;
|
||||
flags : if_rand
|
||||
),
|
||||
(
|
||||
opcode : A_XGETBV;
|
||||
ops : 0;
|
||||
optypes : (ot_none,ot_none,ot_none,ot_none);
|
||||
code : #3#15#1#208;
|
||||
flags : if_xsave
|
||||
)
|
||||
);
|
||||
|
@ -449,6 +449,7 @@ implementation
|
||||
IF_FMA4 = $00200000;
|
||||
IF_TSX = $00200000;
|
||||
IF_RAND = $00200000;
|
||||
IF_XSAVE = $00200000;
|
||||
|
||||
IF_PLEVEL = $0F000000; { mask for processor level }
|
||||
IF_8086 = $00000000; { 8086 instruction }
|
||||
|
@ -5410,3 +5410,11 @@ reg16|32|64 \320\2\x0F\xC7\206 RAND
|
||||
[RDSEED]
|
||||
(Ch_Wop1, Ch_WFlags, CH_None)
|
||||
reg16|32|64 \320\2\x0F\xC7\207 RAND
|
||||
|
||||
;*******************************************************************************
|
||||
;********** XSAVE **************************************************************
|
||||
;*******************************************************************************
|
||||
[XGETBV]
|
||||
(Ch_WEAX, Ch_WEDX, Ch_RECX)
|
||||
void \3\x0F\x01\xD0 XSAVE
|
||||
|
||||
|
@ -1027,5 +1027,6 @@ attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE,
|
||||
attsufNONE
|
||||
);
|
||||
|
@ -1027,5 +1027,6 @@
|
||||
'xend',
|
||||
'xtest',
|
||||
'rdrand',
|
||||
'rdseed'
|
||||
'rdseed',
|
||||
'xgetbv'
|
||||
);
|
||||
|
@ -1027,5 +1027,6 @@
|
||||
'xend',
|
||||
'xtest',
|
||||
'rdrand',
|
||||
'rdseed'
|
||||
'rdseed',
|
||||
'xgetbv'
|
||||
);
|
||||
|
@ -1,2 +1,2 @@
|
||||
{ don't edit, this file is generated from x86ins.dat }
|
||||
1972;
|
||||
1973;
|
||||
|
@ -1027,5 +1027,6 @@ A_XABORT,
|
||||
A_XEND,
|
||||
A_XTEST,
|
||||
A_RDRAND,
|
||||
A_RDSEED
|
||||
A_RDSEED,
|
||||
A_XGETBV
|
||||
);
|
||||
|
@ -1027,5 +1027,6 @@
|
||||
(Ch: (Ch_None, Ch_None, Ch_None)),
|
||||
(Ch: (Ch_WFlags, Ch_None, Ch_None)),
|
||||
(Ch: (Ch_Wop1, Ch_WFlags, CH_None)),
|
||||
(Ch: (Ch_Wop1, Ch_WFlags, CH_None))
|
||||
(Ch: (Ch_Wop1, Ch_WFlags, CH_None)),
|
||||
(Ch: (Ch_WEAX, Ch_WEDX, Ch_RECX))
|
||||
);
|
||||
|
@ -13803,5 +13803,12 @@
|
||||
optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_none,ot_none,ot_none);
|
||||
code : #208#2#15#199#135;
|
||||
flags : if_rand
|
||||
),
|
||||
(
|
||||
opcode : A_XGETBV;
|
||||
ops : 0;
|
||||
optypes : (ot_none,ot_none,ot_none,ot_none);
|
||||
code : #3#15#1#208;
|
||||
flags : if_xsave
|
||||
)
|
||||
);
|
||||
|
25
tests/webtbs/tw29958.pp
Normal file
25
tests/webtbs/tw29958.pp
Normal file
@ -0,0 +1,25 @@
|
||||
{ %CPU=i386,x86_64 }
|
||||
{ %norun }
|
||||
|
||||
const
|
||||
expected_code : array[0..2] of byte = ($0f,$01,$D0);
|
||||
|
||||
procedure proc;assembler;nostackframe;
|
||||
asm
|
||||
xgetbv
|
||||
end;
|
||||
|
||||
|
||||
var
|
||||
P : pointer;
|
||||
i : integer;
|
||||
|
||||
begin
|
||||
for i:=0 to high(expected_code) do
|
||||
if (pbyte(@proc)+i)^<>expected_code[i] then
|
||||
begin
|
||||
writeln('Error at pos ',i,'. Expected $',hexstr(expected_code[i],2),' got $',hexstr((pbyte(@proc)+i)^,2));
|
||||
halt(1);
|
||||
end;
|
||||
writeln('ok');
|
||||
end.
|
Loading…
Reference in New Issue
Block a user