Commit Graph

2630 Commits

Author SHA1 Message Date
Cyrill Gorcunov
c7ce6a4f22 process_ea: Drop redundant variable
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-03-02 02:45:53 +04:00
Ben Rudiak-Gould
4e8396b5cf 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>
2013-03-01 10:28:32 +04:00
Andrew Nayenko
57162eb084 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>
2013-02-25 01:08:00 +04:00
Andrew Nayenko
842512c527 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>
2013-02-21 02:36:57 +04:00
Ben Rudiak-Gould
bf0f42390d 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>
2013-02-20 23:25:59 +04:00
Ben Rudiak-Gould
d7ab1f9638 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>
2013-02-20 23:25:54 +04:00
Cyrill Gorcunov
71ba1f0e7b eval: Use is_power2 helper instead of open code
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-18 01:38:11 +04:00
Cyrill Gorcunov
1930007f3f make: Don't forget to generate manpage for all target
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-18 01:31:59 +04:00
Cyrill Gorcunov
1a63699ce5 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>
2013-02-17 22:50:19 +04:00
Cyrill Gorcunov
a709e767f6 Update .gitignore
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-17 22:47:28 +04:00
Cyrill Gorcunov
190232f013 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>
2013-02-15 12:35:04 +04:00
Cyrill Gorcunov
f187eb7788 nasm.c: Update year in header
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15 12:25:33 +04:00
Cyrill Gorcunov
52405e3727 nasm.c: Tabs to spaces in emit_dependencies
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15 12:25:04 +04:00
Cyrill Gorcunov
9f56369883 nasm.c: Tabs to spaces in main
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15 12:24:11 +04:00
Cyrill Gorcunov
45aa118fdf nasm.c: Tabs to spaces in copy_filename
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15 12:22:59 +04:00
Cyrill Gorcunov
f831645ed8 nasm.c: Tabs to spaces in copy_filename
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15 12:22:27 +04:00
Cyrill Gorcunov
331fd7c8aa nasm.c: Tabs to spaces in process_arg
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15 12:20:58 +04:00
Cyrill Gorcunov
f196451d66 nasm.c: Tabs to spaces in process_response_file
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15 12:14:06 +04:00
Cyrill Gorcunov
1476319ced nasm.c: Tabs to spaces in assemble_file
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15 12:13:09 +04:00
Cyrill Gorcunov
04dba65098 nasm.c: Tabs to spaces in nasm_verror_gnu
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15 02:21:07 +04:00
Cyrill Gorcunov
22ad904341 nasm.c: Tabs to spaces in nasm_verror_common
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15 02:20:26 +04:00
Cyrill Gorcunov
cdaae1a8e3 nasm.c: Tabs to spaces in define_macros_early
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15 02:16:58 +04:00
Cyrill Gorcunov
d59b2602b3 Drop trailing space from directive.pl
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15 02:09:16 +04:00
Cyrill Gorcunov
3539225609 Align enum prefixes members
It's a way easier to read.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-15 02:06:24 +04:00
Cyrill Gorcunov
8b5c9fba4e 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>
2013-02-04 10:18:21 +04:00
Cyrill Gorcunov
7c88b3a9d7 NASM 2.10.07 2013-01-02 12:42:01 +04:00
Cyrill Gorcunov
6cdebb463f docs: Update changes
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-12-27 20:28:02 +04:00
Cyrill Gorcunov
490f85e73d br3392236: Don't treat \Space after \BackSlash as a sign for line continuation
In commit f1fe4fdeab I occasionally
made a \Space after \BackSlash being a sign of line continuation.

Fix it.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-12-27 20:04:28 +04:00
H. Peter Anvin
74ebbde14c NASM 2.10.06 2012-12-04 13:38:36 -08:00
H. Peter Anvin
f2ded5051d changes: document fix of macho64
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2012-12-04 13:36:42 -08:00
Keith Kanios
0863bc386b BR3392232: Fix relocations in MachO64
Signed-off-by: Keith Kanios <keith@kanios.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-11-28 20:05:20 +04:00
Cyrill Gorcunov
5fa17e8398 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>
2012-11-16 22:57:07 +04:00
Cyrill Gorcunov
7ce86b500c 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>
2012-11-06 00:47:20 +04:00
Cyrill Gorcunov
f1fe4fdeab 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>
2012-10-27 20:56:59 +04:00
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 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 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
89a38dac36, apparently by mistake.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-08-17 15:41:34 -07:00