mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-27 09:09:34 +02:00
* handle all operand combinations of xadd, resolves #21146
git-svn-id: trunk@20177 -
This commit is contained in:
parent
babadd73a9
commit
fc569e224d
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -12174,6 +12174,7 @@ tests/webtbs/tw21044.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw21073.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2109.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2110.pp svneol=native#text/plain
|
||||
tests/webtbs/tw21146.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw2128.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2129.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2129b.pp svneol=native#text/plain
|
||||
|
@ -1,2 +1,2 @@
|
||||
{ don't edit, this file is generated from x86ins.dat }
|
||||
1205;
|
||||
1208;
|
||||
|
@ -5705,6 +5705,27 @@
|
||||
code : #2#15#192#65;
|
||||
flags : if_486
|
||||
),
|
||||
(
|
||||
opcode : A_XADD;
|
||||
ops : 2;
|
||||
optypes : (ot_reg8,ot_reg8,ot_none,ot_none);
|
||||
code : #2#15#192#65;
|
||||
flags : if_486
|
||||
),
|
||||
(
|
||||
opcode : A_XADD;
|
||||
ops : 2;
|
||||
optypes : (ot_reg16,ot_reg16,ot_none,ot_none);
|
||||
code : #208#2#15#193#65;
|
||||
flags : if_486
|
||||
),
|
||||
(
|
||||
opcode : A_XADD;
|
||||
ops : 2;
|
||||
optypes : (ot_reg32,ot_reg32,ot_none,ot_none);
|
||||
code : #209#2#15#193#65;
|
||||
flags : if_486
|
||||
),
|
||||
(
|
||||
opcode : A_XBTS;
|
||||
ops : 2;
|
||||
|
@ -2022,6 +2022,10 @@ void \2\x0F\x30 PENT,PRIV
|
||||
(Ch_All, Ch_None, Ch_None)
|
||||
mem,reg16|32|64 \320\2\x0F\xC1\101 486,SM
|
||||
rm8,reg8 \2\x0F\xC0\101 486
|
||||
reg8,reg8 \2\x0F\xC0\101 486
|
||||
reg16,reg16 \320\2\x0F\xC1\101 486
|
||||
reg32,reg32 \321\2\x0F\xC1\101 486
|
||||
reg64,reg64 \320\2\x0F\xC1\101 X86_64
|
||||
|
||||
[XBTS,xbtsX]
|
||||
(Ch_All, Ch_None, Ch_None)
|
||||
|
@ -1,2 +1,2 @@
|
||||
{ don't edit, this file is generated from x86ins.dat }
|
||||
1215;
|
||||
1219;
|
||||
|
@ -5614,6 +5614,34 @@
|
||||
code : #2#15#192#65;
|
||||
flags : if_486
|
||||
),
|
||||
(
|
||||
opcode : A_XADD;
|
||||
ops : 2;
|
||||
optypes : (ot_reg8,ot_reg8,ot_none,ot_none);
|
||||
code : #2#15#192#65;
|
||||
flags : if_486
|
||||
),
|
||||
(
|
||||
opcode : A_XADD;
|
||||
ops : 2;
|
||||
optypes : (ot_reg16,ot_reg16,ot_none,ot_none);
|
||||
code : #208#2#15#193#65;
|
||||
flags : if_486
|
||||
),
|
||||
(
|
||||
opcode : A_XADD;
|
||||
ops : 2;
|
||||
optypes : (ot_reg32,ot_reg32,ot_none,ot_none);
|
||||
code : #209#2#15#193#65;
|
||||
flags : if_486
|
||||
),
|
||||
(
|
||||
opcode : A_XADD;
|
||||
ops : 2;
|
||||
optypes : (ot_reg64,ot_reg64,ot_none,ot_none);
|
||||
code : #208#2#15#193#65;
|
||||
flags : if_x86_64
|
||||
),
|
||||
(
|
||||
opcode : A_XBTS;
|
||||
ops : 2;
|
||||
|
43
tests/webtbs/tw21146.pp
Normal file
43
tests/webtbs/tw21146.pp
Normal file
@ -0,0 +1,43 @@
|
||||
{ %cpu=i386,x86_64 }
|
||||
{ %norun }
|
||||
{$goto on}
|
||||
var
|
||||
{$ifdef cpux86_64}
|
||||
a : array[0..31] of byte =
|
||||
($0F,$C1,$C6,$66,$0F,$C1,$C6,$0F,$C0,$D8,$0F,$C1,$34,$24,$66,$0F,$C1,$34,$24,
|
||||
$0F,$C0,$04,$24,$48,$0F,$C1,$C6,$48,$0F,$C1,$04,$24);
|
||||
{$else cpux86_64}
|
||||
a : array[0..22] of byte =
|
||||
($0f,$c1,$c6,$66,$0f,$c1,$c6,$0f,$c0,$d8,$0f,$c1,$34,$24,$66,$0f,$c1,$34,$24,
|
||||
$0f,$c0,$04,$24);
|
||||
{$endif cpux86_64}
|
||||
|
||||
|
||||
var
|
||||
p : pointer;
|
||||
i : longint;
|
||||
label
|
||||
l;
|
||||
begin
|
||||
l:
|
||||
asm
|
||||
xaddl %eax,%esi
|
||||
xaddw %ax,%si
|
||||
xaddb %bl,%al
|
||||
{$ifdef cpux86_64}
|
||||
xaddl %esi,(%rsp)
|
||||
xaddw %si,(%rsp)
|
||||
xaddb %al,(%rsp)
|
||||
xaddq %rax,%rsi
|
||||
xaddq %rax,(%rsp)
|
||||
{$else cpux86_64}
|
||||
xaddl %esi,(%esp)
|
||||
xaddw %si,(%esp)
|
||||
xaddb %al,(%esp)
|
||||
{$endif cpux86_64}
|
||||
end;
|
||||
for i:=low(a) to high(a) do
|
||||
if pbyte(@l+i)^<>a[i] then
|
||||
halt(1);
|
||||
writeln('ok');
|
||||
end.
|
Loading…
Reference in New Issue
Block a user