platform/upstream/nasm.git
11 years agoBR3392244: docs -- Fix "respectively" typo
Cyrill Gorcunov [Sun, 28 Apr 2013 11:07:38 +0000 (15:07 +0400)]
BR3392244: docs -- Fix "respectively" typo

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoBR3392248: Update nasm -h output
Cyrill Gorcunov [Sat, 20 Apr 2013 16:37:17 +0000 (20:37 +0400)]
BR3392248: Update nasm -h output

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoBR3392248: Update nasm manual
Cyrill Gorcunov [Sat, 20 Apr 2013 16:24:01 +0000 (20:24 +0400)]
BR3392248: Update nasm manual

Add -W description

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agondisasm: man -- Add missing -p option
Cyrill Gorcunov [Sat, 20 Apr 2013 16:18:46 +0000 (20:18 +0400)]
ndisasm: man -- Add missing -p option

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoBR3392248: Update ndisasm man
Cyrill Gorcunov [Sat, 20 Apr 2013 16:14:45 +0000 (20:14 +0400)]
BR3392248: Update ndisasm man

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoBR3392248: Update ndisasm man
Cyrill Gorcunov [Sat, 20 Apr 2013 16:13:51 +0000 (20:13 +0400)]
BR3392248: Update ndisasm man

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoBR3392248: Update nasm manual
Cyrill Gorcunov [Sat, 20 Apr 2013 16:10:15 +0000 (20:10 +0400)]
BR3392248: Update nasm manual

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoFixed two more resource leaks in rdoff/rdlib.c
Philipp Kloke [Sun, 31 Mar 2013 10:20:10 +0000 (12:20 +0200)]
Fixed two more resource leaks in rdoff/rdlib.c

Signed-off-by: Philipp Kloke <philipp.kloke@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoFixed three possible buffer overflows
Philipp Kloke [Sun, 31 Mar 2013 10:03:47 +0000 (12:03 +0200)]
Fixed three possible buffer overflows

Bug found by: CppCheck 1.59 (static source analysis tool)

Signed-off-by: Philipp Kloke <philipp.kloke@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoFixed several resource and memory leaks
Philipp Kloke [Sun, 31 Mar 2013 10:02:30 +0000 (12:02 +0200)]
Fixed several resource and memory leaks

Bug found by: CppCheck 1.59 (static source analysis tool)

Signed-off-by: Philipp Kloke <philipp.kloke@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoFixed wrong/redundant comparison according to documentation in comment above.
Philipp Kloke [Sun, 31 Mar 2013 10:01:23 +0000 (12:01 +0200)]
Fixed wrong/redundant comparison according to documentation in comment above.

Bug found by: CppCheck 1.59 (static source analysis tool)

Signed-off-by: Philipp Kloke <philipp.kloke@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoFixed wrong format specifier in format string
Philipp Kloke [Sun, 31 Mar 2013 10:00:09 +0000 (12:00 +0200)]
Fixed wrong format specifier in format string

Signed-off-by: Philipp Kloke <philipp.kloke@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoRemove unnecessary calls to memset
Philipp Kloke [Sun, 31 Mar 2013 09:59:22 +0000 (11:59 +0200)]
Remove unnecessary calls to memset

The C standard guarantees that strncpy pads
the string with zeros if source string is smaller
than destination buffer.

Signed-off-by: Philipp Kloke <philipp.kloke@web.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoMake F2 and F3 SSE prefixes override 66
Ben Rudiak-Gould [Sun, 10 Mar 2013 17:46:12 +0000 (21:46 +0400)]
Make F2 and F3 SSE prefixes override 66

According to XED and experimentation, the 66 is ignored.

Signed-off-by: Ben Rudiak-Gould <benrudiak@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoDrop SAME_AS flag from instruction matcher
Ben Rudiak-Gould [Wed, 27 Feb 2013 18:13:14 +0000 (10:13 -0800)]
Drop SAME_AS flag from instruction matcher

It was there to support the SSE5 DREX encoding,
which as far as I know is dead forever.

Signed-off-by: Ben Rudiak-Gould <benrudiak@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoinsns: Remove pushseg/popseg internal bytecodes
Ben Rudiak-Gould [Sun, 3 Mar 2013 14:43:07 +0000 (18:43 +0400)]
insns: Remove pushseg/popseg internal bytecodes

This patch is getting rid of the following bytecodes
'pushseg','popseg','pushseg2','popseg2' and simplifies
overall code.

[gorcunov@: a few style fixes]
Signed-off-by: Ben Rudiak-Gould <benrudiak@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoMove conditional opcodes close to enum ccode definition
Cyrill Gorcunov [Sun, 3 Mar 2013 10:34:31 +0000 (14:34 +0400)]
Move conditional opcodes close to enum ccode definition

Thus if someone need to rework this code he won't need
to jump between files trying to figure out where enum
and opcodes lay.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoinsns.pl: Various style polyshing
Cyrill Gorcunov [Fri, 1 Mar 2013 22:57:58 +0000 (02:57 +0400)]
insns.pl: Various style polyshing

 - convert tabs to spaces
 - align octal opcodes

No func changes.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoassemble: Make emit_rex being a function
Cyrill Gorcunov [Fri, 1 Mar 2013 22:48:23 +0000 (02:48 +0400)]
assemble: Make emit_rex being a function

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoassemble: Use case3/4 where appropriate
Cyrill Gorcunov [Sat, 1 Dec 2012 22:51:18 +0000 (02:51 +0400)]
assemble: Use case3/4 where appropriate

This allows to shrink code a bit.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoassemble: Add case3 helper
Cyrill Gorcunov [Sat, 1 Dec 2012 22:47:16 +0000 (02:47 +0400)]
assemble: Add case3 helper

Signed-off-by: cyrill <cyrill@cyrills-MacBook-Pro.local>
11 years agoprocess_ea: Drop redundant variable
Cyrill Gorcunov [Sat, 1 Dec 2012 15:38:47 +0000 (19:38 +0400)]
process_ea: Drop redundant variable

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoRemove +s
Ben Rudiak-Gould [Fri, 1 Mar 2013 06:28:32 +0000 (10:28 +0400)]
Remove +s

It doesn't seem worth >200 lines of C and Perl to save ~50 lines in insns.dat.

In order to make this work I had to rename sbyte16/sbyte32 so that
they can take an ordinary size suffix (their size suffix was formerly
treated specially).

This fixes one disassembly bug: 48C7C000000080 disassembles to mov
rax,0x80000000, which reassembles to B800000080, which loads a
different value.

Signed-off-by: Ben Rudiak-Gould <benrudiak@gmail.com>
Acked-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoFix warnings generated by clang 3.0
Andrew Nayenko [Sun, 24 Feb 2013 19:08:40 +0000 (23:08 +0400)]
Fix warnings generated by clang 3.0

Fix warnings like this:

output/outelf32.c:2120:33: warning: equality comparison with extraneous
      parentheses [-Wparentheses-equality]
            if ((match->section == index)) {
                 ~~~~~~~~~~~~~~~^~~~~~~~
output/outelf32.c:2120:33: note: remove extraneous parentheses around the
      comparison to silence this warning
            if ((match->section == index)) {
                ~               ^       ~
output/outelf32.c:2120:33: note: use '=' to turn this equality comparison into
      an assignment
            if ((match->section == index)) {
                                ^~
                                =
1 warning generated.

Signed-off-by: Andrew Nayenko <resver@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoBR3392242: insns.dat -- Support AMD SVM instructions in 32bit mode
Andrew Nayenko [Wed, 20 Feb 2013 22:36:57 +0000 (02:36 +0400)]
BR3392242: insns.dat -- Support AMD SVM instructions in 32bit mode

AMD CPUs do support SVM instructions in 32-bit mode thus drop X64
restriction from instructions template where appropriate.

Signed-off-by: Andrew Nayenko <resver@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoFix jmp/call near offsets in long mode
Ben Rudiak-Gould [Wed, 20 Feb 2013 19:25:59 +0000 (23:25 +0400)]
Fix jmp/call near offsets in long mode

In long mode relative offsets are always 32 bits sign-extended to 64
bits and absolute near addresses are always 64 bits, regardless of the
operand size.

Signed-off-by: Ben Rudiak-Gould <benrudiak@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoAdd np and similar prefixes to instructions that should have them
Ben Rudiak-Gould [Wed, 20 Feb 2013 19:25:54 +0000 (23:25 +0400)]
Add np and similar prefixes to instructions that should have them

This adds "np" to a bunch of SSE-style instructions that should have
it, "norep" (which was implemented but unused) on quasi-SSE instructions
that use F2 and F3 as instruction extensions but 66 for operand size,
"nof3" (newly implemented) on a few instructions, "norexw" on some
instructions that have only 32-bit and 64-bit versions, and one NOLONG.

It also removes some incorrect "np"s, changes some "f3"s to "f3i"s,
and fixes the decoding of the XCHG/NOP/PAUSE mess: F390 is always
PAUSE even when rex.b=1 (at least according to XED).

Signed-off-by: Ben Rudiak-Gould <benrudiak@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoeval: Use is_power2 helper instead of open code
Cyrill Gorcunov [Sun, 17 Feb 2013 21:38:11 +0000 (01:38 +0400)]
eval: Use is_power2 helper instead of open code

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agomake: Don't forget to generate manpage for all target
Cyrill Gorcunov [Sun, 17 Feb 2013 21:31:59 +0000 (01:31 +0400)]
make: Don't forget to generate manpage for all target

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoman: Generate manpages from asciidoc format
Cyrill Gorcunov [Sun, 17 Feb 2013 18:50:19 +0000 (22:50 +0400)]
man: Generate manpages from asciidoc format

The asciidoc format is a way more easier to read
by a human.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoUpdate .gitignore
Cyrill Gorcunov [Sun, 17 Feb 2013 18:47:28 +0000 (22:47 +0400)]
Update .gitignore

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agonasm.c: Convert GET_CURR_OFFS/SET_CURR_OFFS to functions
Cyrill Gorcunov [Fri, 15 Feb 2013 08:35:04 +0000 (12:35 +0400)]
nasm.c: Convert GET_CURR_OFFS/SET_CURR_OFFS to functions

In future better to not work with global variables but
rather pass arguments.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agonasm.c: Update year in header
Cyrill Gorcunov [Fri, 15 Feb 2013 08:25:33 +0000 (12:25 +0400)]
nasm.c: Update year in header

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agonasm.c: Tabs to spaces in emit_dependencies
Cyrill Gorcunov [Fri, 15 Feb 2013 08:25:04 +0000 (12:25 +0400)]
nasm.c: Tabs to spaces in emit_dependencies

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agonasm.c: Tabs to spaces in main
Cyrill Gorcunov [Fri, 15 Feb 2013 08:24:11 +0000 (12:24 +0400)]
nasm.c: Tabs to spaces in main

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agonasm.c: Tabs to spaces in copy_filename
Cyrill Gorcunov [Fri, 15 Feb 2013 08:22:59 +0000 (12:22 +0400)]
nasm.c: Tabs to spaces in copy_filename

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agonasm.c: Tabs to spaces in copy_filename
Cyrill Gorcunov [Fri, 15 Feb 2013 08:22:27 +0000 (12:22 +0400)]
nasm.c: Tabs to spaces in copy_filename

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agonasm.c: Tabs to spaces in process_arg
Cyrill Gorcunov [Fri, 15 Feb 2013 08:20:58 +0000 (12:20 +0400)]
nasm.c: Tabs to spaces in process_arg

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agonasm.c: Tabs to spaces in process_response_file
Cyrill Gorcunov [Fri, 15 Feb 2013 08:14:06 +0000 (12:14 +0400)]
nasm.c: Tabs to spaces in process_response_file

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agonasm.c: Tabs to spaces in assemble_file
Cyrill Gorcunov [Fri, 15 Feb 2013 08:13:09 +0000 (12:13 +0400)]
nasm.c: Tabs to spaces in assemble_file

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agonasm.c: Tabs to spaces in nasm_verror_gnu
Cyrill Gorcunov [Thu, 14 Feb 2013 22:21:07 +0000 (02:21 +0400)]
nasm.c: Tabs to spaces in nasm_verror_gnu

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agonasm.c: Tabs to spaces in nasm_verror_common
Cyrill Gorcunov [Thu, 14 Feb 2013 22:20:26 +0000 (02:20 +0400)]
nasm.c: Tabs to spaces in nasm_verror_common

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agonasm.c: Tabs to spaces in define_macros_early
Cyrill Gorcunov [Thu, 14 Feb 2013 22:16:58 +0000 (02:16 +0400)]
nasm.c: Tabs to spaces in define_macros_early

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoDrop trailing space from directive.pl
Cyrill Gorcunov [Thu, 14 Feb 2013 22:09:16 +0000 (02:09 +0400)]
Drop trailing space from directive.pl

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoAlign enum prefixes members
Cyrill Gorcunov [Thu, 14 Feb 2013 22:06:24 +0000 (02:06 +0400)]
Align enum prefixes members

It's a way easier to read.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoBR3392240: preproc: Don't fail on pasting of space expanded rvalue tokens
Cyrill Gorcunov [Sun, 3 Feb 2013 21:24:54 +0000 (01:24 +0400)]
BR3392240: preproc: Don't fail on pasting of space expanded rvalue tokens

Reported-by: KO Myung-Hun <komh@chollian.net>
Tested-by: KO Myung-Hun <komh@chollian.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoNASM 2.10.07
Cyrill Gorcunov [Wed, 2 Jan 2013 08:42:01 +0000 (12:42 +0400)]
NASM 2.10.07

11 years agodocs: Update changes
Cyrill Gorcunov [Thu, 27 Dec 2012 16:28:02 +0000 (20:28 +0400)]
docs: Update changes

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agobr3392236: Don't treat \Space after \BackSlash as a sign for line continuation
Cyrill Gorcunov [Thu, 27 Dec 2012 16:02:17 +0000 (20:02 +0400)]
br3392236: Don't treat \Space after \BackSlash as a sign for line continuation

In commit f1fe4fdeabeaf2e5e4d02ef43beeb09a6fbfed1b I occasionally
made a \Space after \BackSlash being a sign of line continuation.

Fix it.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoNASM 2.10.06
H. Peter Anvin [Tue, 4 Dec 2012 21:38:36 +0000 (13:38 -0800)]
NASM 2.10.06

11 years agochanges: document fix of macho64
H. Peter Anvin [Tue, 4 Dec 2012 21:36:42 +0000 (13:36 -0800)]
changes: document fix of macho64

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
11 years agoBR3392232: Fix relocations in MachO64
Keith Kanios [Wed, 28 Nov 2012 16:05:20 +0000 (20:05 +0400)]
BR3392232: Fix relocations in MachO64

Signed-off-by: Keith Kanios <keith@kanios.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agooutput: Add more Elf unification
Cyrill Gorcunov [Fri, 16 Nov 2012 18:57:07 +0000 (22:57 +0400)]
output: Add more Elf unification

One day the elf output routines would be abstracted
enough to be merged in one file. This patch simply
removes some differences from elf32/64 code.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoBR3392231: Fix get_closest_section_symbol_by_offset
Cyrill Gorcunov [Mon, 5 Nov 2012 20:47:20 +0000 (00:47 +0400)]
BR3392231: Fix get_closest_section_symbol_by_offset

This patch changes get_closest_section_symbol_by_offset
logic to lookup only the closest symbols which are at
or before the supplied offset.

Signed-off-by: Keith Kanios <keith@kanios.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoBR3392226 preproc: Rework line readin procedure
Cyrill Gorcunov [Sat, 27 Oct 2012 15:27:18 +0000 (19:27 +0400)]
BR3392226 preproc: Rework line readin procedure

It's been reported that we handle MacOS eol wrong.
This patch fixes the problem.

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

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agodoc/changes.src: Update to include recent changes.
H. Peter Anvin [Mon, 8 Oct 2012 04:05:59 +0000 (12:05 +0800)]
doc/changes.src: Update to include recent changes.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
11 years agoBR 3327107: fix assembly of VPCMPGTQ
Marat Dukhan [Mon, 8 Oct 2012 04:02:34 +0000 (12:02 +0800)]
BR 3327107: fix assembly of VPCMPGTQ

Fix incorrect instruction encoding for VPCMPGTQ.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
11 years agoinsns.dat: Mark the immediate for shift instructions as imm8
H. Peter Anvin [Wed, 26 Sep 2012 05:51:40 +0000 (22:51 -0700)]
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>
11 years agoBR 3392227: Remove SB flag from SHIFT rm,imm
H. Peter Anvin [Wed, 26 Sep 2012 05:45:35 +0000 (22:45 -0700)]
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>
11 years agoopflags: Rework opflags bits with OP_ macros
Cyrill Gorcunov [Sat, 15 Sep 2012 16:01:32 +0000 (20:01 +0400)]
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>
11 years agoopflags: Introduce opflags generating macros
Cyrill Gorcunov [Sat, 15 Sep 2012 15:58:36 +0000 (19:58 +0400)]
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>
11 years agoopflags: Drop never used REG_RIP/REG_EIP
Cyrill Gorcunov [Sat, 15 Sep 2012 12:52:32 +0000 (16:52 +0400)]
opflags: Drop never used REG_RIP/REG_EIP

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
11 years agoWhen generate dependency names internally, quote filenames
H. Peter Anvin [Mon, 10 Sep 2012 00:09:00 +0000 (17:09 -0700)]
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>
11 years agochanges.src: fix grammar error (support -> supports)
H. Peter Anvin [Sun, 9 Sep 2012 23:30:07 +0000 (16:30 -0700)]
changes.src: fix grammar error (support -> supports)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
11 years agoopflags: Extend opflags_t to 64 bits
Cyrill Gorcunov [Sun, 9 Sep 2012 20:19:12 +0000 (00:19 +0400)]
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>
11 years agoNASM 2.10.05
H. Peter Anvin [Sun, 9 Sep 2012 20:21:11 +0000 (13:21 -0700)]
NASM 2.10.05

11 years agochanges.src: Document CLAC/STAC
H. Peter Anvin [Sun, 9 Sep 2012 18:05:35 +0000 (11:05 -0700)]
changes.src: Document CLAC/STAC

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
11 years agoAdd CLAC and STAC instructions from AVX spec 014 (319433-014)
H. Peter Anvin [Sun, 9 Sep 2012 18:03:12 +0000 (11:03 -0700)]
Add CLAC and STAC instructions from AVX spec 014 (319433-014)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
11 years agoNASM 2.10.04
H. Peter Anvin [Sat, 18 Aug 2012 18:02:19 +0000 (11:02 -0700)]
NASM 2.10.04

11 years agochanges.src: List of changes for the next release
H. Peter Anvin [Fri, 17 Aug 2012 22:42:24 +0000 (15:42 -0700)]
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>
11 years agoAdd back the 256-bit form of the VORPD instruction
H. Peter Anvin [Fri, 17 Aug 2012 22:41:34 +0000 (15:41 -0700)]
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>
11 years agoBR 3392207: preproc: Rewrite paste_tokens routine
Cyrill Gorcunov [Sat, 4 Aug 2012 06:51:58 +0000 (10:51 +0400)]
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>
11 years agoBR 3392218: Disassemble 82h opcodes
H. Peter Anvin [Sat, 28 Jul 2012 22:28:48 +0000 (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>
12 years agoNASM 2.10.03
H. Peter Anvin [Mon, 23 Jul 2012 04:09:20 +0000 (21:09 -0700)]
NASM 2.10.03

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

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

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

ilog2*() and new instructions.

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

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 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 (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>
12 years agoinsns.dat: new instructions from the 013 AVX spec
H. Peter Anvin [Fri, 13 Jul 2012 07:58:20 +0000 (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>
12 years agotest: ilog2() test
H. Peter Anvin [Thu, 31 May 2012 17:28:00 +0000 (10:28 -0700)]
test: ilog2() test

Test for the ilog2 function/macros.

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

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

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
12 years agoinsns.dat: Add VPMOVMSKB reg32,ymmreg instruction
Cyrill Gorcunov [Thu, 24 May 2012 19:39:00 +0000 (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 (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 (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 (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 (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 (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 (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.10
H. Peter Anvin [Mon, 12 Mar 2012 20:36:02 +0000 (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 (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: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.10rc15
H. Peter Anvin [Sat, 10 Mar 2012 00:43:37 +0000 (16:43 -0800)]
NASM 2.10rc15

12 years agotest: Add br3385573 testcase
Cyrill Gorcunov [Tue, 6 Mar 2012 07:18:02 +0000 (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 (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 (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.10rc14
H. Peter Anvin [Mon, 5 Mar 2012 03:46:43 +0000 (19:46 -0800)]
NASM 2.10rc14