Commit graph

207 commits

Author SHA1 Message Date
Cyrill Gorcunov
509aa63b31 insns.dat -- convert FMA instructions
Convert FMA instructions to explicit sized ones.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-08-07 18:42:40 +04:00
Cyrill Gorcunov
e652f82798 insns.dat -- convert AVX instructions part2
Convert Intel AVX instructions to explisit size
format. Part 2.

Also CLMUL converted as well.

Btw, VPINSR was a bit broken since SB constraint
is not applied on all forms but requires 16,32,64
memory sizes too. Fixed.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-08-07 18:41:52 +04:00
Cyrill Gorcunov
b2cad279d9 insns.dat -- convert AVX instructions part1
Convert Intel AVX instructions to explisit size
format. Part 1.

Also SAR instruction is touched as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-08-07 00:26:54 +04:00
Cyrill Gorcunov
e6ccff9997 insns.dat: operand-size syntax for XOP instructions
Explicitly declare the sizes of immediate fields.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-27 15:49:11 -07:00
Cyrill Gorcunov
77df046f0b insns.dat -- operand-size syntax for XOP instructions
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-07-27 12:32:30 +04:00
H. Peter Anvin
7704c186b3 Add copyright notice to insns.dat 2009-06-28 16:56:19 -07:00
H. Peter Anvin
d28f07f7e3 ndisasm: fix disassembly of JRCXZ
Fix the disassembly of JRCXZ; in 64-bit mode, we should only accept
JECXZ for disassembly with 32-bit address size override.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-26 16:18:00 -07:00
H. Peter Anvin
898fceb86d insns.dat: reformat
Reformat insns.dat with standard formatting

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-26 15:14:58 -07:00
H. Peter Anvin
6f5bcf114d insns.dat: add relaxed forms for XOP/FMA4/CVT16 instructions
Add relaxed forms of the XOP/FMA4/CVT16 instructions, without looking
too hard at if it makes sense.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-26 15:13:36 -07:00
H. Peter Anvin
ef3ef70ccf insns: make the MMX version of PINSRW match the SSE/AVX ones
Make the MMX version of PINSRW match the SSE and AVX ones, and add it
to the tests.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 21:53:23 -07:00
H. Peter Anvin
d15bb009f6 Intel FMA: drop relaxed forms
The Intel FMA instructions are destructive, so relaxed forms are not
appropriate.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 21:45:27 -07:00
H. Peter Anvin
1d3e304546 Fix the PINSR series of instructions
Clean up a number of errors in the PINSR series instructions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 21:43:04 -07:00
H. Peter Anvin
f9fc3fde55 insns.dat: fix typos: VCMPORD_SP[SD] entered as VCMPORS_SP[SD]
Fix typos in two instructions in the relaxed forms.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 21:03:29 -07:00
H. Peter Anvin
79c2e37bc0 insns.dat: collapse relaxed forms
Change the relaxed forms to the compact representation.  This
*deliberately* does not fix bugs where the relaxed form does not match
the official form; this is strictly a "no change in output" checkin.

All remaining open-coded relaxed forms are very likely bugs, and need
to be individually audited.  Furthermore, it is questionable if the
Intel FMA instructions, being destructive, should have relaxed forms
at all.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 18:36:24 -07:00
Cyrill Gorcunov
e49b5bf21c insns.dat - fixup for XOP (SSE5) AMD instructions
1) A number of PMA -> VPM misprint fixed.
2) Spec points to ymmreg in mnemonics even for L=0 instructions. Fixed.

The instructions are still sorted in order of specification follows.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-05-17 14:50:30 -07:00
Cyrill Gorcunov
bc095662d5 insns.dat - introcuce base XOP (SSE5) AMD instructions
Introduce base XOP/FMA4/CVT16 instructions (SSE5)
based on official specification from AMD (rev 3.03).
Some fixes from Peter Johnson and H. Peter Anvin
included (not updated in AMD spec yet).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-05-15 07:20:08 -07:00
H. Peter Anvin
74eed4a9b3 BR 2690688: Fix opcodes for FMA instructions
Two bugs with respect to the FMA instructions:
- the variant increment is supposed to be 0x10, not 0x01.
- the base opcode for scalar VFNMADD is 0x9d, not 0x9c
2009-03-17 18:26:47 -07:00
H. Peter Anvin
ef72b03fb4 BR 2690688: add missing VFM instructions
The Perl script which auto-generated the VFM instructions had
incorrectly conflated the VEX.W and VEX.L bits, with the result that
only half the valid instructions were generated.
2009-03-17 16:16:39 -07:00
H. Peter Anvin
cdf42e675d BR 2689316: PEXTRQ requires REX.W
The PEXTRQ instruction requires a REX.W prefix.
2009-03-16 16:32:42 -07:00
H. Peter Anvin
b8abbbe826 insns.dat: fix VFNM instructions incorrectly spelled as VFMN
The scalar versions of the VFNM instructions had been incorrectly
spelled VFMN.
2009-03-16 11:49:27 -07:00
H. Peter Anvin
babebffb71 Add VPCLMUL instructions 2009-02-23 18:27:29 -08:00
H. Peter Anvin
79b5972824 PCLMUL is apparently targeted for Westmere with the AES stuff
The PCLMUL instruction is apparently targetted for Westmere.
2009-02-21 20:45:42 -08:00
H. Peter Anvin
5b4d263e50 BR 2557903: fix disassembly of a set of SSE MOV* instructions
Fix the disassembly of the alternate forms of register-register
MOVAPD, MOVDQA, MOVDQU, MOVQ, MOVSD, and MOVUPD.

NASM never generates these, but they would be disassembled
incorrectly.
2009-02-21 18:58:15 -08:00
H. Peter Anvin
c5d0462a80 BR 2541252: Fix issues in insns.dat, mostly related to LZCNT and POPCNT
Fix various flags on LZCNT and POPCNT, and fix a few instructions
tagged \360\332, which makes no sense.
2009-02-21 18:51:17 -08:00
H. Peter Anvin
c2acf7b047 BR 2592476: Treat WAIT as a prefix even though it's really an instruction
WAIT is technically an instruction, but from an assembler standpoint
it behaves as if it had been a prefix.  In particular, it has to be
ordered *before* any real hardware prefixes.
2009-02-21 18:22:56 -08:00
H. Peter Anvin
2c784d9024 Fix opcode for VADDSUBPS; operands for VBLEND; add SSE for AES ops
Fix the opcode for VADDSUBPS
Fix the operands for VBLEND
Corrent the instruction flags for the AES ops (they're SSE)
2009-02-21 16:56:52 -08:00
H. Peter Anvin
d8e47f6da9 FMA instructions won't be in Sandy Bridge
The FMA instructions aren't scheduled for Sandy Bridge after all.
They will be "in a future processor", so create a placeholder for now.
2009-02-21 16:43:48 -08:00
H. Peter Anvin
37c1ad1dfb Update the VFMA* instructions per the AVX spec version 5
Update the VFMA* instructions to match the AVX spec version 5.
Since these are highly regular, use a small Perl script to generate
the instruction patterns.
2009-02-18 14:07:14 -08:00
H. Peter Anvin
cec96d09e8 insns.dat: fix minor formatting anomalies
Fix minor anomalies in insns.dat.
2009-02-18 14:05:15 -08:00
H. Peter Anvin
9ed8594a28 BR 2413278: Nonoptimal forms of arithmetic instructions involving AX
At some point, we lost the optimizations for the core arithmetic
operations involving AX.  Put them back.
2008-12-29 19:58:36 -08:00
H. Peter Anvin
81cef52e7a The POPCNT instruction does not need sizes on memory operands
The POPCNT instruction should not require sizes on memory operands.
Add the appropriate size flags for that to work.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-11-06 09:39:48 -08:00
H. Peter Anvin
0ad8ffd6e2 BR 2229703: POPCNT r64,rm64 not POPCNT r64,rm32
The 64-bit version of the POPCNT instruction takes r64,rm64; not
r64,rm32.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-11-06 09:35:02 -08:00
H. Peter Anvin
7dce7bc8a1 The CRC32 instructions can take 66 prefixes as well as F2
The CRC32 instructions require F2, but can also take a 66 prefix to
set the operand size.  This is not the SSE model of prefix extension.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-23 16:39:25 -07:00
H. Peter Anvin
019a98dab1 BR 2190521: fix the CRC32 opcodes
A stray \1 bytecode was hiding in the CRC32 opcodes, causing complete
havoc.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-23 16:23:19 -07:00
H. Peter Anvin
49b3a3c2af BR 2187210: Fix PFRCPV and PFRSQRTV
Fix the Geode instructions PFRCPV and PFRSQRTV per bug report 2187210.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-22 11:18:27 -07:00
H. Peter Anvin
ff6e12da50 Reshuffle and move the bytecodes for segment register push/pop
Reshuffle the bytecodes for segment register push/pop to make more
sense, and move them from \4 to \344, thus freeing up the single-digit
bytecodes \4..\7 for future use.  It doesn't really make sense to use
single-digit bytecodes for this very oddball use.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-08 21:17:32 -07:00
H. Peter Anvin
65feb5ae33 Add missing IMUL pattern: reg64,imm8
Make "imul rax,byte 5" work as expected.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-07 11:26:41 -07:00
H. Peter Anvin
37c6d166d2 Add a few missing \15 -> \275 conversions
Add a few \15 -> \275 conversions that had been missed earlier.
Still haven't done the work on IMUL.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-07 10:56:32 -07:00
H. Peter Anvin
55f58acdae Change \40 class opcodes to \254, except IMUL
Change \40 class opcodes which need to be changed to \254.  IMUL will
need a separate audit; I'm not convinced we are really sure what all
the IMUL conditions should be.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-07 10:53:08 -07:00
H. Peter Anvin
588df78b0d New opcode for 32->64 bit sign-extended immediate with warning
Add a new opcode for 32->64 bit sign-extended immediate, with warning
on the number not matching.

This unfortunately calls for an audit of all the \4[0123] opcodes, if
they should be replaced by \25[4567].  This only replaces one
instruction (MOV reg64,imm32); other instructions need to be
considered.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-07 10:05:10 -07:00
H. Peter Anvin
c1377e9a98 New opcodes to deal with 8-bit immediate sign extended to opsize
New opcodes to deal with 8-bit immediates which are then sign-extended
to the operand size.  These allow us to warn appropriately.
Not sure I'm using these in all the proper places; need audit of all
uses of the \14..\17 opcodes.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-06 23:40:31 -07:00
H. Peter Anvin
e9d7f1a074 Better warnings for out-of-range values
Issue better warnings for out-of-range values.  This is not yet
complete.

In particular, note we may have out-of-range for values that end up
being subject to optimization.  That is because the optimization takes
place on the *truncated* value, not the pre-truncated value.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-06 18:47:29 -07:00
H. Peter Anvin
ee6789ceb1 BR 2148476: Fix arguments for a bunch of the CVT* instructions
Fix bugs exposed by test for BR 2148476.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-06 17:58:57 -07:00
H. Peter Anvin
6f87180c3f JMP reg64 does not require a REX.W prefix.
We were redundantly emitting a REX.W prefix for JMP reg64.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-09-25 23:42:28 -07:00
H. Peter Anvin
163e5874d9 Accept implicit memory size for VMREAD/VMWRITE 2008-08-28 18:05:23 -07:00
H. Peter Anvin
5e7d6f1105 BR 2029472: Wrong operand size for VMREAD/VMWRITE in 64-bit mode
Fix the operand size for VMREAD/VMWRITE in 64-bit mode
2008-08-28 18:03:49 -07:00
H. Peter Anvin
dd1de39ece BR 2028995: Missing MOVNTI m64, r64
Fix MOVNTI with a 64-bit argument.
2008-08-28 17:54:55 -07:00
H. Peter Anvin
962e30519c BR 2029829: Accept VIA XCRYPT instructions with or without REP
Accept the VIA XCRYPT instructions either with or without a REP
prefix, as documented.

Add the missing XCRYPTCTR instruction.
2008-08-28 17:47:16 -07:00
H. Peter Anvin
7b4dc622c6 BR 2039212: Handle indirect far jumps in 64-bit mode
Handle indirect far jumps in 64-bit mode.  Default to 64 bit unless
overridden, for consistency with other jumps.
2008-08-28 17:35:25 -07:00
H. Peter Anvin
04f54809d2 Add 256-bit AVX stores per the latest AVX spec.
Add 256-bit forms of VMOVNTPD, VMOVNTPS, and VMOVNT[DQ]Q.
2008-08-27 18:47:05 -07:00