2596 Commits

Author SHA1 Message Date
H. Peter Anvin
4dab7a000f doc/changes.src: Update to include recent changes.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2012-10-08 12:05:59 +08:00
Marat Dukhan
7f8c794d21 BR 3327107: fix assembly of VPCMPGTQ
Fix incorrect instruction encoding for VPCMPGTQ.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2012-10-08 12:02:34 +08:00
H. Peter Anvin
5c72992a78 insns.dat: Mark the immediate for shift instructions as imm8
Allow the form:

      mov <rm>,byte 1

... to generate the explicit byte form.  An unfortunate side effect is
that disassembly is ugly; this could be fixed by making a special byte
code that acts the same for the assembler but disassembles specially.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-09-25 22:51:40 -07:00
H. Peter Anvin
7c6baca6d0 BR 3392227: Remove SB flag from SHIFT rm,imm
Remove the SB flag from the rm,imm forms of the shift/rotate
instructions; presumably the intent was to mark the immediate as a
byte immediate, but it instead caused the memory operand to be
accepted without a size, but generate the incorrect code as a result.

Note: it would be good to modify the UNITY filter so that the explicit
form:

	shl eax,byte 1

... forces the imm form rather than the ,1 form.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-09-25 22:46:56 -07:00
Cyrill Gorcunov
6e8bbfb62c opflags: Rework opflags bits with OP_ macros
In this path the opflags bits are completely reworked
in a sake of simplier extension. Inparticular for Knights
Corener instructions we will need new registers and new
sizes.

What's done

 - all bits are grouped in sequences, and start using OP_
   macros, thus if one need to extend some field -- just
   tune up @shift and @bits where needed

 - the #define we use in code are OR'ed in symbols, this
   should be a way more convenient to deal with instead of
   pure hex numbers.

The tests are passed but more eyes needed to review this
rather big and intrusive patch. The reason why it's done
in one single path -- for revertability in one command.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-09-16 23:23:56 +04:00
Cyrill Gorcunov
220ac6544c opflags: Introduce opflags generating macros
This patch introduces two macros

 - OP_GENMASK, to generate masks in opflags
 - OP_GENBIT, to generate bit at specified position

we will use them with extended 64 bits opflags.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-09-16 23:23:43 +04:00
Cyrill Gorcunov
abfb6348fa opflags: Drop never used REG_RIP/REG_EIP
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-09-16 23:23:28 +04:00
H. Peter Anvin
5534099473 When generate dependency names internally, quote filenames
Quote filenames for Make when generated for filenames internally.
Only skip quoting when using the -MT option (rather than -MQ).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-09-09 17:09:00 -07:00
H. Peter Anvin
e55e53db1d changes.src: fix grammar error (support -> supports)
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-09-09 16:47:40 -07:00
Cyrill Gorcunov
167917abe5 opflags: Extend opflags_t to 64 bits
Soon we will need to encode 512 bits values
thus there is no space left in our opflags_t
which is 32 bitfield.

Extend it to 64 bits width.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-09-10 01:35:38 +04:00
H. Peter Anvin
315d049646 NASM 2.10.05 nasm-2.10.05 2012-09-09 13:21:11 -07:00
H. Peter Anvin
55f3cb8df4 changes.src: Document CLAC/STAC
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-09-09 11:05:35 -07:00
H. Peter Anvin
396111e449 Add CLAC and STAC instructions from AVX spec 014 (319433-014)
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-09-09 11:04:07 -07:00
H. Peter Anvin
5c06222e1c NASM 2.10.04 nasm-2.10.04 2012-08-18 11:02:19 -07:00
H. Peter Anvin
480435c0d2 changes.src: List of changes for the next release
Prepare a list of changes for a 2.10.04 release.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-08-17 15:42:24 -07:00
H. Peter Anvin
3fbb2e89ab Add back the 256-bit form of the VORPD instruction
The 256-bit form of the VORPD instruction was deleted in checkin
89a38dac363c45d5309001a710f8cf44e7833f81, apparently by mistake.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-08-17 15:41:34 -07:00
Cyrill Gorcunov
1cf9b31d55 BR 3392207: preproc: Rewrite paste_tokens routine
This should make it easier to read and moreover
now we're able to preprocess pasting as

%define N 1e%++%+ 5
	dd N, 1e+5

Note that N should be expanded as series of pasting
to 1e+5 term, but before this patch we were ending
up in 1e+%+ 5 which is wrong.

In other words the fixed version output is

	dd 1e+5, 1e+5

while broken one was

	dd 1e+%+ 5, 1e+5

This patch also fixes nil dereferences in case if
there is no left or right token around pasting term.

http://bugzilla.nasm.us/show_bug.cgi?id=3392207

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-08-07 11:27:17 +04:00
H. Peter Anvin
eb867fe78e BR 3392218: Disassemble 82h opcodes
The 82h opcodes are undocumented aliases for the 80h opcodes, except
in 64-bit mode.  We don't generate them, but let the disassembler
handle them correctly.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-07-28 15:28:48 -07:00
H. Peter Anvin
c95747598f NASM 2.10.03 nasm-2.10.03 2012-07-22 21:09:20 -07:00
H. Peter Anvin
7f9a43a7cb doc: document XRELEASE MOV fix
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-07-22 21:08:30 -07: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
46a80636c2 NASM 2.10.02 nasm-2.10.02 2012-07-20 17:55:37 -07:00
H. Peter Anvin
5c4c506834 changes: add changes since 2.10.01
ilog2*() and new instructions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-07-20 17:53:55 -07:00
H. Peter Anvin
96eace3841 doc: document ifunc()
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-07-20 17:51:57 -07:00
H. Peter Anvin
0498f87a64 isnsn.dat: add norexw to instructions with only 32- and 64-bit forms
Add norexw to the 32-bit versions of instructions with only 32- and
64-bit forms (66 ignored as a size override.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-07-20 17:15:25 -07:00
H. Peter Anvin
d73d7db48f insns.dat: new instructions from the 013 AVX spec
New instructions (ADCX, ADOX, RDSEED) from the 013 AVX spec
(Intel® Architecture Instruction Set Extensions Programming
Reference).

Note: ADCX in 64-bit mode disassembles incorrectly with a 64-bit
argument.  This still needs to be fixed before a 2.10.02 release.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2012-07-13 09:58:20 +02: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
H. Peter Anvin
290b4cb3a4 eval: add general support for "integer functions" and add ilog2*()
Add general support in the function parser for "integer functions"
(actually implemented as special unary operators, then wrapped in
macros) and implement a family of integer logarithms.  The only
difference is the behavior on a non-power-of-two argument:

	ilog2[e]	-- throw an error
	ilog2w		-- throw a warning
	ilog2f		-- round down to power of 2
	ilog2c		-- round up to power of 2

This is useful for back-converting from masks to bit values.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-05-31 10:25:37 -07:00
Cyrill Gorcunov
3d1d159e1c NASM 2.10.01 nasm-2.10.01 2012-05-25 01:00:40 +04:00
Cyrill Gorcunov
45bf92b4fa docs: Update changes for 2.10.01
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-05-25 00:58:43 +04:00
Cyrill Gorcunov
ed47b5c164 insns.dat: Add VPMOVMSKB reg32,ymmreg instruction
Reported-by: Jasper Neumann <sirrida@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-05-24 23:39:00 +04:00
Cyrill Gorcunov
b5e8fec848 preproc: Move NOP preprocessor into separate file
No need to carry it in nasm.c, let it be more modular.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-05-07 11:34:27 +04:00
Cyrill Gorcunov
0b78bff510 preproc: Split get rid of global preproc methods
This will allow to hook on updated preprocessor
without breaking existing one.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-05-07 01:57:55 +04:00
Cyrill Gorcunov
6094166044 preproc: Drop never used pp_runtime
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-05-06 20:49:24 +04:00
Cyrill Gorcunov
194563915d preproc: Use bsii helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-05-02 00:19:38 +04:00
Cyrill Gorcunov
4d02ededde nasmlib: Shrink idata_bytes
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-05-02 00:19:38 +04:00
H. Peter Anvin
c33f05a9c7 phash.sh: Use int() for the size of the hash table
Pass the hash table size to int() to make it a bit more sane.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-03-26 09:25:10 -07:00
H. Peter Anvin
ff62f33da0 NASM 2.10 nasm-2.10 2012-03-12 13:36:02 -07:00
Cyrill Gorcunov
5bc6d8e44d help: Print that -Ox is a default optimization level
Reported-by: Frank Kotler <fbkotler@myfairpoint.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-03-11 14:19:17 +04:00
Cyrill Gorcunov
1a42fb28a1 preproc: Finally drop context-through search
[backport 290eac75699fb768fdea4588772cf08b5db2788c]

2.09 series was the last one we support context-thru search
(and we were issuing a warning about that) so drop all-context
from get_ctx() routine.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-03-11 11:40:26 +04:00
H. Peter Anvin
fd8a7ae7ed NASM 2.10rc15 nasm-2.10rc15 2012-03-09 16:43:37 -08:00
Cyrill Gorcunov
eaebcb4258 test: Add br3385573 testcase
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-03-06 11:18:02 +04:00
Cyrill Gorcunov
3acd53c72f BR3385573: insns: Fix VPMOVSXBW
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-03-06 11:12:17 +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:

    70712c0df6c437c50452c4997aa2e3de5a0e0299

and reverted in:

    d279fbbd80aab6f79584249629a4aea90b851458

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
9d91ff5b12 NASM 2.10rc14 nasm-2.10rc14 2012-03-04 19:46:43 -08:00
Cyrill Gorcunov
65ff09a9d8 BR3392200: preproc - Fix dangling paste term
Backport 99a055add917fe954038885d9013f8968f76790c

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-03-04 13:05:55 +04:00
H. Peter Anvin
fec39dc93a NASM 2.10rc13 nasm-2.10rc13 2012-03-03 16:26:07 -08:00
H. Peter Anvin
36206cd378 preproc: Revert to the NASM 2.09 preprocessor
The NASM 2.09 preprocessor allows some illogical constructs, but which
unfortunately has been found in real code in the field.  We need
a compatibility solution or a pragma before we can avoid that.

However, we need the other features in NASM 2.10 to come out, so
revert the preprocessor changes for now.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-03-03 16:23:19 -08:00
Cyrill Gorcunov
500ddabcd3 preproc: Drop never used Cond structure
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-03-01 02:17:51 +04:00
Cyrill Gorcunov
6a224e32a5 NASM 2.10rc12
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
nasm-2.10rc12
2012-02-27 11:44:33 +04:00