2612 Commits

Author SHA1 Message Date
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 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 f1fe4fdeabeaf2e5e4d02ef43beeb09a6fbfed1b 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 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 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