mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 21:28:21 +02:00
* fixed assembler tables for sse4 instructions, resolves #13186
git-svn-id: trunk@12787 -
This commit is contained in:
parent
1bc505b622
commit
694f563079
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8763,6 +8763,7 @@ tests/webtbs/tw13019.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1310.pp svneol=native#text/plain
|
||||
tests/webtbs/tw13133.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1318.pp svneol=native#text/plain
|
||||
tests/webtbs/tw13186.pp svneol=native#text/plain
|
||||
tests/webtbs/tw13187.pp svneol=native#text/plain
|
||||
tests/webtbs/tw13210.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1323.pp svneol=native#text/plain
|
||||
|
@ -9601,63 +9601,63 @@
|
||||
opcode : A_MOVNTSS;
|
||||
ops : 2;
|
||||
optypes : (ot_memory,ot_xmmreg,ot_none);
|
||||
code : #65#219#192#62#2#15#43#63;
|
||||
code : #219#192#211#2#15#43#65;
|
||||
flags : if_sse4 or if_sd
|
||||
),
|
||||
(
|
||||
opcode : A_MOVNTSD;
|
||||
ops : 2;
|
||||
optypes : (ot_memory,ot_xmmreg,ot_none);
|
||||
code : #65#192#220#213#62#2#15#43#63;
|
||||
code : #192#220#213#211#2#15#43#0#65;
|
||||
flags : if_sse4
|
||||
),
|
||||
(
|
||||
opcode : A_INSERTQ;
|
||||
ops : 2;
|
||||
optypes : (ot_xmmreg,ot_xmmreg,ot_none);
|
||||
code : #72#220#62#2#15#121#63;
|
||||
code : #220#211#2#15#121#72;
|
||||
flags : if_sse4
|
||||
),
|
||||
(
|
||||
opcode : A_EXTRQ;
|
||||
ops : 3;
|
||||
optypes : (ot_xmmreg,ot_immediate,ot_immediate);
|
||||
code : #128#222#62#2#15#120#63#253#17#253#18;
|
||||
code : #222#211#2#15#120#128#253#17#253#18;
|
||||
flags : if_sse4 or if_sb
|
||||
),
|
||||
(
|
||||
opcode : A_EXTRQ;
|
||||
ops : 2;
|
||||
optypes : (ot_xmmreg,ot_xmmreg,ot_none);
|
||||
code : #72#222#62#2#15#121#63;
|
||||
code : #222#211#2#15#121#72;
|
||||
flags : if_sse4
|
||||
),
|
||||
(
|
||||
opcode : A_LZCNT;
|
||||
ops : 2;
|
||||
optypes : (ot_reg16,ot_regmem,ot_none);
|
||||
code : #72#208#219#193#62#2#15#189#63;
|
||||
code : #208#219#193#211#2#15#189#72;
|
||||
flags : if_386 or if_sm or if_sse4
|
||||
),
|
||||
(
|
||||
opcode : A_LZCNT;
|
||||
ops : 2;
|
||||
optypes : (ot_reg32 or ot_bits64,ot_regmem,ot_none);
|
||||
code : #72#209#219#193#62#2#15#189#63;
|
||||
code : #209#219#193#211#2#15#189#72;
|
||||
flags : if_386 or if_sm or if_sse4
|
||||
),
|
||||
(
|
||||
opcode : A_POPCNT;
|
||||
ops : 2;
|
||||
optypes : (ot_reg16,ot_regmem,ot_none);
|
||||
code : #72#208#219#193#62#2#15#184#63;
|
||||
code : #208#219#193#211#2#15#184#72;
|
||||
flags : if_386 or if_sm or if_sse4
|
||||
),
|
||||
(
|
||||
opcode : A_POPCNT;
|
||||
ops : 2;
|
||||
optypes : (ot_reg32 or ot_bits64,ot_regmem,ot_none);
|
||||
code : #72#209#219#193#62#2#15#184#63;
|
||||
code : #209#219#193#211#2#15#184#72;
|
||||
flags : if_386 or if_sm or if_sse4
|
||||
)
|
||||
);
|
||||
|
@ -3251,33 +3251,33 @@ mem \320\323\2\x0F\xC7\201 X86_64
|
||||
;
|
||||
|
||||
|
||||
; note: \333=F3h, \334=F2h, \336=66h, \76=REX, \77=EA, \325=no REX.W=1 for qword, \375=unsigned
|
||||
; note: \333=F3h, \334=F2h, \336=66h, \325=no REX.W=1 for qword, \375=unsigned
|
||||
|
||||
[MOVNTSS]
|
||||
(Ch_All, Ch_None, Ch_None)
|
||||
mem,xmmreg \101\333\300\76\2\x0F\x2B\77 SSE4,SD
|
||||
mem,xmmreg \333\300\323\2\x0F\x2B\101 SSE4,SD
|
||||
|
||||
[MOVNTSD]
|
||||
(Ch_All, Ch_None, Ch_None)
|
||||
mem,xmmreg \101\300\334\325\76\2\x0F\x2B\77 SSE4 ;,SQ
|
||||
mem,xmmreg \300\334\325\323\2\x0F\x2B\\101 SSE4 ;,SQ
|
||||
|
||||
[INSERTQ]
|
||||
(Ch_All, Ch_None, Ch_None)
|
||||
xmmreg,xmmreg \110\334\76\2\x0F\x79\77 SSE4
|
||||
xmmreg,xmmreg \334\323\2\x0F\x79\110 SSE4
|
||||
; four operands are not possible yet
|
||||
; xmmreg,xmmreg,imm,imm \110\334\76\2\x0F\x78\77\375\22\375\23 SSE4,SB
|
||||
|
||||
[EXTRQ]
|
||||
(Ch_All, Ch_None, Ch_None)
|
||||
xmmreg,imm,imm \200\336\76\2\x0F\x78\77\375\21\375\22 SSE4,SB
|
||||
xmmreg,xmmreg \110\336\76\2\x0F\x79\77 SSE4
|
||||
xmmreg,imm,imm \336\323\2\x0F\x78\200\375\21\375\22 SSE4,SB
|
||||
xmmreg,xmmreg \336\323\2\x0F\x79\110 SSE4
|
||||
|
||||
[LZCNT,lzcntX]
|
||||
(Ch_All, Ch_None, Ch_None)
|
||||
reg16,regmem \110\320\333\301\76\2\x0F\xBD\77 386,SM,SSE4
|
||||
reg32|64,regmem \110\321\333\301\76\2\x0F\xBD\77 386,SM,SSE4
|
||||
reg16,regmem \320\333\301\323\2\x0F\xBD\110 386,SM,SSE4
|
||||
reg32|64,regmem \321\333\301\323\2\x0F\xBD\110 386,SM,SSE4
|
||||
|
||||
[POPCNT,popcntX]
|
||||
(Ch_All, Ch_None, Ch_None)
|
||||
reg16,regmem \110\320\333\301\76\2\x0F\xB8\77 386,SM,SSE4
|
||||
reg32|64,regmem \110\321\333\301\76\2\x0F\xB8\77 386,SM,SSE4
|
||||
reg16,regmem \320\333\301\323\2\x0F\xB8\110 386,SM,SSE4
|
||||
reg32|64,regmem \321\333\301\323\2\x0F\xB8\110 386,SM,SSE4
|
||||
|
@ -9587,63 +9587,63 @@
|
||||
opcode : A_MOVNTSS;
|
||||
ops : 2;
|
||||
optypes : (ot_memory,ot_xmmreg,ot_none);
|
||||
code : #65#219#192#62#2#15#43#63;
|
||||
code : #219#192#211#2#15#43#65;
|
||||
flags : if_sse4 or if_sd
|
||||
),
|
||||
(
|
||||
opcode : A_MOVNTSD;
|
||||
ops : 2;
|
||||
optypes : (ot_memory,ot_xmmreg,ot_none);
|
||||
code : #65#192#220#213#62#2#15#43#63;
|
||||
code : #192#220#213#211#2#15#43#0#65;
|
||||
flags : if_sse4
|
||||
),
|
||||
(
|
||||
opcode : A_INSERTQ;
|
||||
ops : 2;
|
||||
optypes : (ot_xmmreg,ot_xmmreg,ot_none);
|
||||
code : #72#220#62#2#15#121#63;
|
||||
code : #220#211#2#15#121#72;
|
||||
flags : if_sse4
|
||||
),
|
||||
(
|
||||
opcode : A_EXTRQ;
|
||||
ops : 3;
|
||||
optypes : (ot_xmmreg,ot_immediate,ot_immediate);
|
||||
code : #128#222#62#2#15#120#63#253#17#253#18;
|
||||
code : #222#211#2#15#120#128#253#17#253#18;
|
||||
flags : if_sse4 or if_sb
|
||||
),
|
||||
(
|
||||
opcode : A_EXTRQ;
|
||||
ops : 2;
|
||||
optypes : (ot_xmmreg,ot_xmmreg,ot_none);
|
||||
code : #72#222#62#2#15#121#63;
|
||||
code : #222#211#2#15#121#72;
|
||||
flags : if_sse4
|
||||
),
|
||||
(
|
||||
opcode : A_LZCNT;
|
||||
ops : 2;
|
||||
optypes : (ot_reg16,ot_regmem,ot_none);
|
||||
code : #72#208#219#193#62#2#15#189#63;
|
||||
code : #208#219#193#211#2#15#189#72;
|
||||
flags : if_386 or if_sm or if_sse4
|
||||
),
|
||||
(
|
||||
opcode : A_LZCNT;
|
||||
ops : 2;
|
||||
optypes : (ot_reg32 or ot_bits64,ot_regmem,ot_none);
|
||||
code : #72#209#219#193#62#2#15#189#63;
|
||||
code : #209#219#193#211#2#15#189#72;
|
||||
flags : if_386 or if_sm or if_sse4
|
||||
),
|
||||
(
|
||||
opcode : A_POPCNT;
|
||||
ops : 2;
|
||||
optypes : (ot_reg16,ot_regmem,ot_none);
|
||||
code : #72#208#219#193#62#2#15#184#63;
|
||||
code : #208#219#193#211#2#15#184#72;
|
||||
flags : if_386 or if_sm or if_sse4
|
||||
),
|
||||
(
|
||||
opcode : A_POPCNT;
|
||||
ops : 2;
|
||||
optypes : (ot_reg32 or ot_bits64,ot_regmem,ot_none);
|
||||
code : #72#209#219#193#62#2#15#184#63;
|
||||
code : #209#219#193#211#2#15#184#72;
|
||||
flags : if_386 or if_sm or if_sse4
|
||||
)
|
||||
);
|
||||
|
24
tests/webtbs/tw13186.pp
Normal file
24
tests/webtbs/tw13186.pp
Normal file
@ -0,0 +1,24 @@
|
||||
{ %cpu=i386 }
|
||||
TYPE TRSC = 0..64;
|
||||
FUNCTION COUNTBIT32 { 32 BIT VERSION }
|
||||
(VAR A: QWORD): TRSC;
|
||||
ASSEMBLER; NOSTACKFRAME;
|
||||
ASM
|
||||
POPCNT (%EAX),%EDX
|
||||
POPCNT 4(%EAX),%EAX
|
||||
ADDL %EDX,%EAX
|
||||
END;
|
||||
const
|
||||
expected : array[0..8] of byte =
|
||||
($F3,$0F,$B8,$10,
|
||||
$F3,$0F,$B8,$40,$04
|
||||
);
|
||||
|
||||
var
|
||||
i : Integer;
|
||||
begin
|
||||
for i:=low(expected) to high(expected) do
|
||||
if (pbyte(@countbit32)+i)^<>expected[i] then
|
||||
halt(1);
|
||||
writeln('ok');
|
||||
end.
|
Loading…
Reference in New Issue
Block a user