Commit graph

256 commits

Author SHA1 Message Date
Jin Kyu Song
d4b2b5f17c AVX-512: Add AVX-512CD instructions
Added Conflict Detection (AVX-512CD) instructions.
These instructions are supported
if CPUID.(EAX=07H, ECX=0):EBX.AVX512CD[bit 28] = 1.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-09-14 01:27:02 +04:00
Jin Kyu Song
c257bb6ae0 AVX-512: Add Pseudo-ops for CMP instructions
Added three-operand pseudo-ops for VCMPPD, VPCMPD and so on.
Test case is also updated to validate them.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-09-07 11:50:39 +04:00
Jin Kyu Song
088827bc6c AVX-512: Add test case for opmask instructions
Added K* instructions test cases in test/avx512f.asm.
The previous test case from GNU AS were repeating the same instruction twice,
so the repeated half part is removed.
Changed the python script (gas2nasm.py) to include opmask instructions.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-29 10:03:36 +04:00
Jin Kyu Song
6d16d2836d AVX-512: Fix comments
Fixed or purged some old comments and added a comment for a previous patch.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-29 10:03:09 +04:00
Jin Kyu Song
fe0ee08586 AVX-512: Add a feature to generate a raw bytecode file
From gas testsuite file, a text file containing raw bytecodes
is useful when verifying the output of NASM.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-28 14:27:25 +04:00
Jin Kyu Song
f9442f67d5 AVX-512: Add a test case for EVEX encoded instructions
This was converted from a gas testsuite.
(gas/testsuite/gas/i386/x86-64-avx512f-intel.d)
A python script that is used for converting is also included.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-08-28 14:27:17 +04:00
Cyrill Gorcunov
340ac1a915 test: Add br978756
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-07-21 14:45:48 +04:00
Cyrill Gorcunov
31d73aefb3 test: Add br3392259
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-07-21 14:45:48 +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
Cyrill Gorcunov
29e2f74a58 test: Add br3392252 test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-05-13 02:21:08 +04: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
b55a1436e4 test: ilog2() test
Test for the ilog2 function/macros.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-05-31 10:28:00 -07:00
Cyrill Gorcunov
eaebcb4258 test: Add br3385573 testcase
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-03-06 11:18:02 +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
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
9fa2e72997 Add support for UTF-16BE and UTF-32BE
Add support for bigendian UTF-16 and UTF-32, and (for symmetry) add
explicitly littleendian operators.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-25 15:29:37 -08: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
2c3f7573b8 Add AVX2 test file
nasm64developer kindly provided a testfile converted
to nasm format.

http://sourceware.org/ml/binutils/2011-06/msg00150.html

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-08-31 01:22:43 +04:00
Cyrill Gorcunov
767a4e8313 test: Add movd.asm
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-06-26 01:53:38 +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
ffa4c37eaf test: Add br3189064
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-03-07 12:42:46 +03:00
Cyrill Gorcunov
f66e71b2cc test: Add br3200749
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-03-07 11:29:56 +03:00
Cyrill Gorcunov
8c918b30b9 Merge branch 'nasm-2.09.xx' 2011-02-21 18:19:26 +03:00
Cyrill Gorcunov
2e6f7c342d test: Add test for BR 3187743
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-02-21 18:19:04 +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
2059aa9806 test: Add test for BR3174983
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-02-14 22:14:51 +03:00
Victor van den Elzen
6dfbddb6b0 Move implicit operand size override logic to calc_size
It is more logical, it cleans up the code and it makes implicit
operand size override prefixes come out in the same order as explicit
ones instead of after all other prefixes.

Suggested-by: H. Peter Anvin <hpa@zytor.com>
2010-12-29 18:13:38 +01:00
Victor van den Elzen
41f1f2badc BR3058845: mostly fix bogus warning with implicit operand size override
The implicit operand size override code didn't set the operand size
prefix, which confused the size calculation code for the range check.

The BITS 64 operand size calculation is still off, but "fixing" it by
making it 32-bit unless REX.W is set breaks PUSH and maybe others.
2010-11-21 19:40:49 +03:00
H. Peter Anvin
bcf9f2a08b Merge branch 'nasm-2.09.xx' 2010-11-16 09:40:03 -08:00
H. Peter Anvin
3cb0e8c052 BR 3109604: Fix C4 vs C5 VEX form selection in calcsize()
calcsize() had the wrong criterion for when C5 prefixes are permitted
(REX.R is permitted, REX.X is forbidden.)  assemble() had the right
test already.  This caused symbol value errors.
2010-11-16 09:39:32 -08:00
Victor van den Elzen
b3cee5a57a BR3058845: mostly fix bogus warning with implicit operand size override
The implicit operand size override code didn't set the operand size
prefix, which confused the size calculation code for the range check.

The BITS 64 operand size calculation is still off, but "fixing" it by
making it 32-bit unless REX.W is set breaks PUSH and maybe others.
2010-11-07 23:27:48 +01:00
Cyrill Gorcunov
1a824c2182 test: Add br3104312.asm test
Not automated yet

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-06 23:09:47 +03:00
Cyrill Gorcunov
d9fddf047e test: Add br3092924.asm
coff massive relocations test

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-06 18:44:48 +03:00
Cyrill Gorcunov
4402af0c59 More tests automation
Not all covered but still worth to put in

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-30 22:10:34 +04:00
Cyrill Gorcunov
e6775697bb test: Add br3074517.asm
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-24 15:25:59 +04:00
Cyrill Gorcunov
8fe1f65087 Merge branch 'nasm-2.09.xx' 2010-09-18 02:59:08 +04:00
Cyrill Gorcunov
ae7c916b6a Add test-case for BR3066383
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-18 02:48:53 +04: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
dbdb6d3df6 test/avx: remove deleted instructions
Remove the deleted VPERMIL2 instructions.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-16 15:23:16 -07:00
Cyrill Gorcunov
753a60de63 test: Add br3041451 testcase
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-08-09 18:47:05 +04:00
Cyrill Gorcunov
acf1cbb250 test: Add automatizing annotations to imm64.asm
H. Peter Anvin pointed
|
| Btw, test/imm64.asm needs test engine annotations.
|

Make it so.

Reported-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-08-04 20:18:30 +04:00
H. Peter Anvin
ab5bd05d82 Revert "Improve process_ea and introduce -OL"
This reverts commit ac732cb6a5.

Resolved Conflicts:

	doc/nasmdoc.src

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-25 12:43:30 -07:00
Victor van den Elzen
ac732cb6a5 Improve process_ea and introduce -OL
Two fixes:
1. Optimization of [bx+0xFFFF] etc
   0xFFFF is an sbyte under 16-bit semantics,
   so make sure to check it right.

2. Don't optimize displacements in -O0
   Displacements that fit into an sbyte or
   can be removed should *not* be optimized in -O0.

   Implicit zero displacements are still optimized, e.g.:
   [eax] -> 0 bit displacement, [ebp] -> 8 bit displacement.
   However explicit displacements are not optimized:
   [eax+0] -> 32 bit displacement, [ebp+0] -> 32 bit displacement.

Because #2 breaks compatibility with 0.98,
I introduced a new optimization level: -OL, legacy.
2010-07-24 22:00:12 +02:00
Cyrill Gorcunov
4e1d5ab0cf preproc.: Fix NULL dereference on broken %strlen argument
Under particular circumstances %strlen may cause SIGSEG. A typical
example is %strlen with nonexistent macro argument.

[ Testcase test/strlen.asm ]

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-23 18:51:51 +04:00
H. Peter Anvin
077fb93d2b preproc: allow non-identifier character in environment variables
Allow non-identifier characters in the name of environment variables,
by surrounding them with string quotes (subject to ordinary
string-quoting rules.)

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-07-20 14:56:30 -07:00
Cyrill Gorcunov
6405229b6d Check in test for BR3028880
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-13 21:17:31 +04:00
Cyrill Gorcunov
8ab945a259 preproc: add another test case
Add another test case for preprocessor token pasting.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-07-09 15:05:32 -07:00
H. Peter Anvin
f86b8b22e1 Check in test case from bug report br3005117
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-08 08:30:23 -07:00