Commit Graph

258 Commits

Author SHA1 Message Date
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