Commit Graph

348 Commits

Author SHA1 Message Date
Cyrill Gorcunov
b59346d496 insns: Fix MOVLPD
http://bugzilla.nasm.us/show_bug.cgi?id=978756

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-07-21 14:45:48 +04:00
Cyrill Gorcunov
7dff2f028a insns: Fix MOVNTDQA instruction
http://bugzilla.nasm.us/show_bug.cgi?id=3392259

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-07-21 11:14:04 +04:00
Cyrill Gorcunov
d26ac53fe3 insns: Fix VMOVNTDQA instruction
http://bugzilla.nasm.us/show_bug.cgi?id=3392259

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-07-21 11:13:15 +04:00
H. Peter Anvin
e20ca02cfb BR 3392260: Handle instructions only separated by vector SIB size
There are two instructions (VGATHERQPS, VPGATHERQD) where the only
separation between two forms is the vector length given to the vector
SIB.  This means the *matcher* has to be able to distinguish
instructions by vector SIB length and the matcher only operates on the
operands and the instruction flags, not on the bytecode.

Export the vector index-ness into the operand flags and add to the
matcher.

This resolves BR 3392260.

Reported-by: Agner <agner@anger.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-07-19 17:09:39 -07:00
MITSUNARI Shigeo
50a33b068b insns: Fix vspllw instruction
http://bugzilla.nasm.us/show_bug.cgi?id=3392257

Signed-off-by: MITSUNARI Shigeo <herumi@nifty.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-06-30 01:27:24 +04:00
MITSUNARI Shigeo
93db8fc817 insns: Fix vgatherqpd instruction
Signed-off-by: MITSUNARI Shigeo <herumi@nifty.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-06-01 09:54:26 +04:00
MITSUNARI Shigeo
48129e5c8f insns: Fix VPMOVSXBQ instruction
http://bugzilla.nasm.us/show_bug.cgi?id=3392254

Signed-off-by: MITSUNARI Shigeo <herumi@nifty.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-05-24 12:05:32 +04:00
Cyrill Gorcunov
b529149272 insns.dat: Add note about AMD TBM instructions
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-05-12 21:13:04 +04:00
Cyrill Gorcunov
016483fa87 insns.dat: Add BLCMSK
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-05-12 21:12:35 +04:00
Cyrill Gorcunov
2cbf52b08b insns.dat: Add BLCS
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-05-12 21:12:01 +04:00
Cyrill Gorcunov
91cda55b28 insns.dat: Add BLSFILL
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-05-12 21:11:00 +04:00
Cyrill Gorcunov
856386b87c insns.dat: Add BLCFILL
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-05-12 21:10:34 +04:00
Cyrill Gorcunov
921cf07221 insns.dat: Add BLCIC
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-05-12 21:09:42 +04:00
Cyrill Gorcunov
aeef0f38f9 insns.dat: Add BLCI
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-05-12 21:09:09 +04:00
Cyrill Gorcunov
0622f5a947 insns.dat: Add BLSIC
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-05-12 21:08:26 +04:00
Cyrill Gorcunov
cb8e493461 insns.dat: Add immediate form of BEXTR
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-05-12 21:07:07 +04:00
Cyrill Gorcunov
02b23d1d00 insns.dat: Add T1MSKC intstruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-05-12 21:06:26 +04:00
Cyrill Gorcunov
552dccbb22 insns.dat: Add TZMSK instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-05-12 21:05:25 +04:00
Cyrill Gorcunov
b6b42e0611 insns.dat: Move TZCNT for alphabetical order
Other instructions in this section already sorted.
No func changes.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-05-12 21:04:41 +04:00
Cyrill Gorcunov
1ac3459539 insns.dat: Udate year
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-05-04 02:24:38 +04:00
Cyrill Gorcunov
e3574117ed br3392250: insns -- Allow byte size in PREFETCHTx instructions
The PREFETCHTx instructions do allow mem8 (byte).

Reported-by: Agner <agner@agner.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-05-04 02:24:05 +04:00
Ben Rudiak-Gould
d1ac29a3cc insns: Remove pushseg/popseg internal bytecodes
This patch is getting rid of the following bytecodes
'pushseg','popseg','pushseg2','popseg2' and simplifies
overall code.

[gorcunov@: a few style fixes]
Signed-off-by: Ben Rudiak-Gould <benrudiak@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-03-03 20:50:46 +04:00
Ben Rudiak-Gould
4e8396b5cf Remove +s
It doesn't seem worth >200 lines of C and Perl to save ~50 lines in insns.dat.

In order to make this work I had to rename sbyte16/sbyte32 so that
they can take an ordinary size suffix (their size suffix was formerly
treated specially).

This fixes one disassembly bug: 48C7C000000080 disassembles to mov
rax,0x80000000, which reassembles to B800000080, which loads a
different value.

Signed-off-by: Ben Rudiak-Gould <benrudiak@gmail.com>
Acked-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-03-01 10:28:32 +04:00
Andrew Nayenko
842512c527 BR3392242: insns.dat -- Support AMD SVM instructions in 32bit mode
AMD CPUs do support SVM instructions in 32-bit mode thus drop X64
restriction from instructions template where appropriate.

Signed-off-by: Andrew Nayenko <resver@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-21 02:36:57 +04:00
Ben Rudiak-Gould
bf0f42390d Fix jmp/call near offsets in long mode
In long mode relative offsets are always 32 bits sign-extended to 64
bits and absolute near addresses are always 64 bits, regardless of the
operand size.

Signed-off-by: Ben Rudiak-Gould <benrudiak@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-20 23:25:59 +04:00
Ben Rudiak-Gould
d7ab1f9638 Add np and similar prefixes to instructions that should have them
This adds "np" to a bunch of SSE-style instructions that should have
it, "norep" (which was implemented but unused) on quasi-SSE instructions
that use F2 and F3 as instruction extensions but 66 for operand size,
"nof3" (newly implemented) on a few instructions, "norexw" on some
instructions that have only 32-bit and 64-bit versions, and one NOLONG.

It also removes some incorrect "np"s, changes some "f3"s to "f3i"s,
and fixes the decoding of the XCHG/NOP/PAUSE mess: F390 is always
PAUSE even when rex.b=1 (at least according to XED).

Signed-off-by: Ben Rudiak-Gould <benrudiak@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-20 23:25:54 +04:00
Marat Dukhan
7f8c794d21 BR 3327107: fix assembly of VPCMPGTQ
Fix incorrect instruction encoding for VPCMPGTQ.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2012-10-08 12:02:34 +08:00
H. Peter Anvin
5c72992a78 insns.dat: Mark the immediate for shift instructions as imm8
Allow the form:

      mov <rm>,byte 1

... to generate the explicit byte form.  An unfortunate side effect is
that disassembly is ugly; this could be fixed by making a special byte
code that acts the same for the assembler but disassembles specially.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-09-25 22:51:40 -07:00
H. Peter Anvin
7c6baca6d0 BR 3392227: Remove SB flag from SHIFT rm,imm
Remove the SB flag from the rm,imm forms of the shift/rotate
instructions; presumably the intent was to mark the immediate as a
byte immediate, but it instead caused the memory operand to be
accepted without a size, but generate the incorrect code as a result.

Note: it would be good to modify the UNITY filter so that the explicit
form:

	shl eax,byte 1

... forces the imm form rather than the ,1 form.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-09-25 22:46:56 -07:00
H. Peter Anvin
396111e449 Add CLAC and STAC instructions from AVX spec 014 (319433-014)
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-09-09 11:04:07 -07:00
H. Peter Anvin
3fbb2e89ab Add back the 256-bit form of the VORPD instruction
The 256-bit form of the VORPD instruction was deleted in checkin
89a38dac36, apparently by mistake.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-08-17 15:41:34 -07:00
H. Peter Anvin
eb867fe78e BR 3392218: Disassemble 82h opcodes
The 82h opcodes are undocumented aliases for the 80h opcodes, except
in 64-bit mode.  We don't generate them, but let the disassembler
handle them correctly.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-07-28 15:28:48 -07:00
H. Peter Anvin
56bff2df92 hle: opcode A2 forbidden with HLE prefixes
The moffset opcodes A2 and A3 do not support HLE.  Unfortunately
checkin

fb3f4e6d HLE: Change NOHLE to be an instruction flag

... inadvertently lost the NOHLE flag for opcode A2.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-07-22 21:04:20 -07:00
H. Peter Anvin
0498f87a64 isnsn.dat: add norexw to instructions with only 32- and 64-bit forms
Add norexw to the 32-bit versions of instructions with only 32- and
64-bit forms (66 ignored as a size override.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-07-20 17:15:25 -07:00
H. Peter Anvin
d73d7db48f insns.dat: new instructions from the 013 AVX spec
New instructions (ADCX, ADOX, RDSEED) from the 013 AVX spec
(Intel® Architecture Instruction Set Extensions Programming
Reference).

Note: ADCX in 64-bit mode disassembles incorrectly with a 64-bit
argument.  This still needs to be fixed before a 2.10.02 release.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2012-07-13 09:58:20 +02:00
Cyrill Gorcunov
ed47b5c164 insns.dat: Add VPMOVMSKB reg32,ymmreg instruction
Reported-by: Jasper Neumann <sirrida@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-05-24 23:39:00 +04:00
Cyrill Gorcunov
3acd53c72f BR3385573: insns: Fix VPMOVSXBW
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-03-06 11:12:17 +04:00
H. Peter Anvin
b106ba161f Try again to fix our handling of MOVD/MOVQ
Try to implement the handling of MOVD as attempted in checkin:

    70712c0df6

and reverted in:

    d279fbbd80

due to BR3392199.  This time make sure to use the SX flag to only
match when a size is explicitly given, and also don't duplicate the 0F
6F/7F opcodes, which are documented as MOVQ by AMD as well as Intel.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-03-05 22:37:21 -08:00
H. Peter Anvin
0d008c52ab insns.dat: MOV is not lockable; CMPXCHG16B does not support HLE
Using a LOCK prefix with MOV is not permitted.
The CMPXCHG16B instruction is not defined to support HLE.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-25 22:38:42 -08:00
H. Peter Anvin
fb3f4e6ddb HLE: Change NOHLE to be an instruction flag
The way our matching system works we have to make NOHLE an instruction
flag rather than an byte code; by the time we run the byte code
interpreter we have already picked an instruction pattern once and for
all.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-25 22:22:07 -08:00
H. Peter Anvin
7687dded2d Assume the undocumented CMPXCHG486 opcode was lockable
Someone who actually knows about this opcode and has a 486 to test on
may want to verify this.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-25 12:35:33 -08:00
Cyrill Gorcunov
a94601f83c insns.dat: Add IF_LOCK flag on appropriate instructions
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-26 00:25:37 +04:00
H. Peter Anvin
c3bfc7f643 Clean up JMP/CALL patterns, especially for 64 bits
Clean up JMP/CALL patterns so they don't disassemble quite so uglily.
Fix a CALL pattern which would have incorrectly generated a (harmless)
REX.W prefix.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-25 12:13:50 -08:00
Cyrill Gorcunov
b496c68f91 insns.dat: Add nohle for MOV in case of moffset destination
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-26 00:07:27 +04:00
Cyrill Gorcunov
922f5e2dac insns.dat: Add hlexr flag for MOV instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:53:09 +04:00
Cyrill Gorcunov
ab6057926b insns.dat: Add hlenl flag for XCHG instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:53:09 +04:00
Cyrill Gorcunov
93e170f585 insns.dat: Add hle flag for XADD instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:53:09 +04:00
Cyrill Gorcunov
5c4d23a039 insns.dat: Add hle flag for XOR instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:53:09 +04:00
Cyrill Gorcunov
3403477b96 insns.dat: Add hle flag for SUB instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:53:09 +04:00
Cyrill Gorcunov
b556a03847 insns.dat: Add hle flag for SBB instruction
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-25 23:53:09 +04:00