Commit Graph

380 Commits

Author SHA1 Message Date
Cyrill Gorcunov
d0f773230e insns: Add AVX2 transactional synchronization extensions
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-02-09 16:20:57 -08:00
H. Peter Anvin
9d93f4b396 insns: replace open-coded \322 opcode with odf (operand default)
Create a mnemonic for the open-coded opcode \322.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-09 16:20:21 -08:00
H. Peter Anvin
a56b70436e BR 3463230: Add VMFUNC instruction
Add VMFUNC instruction from the Intel SDM version 041.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2011-12-21 08:26:48 -08:00
Cyrill Gorcunov
4b6f98bdd6 insns: Fix up sizes for MOVSD and VMOVSS instructions
Reported-by: Jasper Neumann <jasper.neumann@scpsoftware.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-12-17 12:09:02 +04:00
Cyrill Gorcunov
d279fbbd80 BR3392199: Revert "insns: Add MOVD as aliases to MOVQ for compatibility with AMD"
This reverts commit 70712c0df6.

Conflicts:

	insns.dat

Our instructions matcher fuzzy logic fails to handle it at moment.

Reported-by: KO Myung-Hun <komh@chollian.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-20 17:16:43 +04:00
Cyrill Gorcunov
d96a329a78 insns.dat: Fix VPCMPEQQ template
http://bugzilla.nasm.us/show_bug.cgi?id=3392197

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 01:21:48 +04:00
Cyrill Gorcunov
013da29782 BR3392195: insns: Drop MMX flag from MOVD
Typo in specification.

Reported-by: Jasper Neumann <sirrida@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-12 09:47:27 +04:00
Cyrill Gorcunov
eb786412f6 insns: Fix typos for vcmpeq aliases
The patch came from herumi@nifty.com

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-11 13:04:20 +04:00
Cyrill Gorcunov
70712c0df6 insns: Add MOVD as aliases to MOVQ for compatibility with AMD
AMD has MOVD for both 32bit and 64bit GPRs so in a sake of
compatibility bring them into insns.dat.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-02 10:53:37 +04:00
Cyrill Gorcunov
9022212ba9 insns.dat: Fixup VGATHERx instructions
As being spotted by nasm64developer the memory
operands size is incorrect. Fix it.

Reported-by: nasm64developer
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-31 01:34:43 +04:00
Cyrill Gorcunov
db3f71bc67 insns, avx2: A couple of upper-case to lower-case conversion
Just to be solid in style

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-23 00:35:32 +04:00
Cyrill Gorcunov
b16bb628ce insns, avx2: A typo in VPERMPD
The second VPERMD should be VPERMPD actually.

Thanks to nasm64developer for gas test file provided
which allowed to reveal this issue.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-23 00:30:28 +04:00
Cyrill Gorcunov
4c78ab3474 BR3385573: Some AVX2 instructions fixups
A few instruction templates for AVX2 set were wrong.

Reported-by: Agner Fog
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-22 01:38:40 +04:00
Cyrill Gorcunov
c7970eb4a3 insns: Change VPERMPQ to VPERMQ
Was a typo

Reported-by: Agner Fog
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-03 22:16:29 +04:00
Anonymous
e837a7b4ea Implement insns.dat in human readable form
I converted almost all instructions in insns.dat (version
 7a6f978698) to the more
 readable format that insns.pl has supported for years.

 I also made some changes to insns.pl. You can verify that the
 new insns.dat and insns.pl produce byte-identical output to
 the old insns.dat and insns.pl, so I think that this change
 is safe to check in, even though it is a large change to
 insns.dat.

The changes to insns.pl are:

 * fixed a bug: ib,u was not recognized
 * added support for a second immediate argument called "j" for
   instructions like ENTER imm,imm
 * added a "+r" syntax for \10..\13

[gorcunov: insns files remains the same, great job anonymous!]

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-20 21:47:53 +04:00
Cyrill Gorcunov
f757614d48 insns: A final pile of AVX2 instructions
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-20 01:16:11 +04:00
Cyrill Gorcunov
7a0c878ffb insns: A few additional AVX2 templates
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-19 17:01:35 +04:00
Cyrill Gorcunov
7a6f978698 insns: One more small snippet of AVX2
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-18 01:15:25 +04:00
Cyrill Gorcunov
55a12fddc7 insns: One more slab of AVX2 instructions
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-18 00:57:35 +04:00
Cyrill Gorcunov
89a38dac36 insns: Add a slab of AVX2 instructions
Not all are covered yet, but still a step
forward I think.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-17 23:20:00 +04:00
Cyrill Gorcunov
80c7efbad4 insns.dat: Move exsiting AVX2 insns to a separate section
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-17 20:24:16 +04:00
H. Peter Anvin
9f0dcfc724 A few more AVX2 spec instructions
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2011-07-08 16:08:34 -07:00
H. Peter Anvin
573aea590e insns.dat: Clean up and fix the BMI instruction patterns
Clean up the formatting of the BMI instruction patterns, and fix:

a) X64,FUTURE is wrong - it needs to be LONG,FUTURE
b) Fix the BLSI, BLSMSK, BLSR instruction patterns
c) Use a bracket pattern for TZCNT

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2011-07-07 15:29:14 -07:00
Jasper Neuman
5cc798c612 insns: Fix up RORX template
Missed 64 bit case.

Signed-off-by: Jasper Neuman <jasper.neumann@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-07 11:02:11 +04:00
Jasper Neuman
c1610e6abe insns.dat: Add some BMI1 and BMI2 instructions
Signed-off-by: Jasper Neuman <jasper.neumann@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-07-07 01:08:51 +04:00
Cyrill Gorcunov
8a61142504 insns: Mark AVX2 instructions as FUTURE
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-29 23:35:53 +04:00
Cyrill Gorcunov
9880ea4572 insns: A few more AVX2 instructions
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-26 10:45:10 +04:00
Cyrill Gorcunov
92569ece7b insns: Add VPERMD instruction
We somehow missed it.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-26 02:07:22 +04:00
Cyrill Gorcunov
ed33be2519 insns: Allow MOVD xmmreg,rm32 to be used in 32bit mode
Reported-by: Keith Kanios <keith@kanios.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-26 01:49:29 +04:00
Cyrill Gorcunov
80594e79ed insns: Mark VGATHERDPD as AVX2 instructions
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-25 12:01:52 +04:00
H. Peter Anvin
95adeabff5 Implement the VGATHERP instruction
As an initial test of the VSIB handling, implement the VGATHERP
instruction.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2011-06-22 18:20:28 -07:00
Cyrill Gorcunov
a09fe1ebfb Merge branch 'nasm-2.09.xx'
Conflicts:
	doc/changes.src
	version

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-03-12 22:35:42 +03:00
Cyrill Gorcunov
b61564400a BR3189064: Fixes for VEXTRACTF128, VMASKMOVPS
These AVX instructions should use YMM register

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-03-07 12:40:22 +03:00
Cyrill Gorcunov
4e45e61055 Merge branch 'nasm-2.09.xx' 2011-02-23 00:49:41 +03:00
Cyrill Gorcunov
79abe7a731 insns: VLDQQU is back
As HPA explained
|
| w.r.t. the -QQ- instruction forms... when we did
| the initial AVX implementation we decided that
| using -DQ- (double quadword) for 256-bit instructions
| was a bit messy, so we decided to accept both -DQ-
| (being official) and -QQ-
|

So move VLDQQU back and place it before VLDDQU so disassembler
match it first.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-02-23 00:41:43 +03:00
Cyrill Gorcunov
8c918b30b9 Merge branch 'nasm-2.09.xx' 2011-02-21 18:19:26 +03:00
Cyrill Gorcunov
3d3e7066ec BR 3187743: insns.dat -- Rename VLDQQU to VLDDQU
Fix a misprint

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-02-21 18:15:43 +03:00
Cyrill Gorcunov
2716876f4a Delete invalid form of VPEXTRW
Mainline commit 47c95ceed4

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-02-20 22:10:40 +03:00
Cyrill Gorcunov
a71f52055c insns.dat: Remove vpextrw merge rudiment
During merging I've brought in vpextrw with mem16
back again, fixed.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-02-14 22:28:49 +03:00
Cyrill Gorcunov
8a0eb96c11 Merge branch 'nasm-2.09.xx'
Conflicts:
	insns.dat

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-02-14 22:21:50 +03:00
Cyrill Gorcunov
9344270f5b BR3174983: insns.dat -- Fix arguments encodong for VPEXTRW
This form of VPEXTRW is that named 'B' form so
operands encoding should be fixed.

Reported-by: Jasper Neumann
Patch-by: Jasper Neumann
CC: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-02-14 22:04:51 +03:00
H. Peter Anvin
47c95ceed4 BR 3143040: Remove invalid form of VPEXTRW
The 0F form, unlike the 0F3A form, of VPEXTRW cannot write a 16-bit
memory location by specification.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-12-23 16:37:14 -08:00
Cyrill Gorcunov
dc75745994 Merge branch 'insns'
Conflicts:
	insns.pl

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-23 19:26:24 +03:00
Cyrill Gorcunov
e29fc5f111 insns: Fixup MOV[APS|UPS] for xmmrm cases
In fact it was written as

	MOVAPS	xmmreg,xmmreg	\360\2\x0F\x28\110	KATMAI,SSE
	MOVAPS	xmmreg,xmmreg	\360\2\x0F\x29\101	KATMAI,SSE

in first place

	MOVUPS	xmmreg,xmmreg	\360\2\x0F\x10\110	KATMAI,SSE
	MOVUPS	xmmreg,xmmreg	\360\2\x0F\x11\101	KATMAI,SSE

and for example x28 stands for xmmrm128,xmmreg and
x1 for xmmrm128,xmmreg.

TODO: Inspect and fix WILLAMETTE instructions.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-23 18:39:07 +03:00
Cyrill Gorcunov
bf305019a8 insns: Implement size bits on KATMAI
Perhaps not all of them are coevered yet, but mostly.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-23 18:39:01 +03:00
H. Peter Anvin
21d4ccc3c3 BR 3052618: handle segment register operations in 64-bit mode
Handle segment register operations in 64-bit mode, and add a few
optimization patterns.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-24 17:30:00 -07:00
H. Peter Anvin
9df010725f Optimize mov r64,imm
Handle immediate-size optimization for "mov r64,imm" -- reduce it to
"mov r32,imm32" or "mov r64,imm32" as appropriate.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-24 14:08:16 -07:00
H. Peter Anvin
96ba233088 insns.dat: permit contracted forms for VBLENDVP
Allow implicit operands for VBLENDVP, just as for other instructions,
since the semi-legacy forms now are removed.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-16 15:22:21 -07:00
H. Peter Anvin
cfe6d20e3a insns.dat: fix encoding of VCVTSD2SS
Fix typo in the definition of VCVTSD2SS.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-16 15:08:51 -07:00
H. Peter Anvin
c23c52040f insns.dat: SSE encoding of VBLEND with VEX prefix is forbidden
Version 7 of the AVX spec specifically forbids (#UD) using the
66 0F 38 14/15 forms of the BLENDV instructions with a VEX prefix;
those encodings are strictly legacy SSE 4.1.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-16 15:05:25 -07:00
H. Peter Anvin
0217039cdb insns.dat: updates from AVX v7
Updates from the AVX version 7 specification: mostly tightening of the
rules for VEX.L and VEX.W, but remove the VPERMIL2 instructions.

Also encode all the full-length forms of the VCMP instructions and
prefer those for the disassembly.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-16 14:57:09 -07:00
H. Peter Anvin
b936aa61c8 insns.dat: unbreak test/imm64.bin
Unbreak the following subtest in test/imm64.bin:

	mov qword [rax],dword 11223344h

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-02 12:06:13 -07:00
H. Peter Anvin
3a014348ca insns: add FXSAVE64/FXRSTOR64, drop np prefix
Add FXSAVE64 and FXRSTOR64; drop the np prefix on 0F AE instructions:
none of the rest of the 0F AE instructions have them, and there are no
conflicts.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-07 17:20:19 -07:00
H. Peter Anvin
9eb663c087 Merge branch 'master' of ssh://repo.or.cz/srv/git/nasm 2010-07-07 17:17:30 -07:00
H. Peter Anvin
a7407bb5c9 insns.dat: add XSAVE/XRSTOR64, XSAVEOPT, VCVTPH2PS/VCVTPS2PH
Add XSAVE64/XRSTOR64 (previously missing), XSAVEOPT/XSAVEOPT64 (per
AVX 007 spec), and VCVTPH2PS/VCVTPS2PH (per AVX 007) spec.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-07-07 13:48:14 -07:00
H. Peter Anvin
1b8423e1b8 insns.dat: remove VCVTPH2PS/VCVTPS2PH as AMD instructions
Remove VCVTPH2PS/VCVTPS2PH as AMD instructions based on version 3.04
of the AMD spec.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-06 19:38:35 -07:00
H. Peter Anvin
1e3805f975 insns.dat: fix CPU flags for new instructions
FUTURE is a CPU level flag, and cannot be combined with X64 (which is
shorthand for X86_64,LONG).  Also, make sure we add LONG annotations
to everything that is 64-bit mode only.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-06 09:23:24 -07:00
H. Peter Anvin
0416b232ce Add RD*SBASE, WR*SBASE, RDRAND from AVX v7
Add the RD*SBASE, WR*SBASE and RDRAND instructions from version 7 of
the AVX specification, Intel document 319433-007.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-06 09:17:18 -07:00
Cyrill Gorcunov
f85cd55731 BR 3020760: insns.dat -- confirm push imm32 on x86-64 explicitly
PUSH imm64 confuses ones who is trying to find this instruction in
processor programming manuals.

Actually it was introduced in a sake of "push `size' imm" consistency.
In other words -- to allow users to state "PUSH qword imm32" in 64bit code,
though on byte level (ie generated) code it still has a correct and valid
sign-extended "PUSH imm32" instruction.

To get rid of this ambiguie bite we make explicit "PUSH imm32"
being valid in 64bit code. This also makes "PUSH dword imm32"
valid in 64bit code as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-06-25 18:28:15 +04:00
H. Peter Anvin
2df23513b3 BR 3018233: handle LFS, LGS and LSS with a 64-bit register
LFS, LGS and LSS are valid in 64-bit mode and have 64-bit (REX.W)
forms.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-06-18 16:24:46 -07:00
Cyrill Gorcunov
1f6a046d85 BR2975768: Update AMD LWP instructions to match upcoming changes
The former changes have been committed to binutils.
From initial message:

|
| 2010-03-22 Quentin Neill <quentin.neill@amd.com>
|           Sebastian Pop  <sebastian.pop@amd.com>
|
|	opcodes/
|	* i386-dis.c (OP_LWP_I): Removed.
|	(reg_table): Do not use OP_LWP_I, use Iq.
|	(OP_LWPCB_E): Remove use of names16.
|	(OP_LWP_E): Same.
|	* i386-opc.tbl: Removed 16bit LWP insns.  32bit LWP insns
|	should not set the Vex.length bit.
|	* i386-tbl.h: Regenerated.
|
|	gas/
|	* testsuite/gas/i386/x86-64-lwp.s: Remove use of 16bit LWP insns.
|	* testsuite/gas/i386/lwp.s: Same.
|	* testsuite/gas/i386/x86-64-lwp.d: Updated.
|	* testsuite/gas/i386/lwp.d: Updated.
|

So there is no 16 bit instructions anymore.
Also xop.l field should be set to 0.

Based on patch from nasm64developer

Reported-by: nasm64developer
Signed-off-by: nasm64developer
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-03-25 00:37:26 +03:00
H. Peter Anvin
c8d10038e2 insns.dat: in 64-bit mode, accept "monitor rax,ecx,edx".
The first argument to MONITOR is an address, so it should be 64 bits
(RAX) in 64-bit mode.

The preferred form is still just plain "monitor".

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-01-06 16:07:26 -08:00
Cyrill Gorcunov
762e401937 BR2924380: Add AMD LWP instructions
nasm64developer reported that we have no LWP support yet.
Add this feature.

Reported-by: nasm64developer <nasm64developer@users.sf.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-01-03 14:58:06 +03:00
Cyrill Gorcunov
5890ab39f8 BR2924383: fix XOP instructions
nasm64developer reported a few nits in XOP
instruction templates. Plain typo in specification
(http://support.amd.com/us/Processor_TechDocs/43479.pdf)
and opcode errors.

Reported-by: nasm64developer <nasm64developer@users.sf.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-01-03 00:40:54 +03:00
Cyrill Gorcunov
c09bd81ff3 BR2924583: fix FMA4 instructions
nasm64developer reported that VFNMADDSD and VFNMADDSS
have "m" and "s" operands swapped in instruction templates
file.

Reported-by: nasm64developer <nasm64developer@users.sf.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-01-03 00:09:41 +03:00
Cyrill Gorcunov
a2c4abb633 insns.dat: Restore default size of memory operands
During conversion of size of memory operands into
explicit form the compatibility with 2.07 has been
broken (for a small set of instructions). Lets restore
it. Details below.

This is due to specifics of our "fuzzy logic" algorithm.

For example consider the user wrote an instruction like

	VCVTTPD2DQ xmm0,[eax]

the last operand is memory reference. But template contains
the following two items (written in simplified form)

	VCVTTPD2DQ xmmreg,mem128
	VCVTTPD2DQ xmmreg,mem256

So this is impossible to find out what _exactly_ user meant:
either reference to 128 bit value in memory or 256 bit.

As a solution we've been using IF_Sx modifier written in
template which allows to choose "by-default" template
and break the tie.

Reported-by: Victor van den Elzen <victor.vde@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-12-16 18:50:22 +03:00
Cyrill Gorcunov
8896ad0c65 insns.dat: AVX -- no need for IF_ARx in template
We describe the instruction arguments in explicit form
so IF_ARx is just not needed here.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-12-03 00:22:58 +03:00
H. Peter Anvin
96690c6ee4 insns.dat: remove non-DREX SSE5 instructions
Even the non-DREX SSE5 instructions appear to have been either
obsoleted or replaced with XOP varieties.  The only exception are the
ROUNDxx instructions, which are really SSE4.1 instructions and which
were simply duplicates.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-11-09 16:53:43 -08:00
H. Peter Anvin
2dad3ccd17 SSE5: remove all DREX-based instructions
AMD has obsoleted the DREX-based SSE5 proposal, so remove all such
instructions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-11-09 14:57:19 -08:00
H. Peter Anvin
19f9f60efb MOVD xmmreg: not valid with REX.W
The xmmreg forms of MOVD are invalid with REX.W, since those are MOVQ
instructions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-11-06 09:36:11 -08:00
Cyrill Gorcunov
b640a917cd IMUL: sbyteX fix -- last one
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-11-03 21:35:24 +03:00
H. Peter Anvin
b0a6230a80 IMUL: fix an additional incorrect sbyte use
One more incorrect use of sbyte in IMUL.

Overall, the IMUL patterns seem really messy.  *Furthermore*, despite
IMUL normally being thought of as signed, the 2- and 3-operand
versions don't produce a high half and are therefore
signedness-agnostic -- we could even add MUL patterns for those forms.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-11-03 09:34:09 -08:00
H. Peter Anvin
110e5ecec4 BR 2887108: fix incorrect sbyte usage in IMUL
Fix a very curious transposition in the instruction patterns for IMUL,
which caused 32-bit IMUL instructions with constants like 0x10001 to
be generated incorrectly.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-11-03 09:26:58 -08:00
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
H. Peter Anvin
06425512ae Add AVX forms of the AES instructions (new in the latest AVX spec)
The AES instructions, too, have gotten VEX forms.
2008-08-27 18:42:26 -07:00
H. Peter Anvin
51e403152a BR 2067820: add the MOVSXD instruction
The official mnemonic for 32-to-64-bit sign extension is MOVSXD for
some idiotic reason.  Add support for it while continue to recognize
MOVSX for this as an alias.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-08-24 18:12:20 -07:00
H. Peter Anvin
2a09b3bf11 BR 2030823: Problem with the 256-bit FMA instructions
Fix the 256-bit FMA instructions per bug report.
2008-08-13 16:25:08 -07:00
H. Peter Anvin
38c6b44909 BR 2043111: Typo in insns.dat: VCMPFT_OQPD VCMPFT_OQPS
Fix typo
2008-08-13 16:18:23 -07:00
H. Peter Anvin
ecf8c3e382 BR 2025977: Handle SLDT with a 64-bit register operand
Handle SLDT with a 64-bit register operand.  Don't generate a REX.W
prefix in the assembler, since zero-extending is just fine, but do
support it in the disassembler.
2008-07-30 17:28:05 -07:00
H. Peter Anvin
bb266eaa4b BR 2023036: MOV reg32,dreg and vice versa are NOLONG
MOV reg32,dreg and MOV dreg,reg32 are NOLONG; in 64-bit mode we always
move to/from reg64.
2008-07-20 14:59:18 -07:00
H. Peter Anvin
96a6954db4 BR 2017453: indirect jumps in 64-bit mode are implicitly 64 bits
Indirect jumps in 64-bit mode implicitly have 64-bit operand size.
Fix this; the disassembly is still unnecessarily ugly, however.
2008-07-13 15:21:01 -07:00
Charles Crayne
a8ef7ab51d Fix Bugs item #2017455 (LTR in long mode)
LTR is valid in long (64-bit) mode, but still uses
16-bit operand, so remove NOLONG restriction.
2008-07-13 12:52:02 -07:00
H. Peter Anvin
f89d681805 AES instructions are WESTMERE, not NEHALEM
Still need to make this crap saner...
2008-06-27 11:41:59 -07:00
H. Peter Anvin
358c97d21f The XSAVE group are SSE-spefix-sensitive
The XSAVE group are SSE-prefix-sensitive (null prefix), and therefore
take the \360 flag.
2008-06-05 16:23:35 -07:00
H. Peter Anvin
92c4704ddb insns.dat: whitespace cleanup 2008-05-27 14:22:19 -07:00
H. Peter Anvin
fd507e7a79 Fix double 66 prefixes on INVEPT/INVVPID (BR 1956955)
Fix double 66 prefixes on INVEPT/INVVPID in 16-bit mode, per BR
1956955.
2008-05-27 14:20:21 -07:00
H. Peter Anvin
62449a6ce0 VCVTPD2PS, VCVTPD2DQ, VCVTTPD2DQ mem need explicit op size (BR 1974170)
BR 1974170: VCVTPD2PS, VCVTPD2DQ, VCVTTPD2DQ with a memory operand are
ambiguous without a specific operand size, so force one to be added.

Split the instruction pattern due to our current clunky handling of
MMX/XMM/YMM registers together with sizes.  Fix in the future, please!
2008-05-26 22:48:51 -07:00
H. Peter Anvin
4a49b6770f Fix parameters to VCVTPD2DQ (BR 1974159) 2008-05-26 22:42:02 -07:00
H. Peter Anvin
216fea010d Fix mnemnonics for SSE5 PCOMU instructions 2008-05-25 09:25:47 -07:00
H. Peter Anvin
8cb2ae916b Fix mnemonics for VTESTP[SD] (BR 1971570)
Incorrectly entered as VPTEST* due to illogical placement in the manual.
2008-05-24 22:15:56 -07:00
H. Peter Anvin
7aacbeb537 Fix the VPSHUF*W instructions (BR 1971567)
The VPSHUF*W instructions had both wrong mnemonics and opcodes.
2008-05-24 22:13:33 -07:00
H. Peter Anvin
05430f64b5 Fix typo in VPCMPESTRM instruction (BR 1971565)
The VPCMPESTRM instruction was typoed.
2008-05-24 22:11:44 -07:00
H. Peter Anvin
ee71120a63 Add VCVTSI2SS (BR 1971564)
The VCVTSI2SS instruction was missing.
2008-05-24 22:09:51 -07:00
H. Peter Anvin
f2c10aee70 Fix immediate for PCLMULHQ* instructions (BR 1971555)
The immediate for the PCLMULHQ* instructions was wrong.
2008-05-24 22:07:03 -07:00
H. Peter Anvin
89031ff5d2 Remove imm from specific versions of VCMPxx
For the versions of VCMPxx which already embed their condition code,
we do not want an extra immediate argument.

Todo: fix bytecode compiler to complain more about these.
2008-05-24 22:04:23 -07:00
H. Peter Anvin
d0da1c7202 Add VLDQQU as an alias for 256-bit VLDDQU (BR 1971539)
Accept VLDQQU as an alias for VLDDQU when used with 256-bit values.
2008-05-24 21:58:59 -07:00
H. Peter Anvin
6c8042c0eb VFMSUBADDP[SD], not VFMADDSUBS[SD] (BR 1971573)
There are VFMSUBADDP instructions, but there are no VFMADDSUBS
instructions.
2008-05-24 21:54:09 -07:00
H. Peter Anvin
dd84acedcc AVX FMA: Instruction table for the AVX FMA instructions
This adds the AVX FMA instructions to the instruction table, which
should complete the AVX work.
2008-05-23 17:46:08 -07:00
H. Peter Anvin
55ca614e62 AVX: Remaining AVX instructions (still need FMA)
Implement the remaining set of AVX instructions
2008-05-23 17:27:15 -07:00
H. Peter Anvin
2ee4c67e7d AVX instruction table through "P"
AVX instruction table through the letter P in the manual
2008-05-23 17:03:30 -07:00
H. Peter Anvin
7c71949931 AVX: instruction table up to PE
Complete the instruction table up to and including PE (document
319433-002, start next on page 5-330).
2008-05-21 23:21:57 -07:00