nasm/sigaren-mirror.git
11 years agoBR 3392218: Disassemble 82h opcodesmaster
H. Peter Anvin [Sat, 28 Jul 2012 22:28:48 +0000 (28 15:28 -0700)]
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>
11 years agoNASM 2.10.03nasm-2.10.03
H. Peter Anvin [Mon, 23 Jul 2012 04:09:20 +0000 (22 21:09 -0700)]
NASM 2.10.03

11 years agodoc: document XRELEASE MOV fix
H. Peter Anvin [Mon, 23 Jul 2012 04:08:30 +0000 (22 21:08 -0700)]
doc: document XRELEASE MOV fix

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
11 years agohle: opcode A2 forbidden with HLE prefixes
H. Peter Anvin [Mon, 23 Jul 2012 04:04:20 +0000 (22 21:04 -0700)]
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>
11 years agoNASM 2.10.02nasm-2.10.02
H. Peter Anvin [Sat, 21 Jul 2012 00:55:37 +0000 (20 17:55 -0700)]
NASM 2.10.02

11 years agochanges: add changes since 2.10.01
H. Peter Anvin [Sat, 21 Jul 2012 00:53:55 +0000 (20 17:53 -0700)]
changes: add changes since 2.10.01

ilog2*() and new instructions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
11 years agodoc: document ifunc()
H. Peter Anvin [Sat, 21 Jul 2012 00:51:57 +0000 (20 17:51 -0700)]
doc: document ifunc()

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
11 years agoisnsn.dat: add norexw to instructions with only 32- and 64-bit forms
H. Peter Anvin [Sat, 21 Jul 2012 00:15:25 +0000 (20 17:15 -0700)]
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>
11 years agoinsns.dat: new instructions from the 013 AVX spec
H. Peter Anvin [Fri, 13 Jul 2012 07:58:20 +0000 (13 09:58 +0200)]
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>
11 years agotest: ilog2() test
H. Peter Anvin [Thu, 31 May 2012 17:28:00 +0000 (31 10:28 -0700)]
test: ilog2() test

Test for the ilog2 function/macros.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
11 years agoeval: add general support for "integer functions" and add ilog2*()
H. Peter Anvin [Thu, 31 May 2012 17:25:37 +0000 (31 10:25 -0700)]
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>
11 years agoNASM 2.10.01nasm-2.10.01
Cyrill Gorcunov [Thu, 24 May 2012 21:00:40 +0000 (25 01:00 +0400)]
NASM 2.10.01

11 years agodocs: Update changes for 2.10.01
Cyrill Gorcunov [Thu, 24 May 2012 20:58:43 +0000 (25 00:58 +0400)]
docs: Update changes for 2.10.01

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoinsns.dat: Add VPMOVMSKB reg32,ymmreg instruction
Cyrill Gorcunov [Thu, 24 May 2012 19:39:00 +0000 (24 23:39 +0400)]
insns.dat: Add VPMOVMSKB reg32,ymmreg instruction

Reported-by: Jasper Neumann <sirrida@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agopreproc: Move NOP preprocessor into separate file
Cyrill Gorcunov [Mon, 7 May 2012 07:34:27 +0000 (7 11:34 +0400)]
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>
12 years agopreproc: Split get rid of global preproc methods
Cyrill Gorcunov [Sun, 6 May 2012 21:57:55 +0000 (7 01:57 +0400)]
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>
12 years agopreproc: Drop never used pp_runtime
Cyrill Gorcunov [Sun, 6 May 2012 16:49:24 +0000 (6 20:49 +0400)]
preproc: Drop never used pp_runtime

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agopreproc: Use bsii helper
Cyrill Gorcunov [Tue, 1 May 2012 20:18:56 +0000 (2 00:18 +0400)]
preproc: Use bsii helper

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agonasmlib: Shrink idata_bytes
Cyrill Gorcunov [Tue, 1 May 2012 20:09:45 +0000 (2 00:09 +0400)]
nasmlib: Shrink idata_bytes

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agophash.sh: Use int() for the size of the hash table
H. Peter Anvin [Mon, 26 Mar 2012 16:25:10 +0000 (26 09:25 -0700)]
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>
12 years agoNASM 2.10nasm-2.10.xxnasm-2.10
H. Peter Anvin [Mon, 12 Mar 2012 20:36:02 +0000 (12 13:36 -0700)]
NASM 2.10

12 years agohelp: Print that -Ox is a default optimization level
Cyrill Gorcunov [Sun, 11 Mar 2012 10:19:17 +0000 (11 14:19 +0400)]
help: Print that -Ox is a default optimization level

Reported-by: Frank Kotler <fbkotler@myfairpoint.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agopreproc: Finally drop context-through search
Cyrill Gorcunov [Sun, 11 Mar 2012 07:38:47 +0000 (11 11:38 +0400)]
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>
12 years agoNASM 2.10rc15nasm-2.10rc15
H. Peter Anvin [Sat, 10 Mar 2012 00:43:37 +0000 (9 16:43 -0800)]
NASM 2.10rc15

12 years agotest: Add br3385573 testcase
Cyrill Gorcunov [Tue, 6 Mar 2012 07:18:02 +0000 (6 11:18 +0400)]
test: Add br3385573 testcase

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoBR3385573: insns: Fix VPMOVSXBW
Cyrill Gorcunov [Tue, 6 Mar 2012 07:12:17 +0000 (6 11:12 +0400)]
BR3385573: insns: Fix VPMOVSXBW

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoTry again to fix our handling of MOVD/MOVQ
H. Peter Anvin [Tue, 6 Mar 2012 06:37:21 +0000 (5 22:37 -0800)]
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>
12 years agoNASM 2.10rc14nasm-2.10rc14
H. Peter Anvin [Mon, 5 Mar 2012 03:46:43 +0000 (4 19:46 -0800)]
NASM 2.10rc14

12 years agoBR3392200: preproc - Fix dangling paste term
Cyrill Gorcunov [Sun, 4 Mar 2012 09:05:55 +0000 (4 13:05 +0400)]
BR3392200: preproc - Fix dangling paste term

Backport 99a055add917fe954038885d9013f8968f76790c

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoNASM 2.10rc13nasm-2.10rc13
H. Peter Anvin [Sun, 4 Mar 2012 00:26:07 +0000 (3 16:26 -0800)]
NASM 2.10rc13

12 years agopreproc: Revert to the NASM 2.09 preprocessor
H. Peter Anvin [Sun, 4 Mar 2012 00:14:51 +0000 (3 16:14 -0800)]
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>
12 years agopreproc: Drop never used Cond structure
Cyrill Gorcunov [Wed, 29 Feb 2012 22:17:51 +0000 (1 02:17 +0400)]
preproc: Drop never used Cond structure

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoNASM 2.10rc12nasm-2.10rc12
Cyrill Gorcunov [Mon, 27 Feb 2012 07:44:33 +0000 (27 11:44 +0400)]
NASM 2.10rc12

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agodoc: Update changes
Cyrill Gorcunov [Mon, 27 Feb 2012 07:29:37 +0000 (27 11:29 +0400)]
doc: Update changes

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoBR3392200: preproc - Fix dangling paste term
Cyrill Gorcunov [Mon, 27 Feb 2012 07:11:33 +0000 (27 11:11 +0400)]
BR3392200: preproc - Fix dangling paste term

In case if there a production

{tok},{%+},{whitespace}*

the preprocessor does not delete
ending paste+spaces tokens. Fix it.

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

Reported-by: KO Myung-Hun <komh@chollian.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agonasm.spec.in: switch to .xz as the source file
H. Peter Anvin [Sun, 26 Feb 2012 16:19:56 +0000 (26 08:19 -0800)]
nasm.spec.in: switch to .xz as the source file

Switch the source file to use for the SRPM to the .xz file.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agomisc/release: do xz compression with -9e
H. Peter Anvin [Sun, 26 Feb 2012 06:49:25 +0000 (25 22:49 -0800)]
misc/release: do xz compression with -9e

Use the -9e compression level when doing xz compression.  It only
saves a few kilobytes, but since our files are pretty small it doesn't
really take all that much time.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoinsns.dat: MOV is not lockable; CMPXCHG16B does not support HLE
H. Peter Anvin [Sun, 26 Feb 2012 06:38:42 +0000 (25 22:38 -0800)]
insns.dat: MOV is not lockable; CMPXCHG16B does not support HLE

Using a LOCK prefix with MOV is not permitted.
The CMPXCHG16B instruction is not defined to support HLE.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoHLE: One more byte code conversion
H. Peter Anvin [Sun, 26 Feb 2012 06:35:19 +0000 (25 22:35 -0800)]
HLE: One more byte code conversion

Add missing site for the \265..267 -> \271..273 byte code move.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoHLE: Move byte codes back to \271-\273
H. Peter Anvin [Sun, 26 Feb 2012 06:33:46 +0000 (25 22:33 -0800)]
HLE: Move byte codes back to \271-\273

Since we are back to three bytecodes, move them back to the \271-\273
slot to free up the \264 complete quad.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoNASM 2.10rc11nasm-2.10rc11
H. Peter Anvin [Sun, 26 Feb 2012 06:23:32 +0000 (25 22:23 -0800)]
NASM 2.10rc11

12 years agoHLE: Change NOHLE to be an instruction flag
H. Peter Anvin [Sun, 26 Feb 2012 06:22:07 +0000 (25 22:22 -0800)]
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>
12 years agotag-release: actually push data out unless --no-push is given
H. Peter Anvin [Sun, 26 Feb 2012 06:02:08 +0000 (25 22:02 -0800)]
tag-release: actually push data out unless --no-push is given

Rather than just printing a list of commands, do them, unless
--no-push is given...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoNASM 2.10rc10nasm-2.10rc10
H. Peter Anvin [Sun, 26 Feb 2012 05:59:36 +0000 (25 21:59 -0800)]
NASM 2.10rc10

12 years agorelease: create .xz files; remove empty subdirectories
H. Peter Anvin [Sun, 26 Feb 2012 05:28:15 +0000 (25 21:28 -0800)]
release: create .xz files; remove empty subdirectories

Create .xz files as well as .gz and .bz2; remove empty subdirectories
from the xdoc archives.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agodoc: Remove some ugliness from the win64 section
H. Peter Anvin [Sat, 25 Feb 2012 23:50:32 +0000 (25 15:50 -0800)]
doc: Remove some ugliness from the win64 section

Clean up the formatting of the Win64 examples.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agopsfonts.ph: increase leading to font size+20%
H. Peter Anvin [Sat, 25 Feb 2012 23:46:38 +0000 (25 15:46 -0800)]
psfonts.ph: increase leading to font size+20%

Increase the leading from +10% to +20%, (12 pt leading for the 10 pt
bulk text.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agochanges: document bigendian UTF-16/UTF-32 support
H. Peter Anvin [Sat, 25 Feb 2012 23:34:14 +0000 (25 15:34 -0800)]
changes: document bigendian UTF-16/UTF-32 support

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoAdd support for UTF-16BE and UTF-32BE
H. Peter Anvin [Sat, 25 Feb 2012 23:29:37 +0000 (25 15:29 -0800)]
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>
12 years agoMake the LOCK and HLE warnings suppressable.
H. Peter Anvin [Sat, 25 Feb 2012 23:10:04 +0000 (25 15:10 -0800)]
Make the LOCK and HLE warnings suppressable.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agodoc: Document elfx32 support
H. Peter Anvin [Sat, 25 Feb 2012 23:05:45 +0000 (25 15:05 -0800)]
doc: Document elfx32 support

Document the new elfx32 backend.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agodoc: Move the EPS logo down by 1"
H. Peter Anvin [Sat, 25 Feb 2012 22:55:12 +0000 (25 14:55 -0800)]
doc: Move the EPS logo down by 1"

The default page-centered position doesn't work too well with the
title and the new logo, so move the new logo down the page a bit.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agodoc: New NASM logo
Cyrill Gorcunov [Sat, 25 Feb 2012 22:53:34 +0000 (25 14:53 -0800)]
doc: New NASM logo

Update to a new NASM logo.

12 years agodoc: Allow repositioning the EPS logo
H. Peter Anvin [Sat, 25 Feb 2012 22:51:01 +0000 (25 14:51 -0800)]
doc: Allow repositioning the EPS logo

Allow specifying an offset from the computed position of the EPS logo:

\M{logoxadj}{adjustment}
\M{logoyadj}{adjustment}

The adjustment is given in Postscript points (1/72" = 0.352778 mm) and
using the Postscript coordinate system, with the origin in the lower
left.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoUpdate copyright year to 2012
H. Peter Anvin [Sat, 25 Feb 2012 22:45:44 +0000 (25 14:45 -0800)]
Update copyright year to 2012

12 years agoNASM 2.10rc9nasm-2.10rc9
H. Peter Anvin [Sat, 25 Feb 2012 21:31:16 +0000 (25 13:31 -0800)]
NASM 2.10rc9

12 years agodoc: Document AVX2, BMI1, BMI2 and TSX support.
H. Peter Anvin [Sat, 25 Feb 2012 21:30:41 +0000 (25 13:30 -0800)]
doc: Document AVX2, BMI1, BMI2 and TSX support.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoAssume the undocumented CMPXCHG486 opcode was lockable
H. Peter Anvin [Sat, 25 Feb 2012 20:35:33 +0000 (25 12:35 -0800)]
Assume the undocumented CMPXCHG486 opcode was lockable

Someone who actually knows about this opcode and has a 486 to test on
may want to verify this.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoinsns.dat: Add IF_LOCK flag on appropriate instructions
Cyrill Gorcunov [Sat, 25 Feb 2012 20:24:43 +0000 (26 00:24 +0400)]
insns.dat: Add IF_LOCK flag on appropriate instructions

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoClean up JMP/CALL patterns, especially for 64 bits
H. Peter Anvin [Sat, 25 Feb 2012 20:05:53 +0000 (25 12:05 -0800)]
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>
12 years agoinsns.dat: Add nohle for MOV in case of moffset destination
Cyrill Gorcunov [Sat, 25 Feb 2012 20:07:27 +0000 (26 00:07 +0400)]
insns.dat: Add nohle for MOV in case of moffset destination

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hlexr flag for MOV instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:51:10 +0000 (25 23:51 +0400)]
insns.dat: Add hlexr flag for MOV instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hlenl flag for XCHG instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:46:16 +0000 (25 23:46 +0400)]
insns.dat: Add hlenl flag for XCHG instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for XADD instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:42:14 +0000 (25 23:42 +0400)]
insns.dat: Add hle flag for XADD instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for XOR instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:41:11 +0000 (25 23:41 +0400)]
insns.dat: Add hle flag for XOR instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for SUB instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:39:44 +0000 (25 23:39 +0400)]
insns.dat: Add hle flag for SUB instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for SBB instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:37:58 +0000 (25 23:37 +0400)]
insns.dat: Add hle flag for SBB instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for OR instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:36:24 +0000 (25 23:36 +0400)]
insns.dat: Add hle flag for OR instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for NOT instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:34:55 +0000 (25 23:34 +0400)]
insns.dat: Add hle flag for NOT instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for NEG instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:34:24 +0000 (25 23:34 +0400)]
insns.dat: Add hle flag for NEG instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for INC instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:33:24 +0000 (25 23:33 +0400)]
insns.dat: Add hle flag for INC instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for DEC instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:32:31 +0000 (25 23:32 +0400)]
insns.dat: Add hle flag for DEC instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for CMPXCHG16B instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:30:32 +0000 (25 23:30 +0400)]
insns.dat: Add hle flag for CMPXCHG16B instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for CMPXCHG8B instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:28:58 +0000 (25 23:28 +0400)]
insns.dat: Add hle flag for CMPXCHG8B instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for CMPXCHG instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:18:36 +0000 (25 23:18 +0400)]
insns.dat: Add hle flag for CMPXCHG instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for BTS instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:17:23 +0000 (25 23:17 +0400)]
insns.dat: Add hle flag for BTS instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for BTR instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:16:48 +0000 (25 23:16 +0400)]
insns.dat: Add hle flag for BTR instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for BTC instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:15:40 +0000 (25 23:15 +0400)]
insns.dat: Add hle flag for BTC instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for AND instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:13:25 +0000 (25 23:13 +0400)]
insns.dat: Add hle flag for AND instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for ADC instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:10:17 +0000 (25 23:10 +0400)]
insns.dat: Add hle flag for ADC instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add hle flag for ADD instruction
Cyrill Gorcunov [Sat, 25 Feb 2012 19:04:32 +0000 (25 23:04 +0400)]
insns.dat: Add hle flag for ADD instruction

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agodisasm: ignore opcodes 370 and 371
H. Peter Anvin [Sat, 25 Feb 2012 19:46:56 +0000 (25 11:46 -0800)]
disasm: ignore opcodes 370 and 371

12 years agoRemove all remaining explicit bytecodes from insns.dat
H. Peter Anvin [Sat, 25 Feb 2012 19:41:34 +0000 (25 11:41 -0800)]
Remove all remaining explicit bytecodes from insns.dat

Get rid of the last vestiges of the explicit byte codes in insns.dat.
The only files that now depend on actual byte code numbers are
insns.pl, assemble.c and disasm.c.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoAdd support for warning on invalid LOCK prefixes
H. Peter Anvin [Sat, 25 Feb 2012 19:11:42 +0000 (25 11:11 -0800)]
Add support for warning on invalid LOCK prefixes

Add an LOCK flag to the instruction template, and make the presence of
a LOCK prefix trigger a warning if it is not set.  Simplify the LOCK
and HLE logic by hard-coding the knowledge that operand 0 has to be
memory.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoMove HLE byte codes to \264..\267
H. Peter Anvin [Sat, 25 Feb 2012 18:24:24 +0000 (25 10:24 -0800)]
Move HLE byte codes to \264..\267

Move the HLE byte codes to \264..\267 so as not to break up an unused
group of 8 (\240..\247).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoAdd a "nohle" byte code to skip an instruction pattern
H. Peter Anvin [Sat, 25 Feb 2012 18:19:56 +0000 (25 10:19 -0800)]
Add a "nohle" byte code to skip an instruction pattern

The a2/a3 mem_offs MOV opcodes are invalid with XRELEASE; those
instructions instead have to use a modrm form.  Therefore give a way
to annotate those instruction patters so the pattern matcher will move
on to the next pattern, rather than selecting them and then issue a
warning.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoinsns.pl: Bundle all "plain bytecodes" into a hash
H. Peter Anvin [Sat, 25 Feb 2012 06:06:39 +0000 (24 22:06 -0800)]
insns.pl: Bundle all "plain bytecodes" into a hash

Instead of a long string of ifs, put all the plain opcodes which just
turn into single bytecodes with no other effect into a hash.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoHLE: Implement the basic mechanism for XACQUIRE/XRELEASE
H. Peter Anvin [Sat, 25 Feb 2012 05:51:46 +0000 (24 21:51 -0800)]
HLE: Implement the basic mechanism for XACQUIRE/XRELEASE

This implements the mechanism for XACQUIRE/XRELEASE.  It does not
include the necessary annotations in insns.dat.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agonasm.c: Fix is_suppressed_warning()
H. Peter Anvin [Sat, 25 Feb 2012 05:50:53 +0000 (24 21:50 -0800)]
nasm.c: Fix is_suppressed_warning()

The logic in is_suppressed_warning() was severely wrong, which would
cause a lot of legitimate warnings to be suppressed while some
warnings would be duplicated.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoHLE: Split the LOCK and REP prefix slots
H. Peter Anvin [Sat, 25 Feb 2012 04:57:04 +0000 (24 20:57 -0800)]
HLE: Split the LOCK and REP prefix slots

With HLE, the sequence REP LOCK actually makes sense, so support it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoinsns: create a symbolic "wait" token for the \341 byte code
H. Peter Anvin [Fri, 10 Feb 2012 19:11:08 +0000 (10 11:11 -0800)]
insns: create a symbolic "wait" token for the \341 byte code

Create a symbolic name "wait" for the \341 byte code, so we don't have
to open-code it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoinsns: fix IMUL patterns to get rid of open-coded \100 bytecodes
H. Peter Anvin [Fri, 10 Feb 2012 19:08:09 +0000 (10 11:08 -0800)]
insns: fix IMUL patterns to get rid of open-coded \100 bytecodes

There already is a standard encoding for "use this operand in multiple
slots"; no need to open-code it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoinsns: correct the TSX opcodes
H. Peter Anvin [Fri, 10 Feb 2012 00:24:32 +0000 (9 16:24 -0800)]
insns: correct the TSX opcodes

All except XTEST are RTM, not HLE; XBEGIN is like a JMP or CALL.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoinsns: Add AVX2 transactional synchronization extensions
Cyrill Gorcunov [Thu, 9 Feb 2012 22:11:22 +0000 (10 02:11 +0400)]
insns: Add AVX2 transactional synchronization extensions

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns: replace open-coded \322 opcode with odf (operand default)
H. Peter Anvin [Fri, 10 Feb 2012 00:20:21 +0000 (9 16:20 -0800)]
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>
12 years agobackend: add support for x32 ELF
H.J. Lu [Fri, 3 Feb 2012 20:06:04 +0000 (3 12:06 -0800)]
backend: add support for x32 ELF

Add an x32 ELF (32-bit code with the CPU in 64-bit mode) backend.

12 years agoBR 3463230: Add VMFUNC instruction
H. Peter Anvin [Wed, 21 Dec 2011 16:26:48 +0000 (21 08:26 -0800)]
BR 3463230: Add VMFUNC instruction

Add VMFUNC instruction from the Intel SDM version 041.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoinsns: Fix up sizes for MOVSD and VMOVSS instructions
Cyrill Gorcunov [Sat, 17 Dec 2011 08:09:02 +0000 (17 12:09 +0400)]
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>
12 years agoDon't forget to setup warning levels on preprocessor phase
Cyrill Gorcunov [Sun, 4 Dec 2011 21:56:40 +0000 (5 01:56 +0400)]
Don't forget to setup warning levels on preprocessor phase

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

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoDrop tab/space mess from parse_cmdline
Cyrill Gorcunov [Sun, 4 Dec 2011 21:44:43 +0000 (5 01:44 +0400)]
Drop tab/space mess from parse_cmdline

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>