Commit Graph

272 Commits

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