platform/upstream/nasm.git
15 years agoparser.c: fix stylistic nitpick
H. Peter Anvin [Sat, 27 Jun 2009 23:26:25 +0000 (16:26 -0700)]
parser.c: fix stylistic nitpick

Fix stray blank line in parser.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoassemble.c: stylistic nitpick
H. Peter Anvin [Sat, 27 Jun 2009 23:14:18 +0000 (16:14 -0700)]
assemble.c: stylistic nitpick

Fix stylistic nitpick

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agopreproc: use %if 0 instead of %ifdef BOGUS
H. Peter Anvin [Sat, 27 Jun 2009 22:56:27 +0000 (15:56 -0700)]
preproc: use %if 0 instead of %ifdef BOGUS

When processing an unparsable TASM argument, convert it to %if 0 which
is guaranteed to not happen, rather than %ifdef BOGUS.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agohashtbl: make hash_iterate() not crash on an uninitalized table
H. Peter Anvin [Sat, 27 Jun 2009 22:54:25 +0000 (15:54 -0700)]
hashtbl: make hash_iterate() not crash on an uninitalized table

Trying to walk an uninitialized table (->table == NULL) should just
return nothing.  This can happen due when pp_cleanup() is called after
a failure.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agonasm.c: clean up pass exit logic
H. Peter Anvin [Sat, 27 Jun 2009 22:34:32 +0000 (15:34 -0700)]
nasm.c: clean up pass exit logic

Clean up the pass exit logic.  In particular, we had a whole routine
to do the same thing that the normal exit logic would do anyway if we
only would actually get there.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agondisasm: fix disassembly of JRCXZ
H. Peter Anvin [Fri, 26 Jun 2009 23:18:00 +0000 (16:18 -0700)]
ndisasm: fix disassembly of JRCXZ

Fix the disassembly of JRCXZ; in 64-bit mode, we should only accept
JECXZ for disassembly with 32-bit address size override.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.06rc14
H. Peter Anvin [Fri, 26 Jun 2009 22:15:46 +0000 (15:15 -0700)]
NASM 2.06rc14

15 years agoinsns.dat: reformat
H. Peter Anvin [Fri, 26 Jun 2009 22:14:58 +0000 (15:14 -0700)]
insns.dat: reformat

Reformat insns.dat with standard formatting

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoinsns.dat: add relaxed forms for XOP/FMA4/CVT16 instructions
H. Peter Anvin [Fri, 26 Jun 2009 22:13:36 +0000 (15:13 -0700)]
insns.dat: add relaxed forms for XOP/FMA4/CVT16 instructions

Add relaxed forms of the XOP/FMA4/CVT16 instructions, without looking
too hard at if it makes sense.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoAdd Cyrill Gorcunov to AUTHORS
H. Peter Anvin [Fri, 26 Jun 2009 21:57:33 +0000 (14:57 -0700)]
Add Cyrill Gorcunov to AUTHORS

15 years agoinsns.pl: remove stray whitespace
H. Peter Anvin [Fri, 26 Jun 2009 06:18:06 +0000 (23:18 -0700)]
insns.pl: remove stray whitespace

Clean up whitespace in insns.pl.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoinsns.pl: add "nohi" code for REX_NH
H. Peter Anvin [Fri, 26 Jun 2009 06:16:17 +0000 (23:16 -0700)]
insns.pl: add "nohi" code for REX_NH

Add a "nohi" code flag for the \325 byte code, which sets the REX_NH
flag.  That is, REX_P not required to support high registers, high
registers are not supported and spl/bpl/sil/dil enabled even in
non-64-bit mode.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoinsns.pl: fix indentation
H. Peter Anvin [Fri, 26 Jun 2009 06:14:36 +0000 (23:14 -0700)]
insns.pl: fix indentation

Canonicalize indentation of some blocks.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoELF: make debugging functions static
H. Peter Anvin [Fri, 26 Jun 2009 00:43:54 +0000 (17:43 -0700)]
ELF: make debugging functions static

The debugging functions can and should all be static.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoELF: remove loop invariant calculation of global offset
H. Peter Anvin [Fri, 26 Jun 2009 00:30:58 +0000 (17:30 -0700)]
ELF: remove loop invariant calculation of global offset

The global symbol offset is a loop invariant; no need to compute it
over and over.  The compiler probably will not be able to do this for
us due to global variables and function calls.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoELF: clean up the arithmetic for global symbols
H. Peter Anvin [Fri, 26 Jun 2009 00:26:43 +0000 (17:26 -0700)]
ELF: clean up the arithmetic for global symbols

Clean up the arithmetic for global symbols; in particular, make it
clear where the dependency on the debug format comes from (DWARF needs
three symbol table entries all by itself.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoELF: bump GLOBAL_TEMP_BASE
H. Peter Anvin [Fri, 26 Jun 2009 00:25:35 +0000 (17:25 -0700)]
ELF: bump GLOBAL_TEMP_BASE

Bump GLOBAL_TEMP_BASE so far that it *cannot* conflict for ELF32
(which has 24-bit symbol table indicies) and is *unlikely* to conflict
for ELF64 (which has 32-bit symbol table indicies.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoELF: eliminate hard-coded section numbers
H. Peter Anvin [Thu, 25 Jun 2009 21:54:44 +0000 (14:54 -0700)]
ELF: eliminate hard-coded section numbers

Eliminiate hard-coded section numbers, at least to the best of our
ability.  There is still a very odd piece of computation in
elf_build_reltab() which I can't really figure out...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoHandle the new ELF headers in the dependency generation
H. Peter Anvin [Thu, 25 Jun 2009 20:06:49 +0000 (13:06 -0700)]
Handle the new ELF headers in the dependency generation

The dependency machinery relies on properly rooted includes, so give
it to them... the path syntax munging machinery in the dependency
script handles it from a Makefile syntax perspective, and then we can
hope that C compilers are smart enough to deal with forward-slash
paths even when that is not the native syntax.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoELF: add header files, begin merging common code, drop .comment
H. Peter Anvin [Thu, 25 Jun 2009 19:30:50 +0000 (12:30 -0700)]
ELF: add header files, begin merging common code, drop .comment

Add something approaching real ELF header files.

Begin merging the common ELF code, beginning with the section name
detection.

Drop automatic generation of .comment section, and in particular the
treatment of .common as a special section (if we decide generating
.comment is still a good idea, we should just do it as a macro.)

Augment the list of known sections, and make it table-driven.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.06rc13
H. Peter Anvin [Thu, 25 Jun 2009 18:27:18 +0000 (11:27 -0700)]
NASM 2.06rc13

15 years agochanges.src: update
H. Peter Anvin [Thu, 25 Jun 2009 18:23:37 +0000 (11:23 -0700)]
changes.src: update

15 years agoinsns: make the MMX version of PINSRW match the SSE/AVX ones
H. Peter Anvin [Thu, 25 Jun 2009 04:53:23 +0000 (21:53 -0700)]
insns: make the MMX version of PINSRW match the SSE/AVX ones

Make the MMX version of PINSRW match the SSE and AVX ones, and add it
to the tests.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoIntel FMA: drop relaxed forms
H. Peter Anvin [Thu, 25 Jun 2009 04:45:27 +0000 (21:45 -0700)]
Intel FMA: drop relaxed forms

The Intel FMA instructions are destructive, so relaxed forms are not
appropriate.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoFix the PINSR series of instructions
H. Peter Anvin [Thu, 25 Jun 2009 04:43:04 +0000 (21:43 -0700)]
Fix the PINSR series of instructions

Clean up a number of errors in the PINSR series instructions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoAdd support for instructions which always use low 8-bit registers
H. Peter Anvin [Thu, 25 Jun 2009 04:38:29 +0000 (21:38 -0700)]
Add support for instructions which always use low 8-bit registers

Add a byte code to explicitly support instructions which only uses the
low 8-bit registers (as if a REX prefix always was present.)  This is
usable for instructions which are officially documented as using "the
low byte of a 32-bit register" and so on.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoinsns.dat: fix typos: VCMPORD_SP[SD] entered as VCMPORS_SP[SD]
H. Peter Anvin [Thu, 25 Jun 2009 04:03:29 +0000 (21:03 -0700)]
insns.dat: fix typos: VCMPORD_SP[SD] entered as VCMPORS_SP[SD]

Fix typos in two instructions in the relaxed forms.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoinsns.dat: collapse relaxed forms
H. Peter Anvin [Thu, 25 Jun 2009 01:36:24 +0000 (18:36 -0700)]
insns.dat: collapse relaxed forms

Change the relaxed forms to the compact representation.  This
*deliberately* does not fix bugs where the relaxed form does not match
the official form; this is strictly a "no change in output" checkin.

All remaining open-coded relaxed forms are very likely bugs, and need
to be individually audited.  Furthermore, it is questionable if the
Intel FMA instructions, being destructive, should have relaxed forms
at all.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoinsns.pl: allow relaxed forms to be created without duplication
H. Peter Anvin [Thu, 25 Jun 2009 01:06:26 +0000 (18:06 -0700)]
insns.pl: allow relaxed forms to be created without duplication

Allow a * to be put on an operand, indicating that it is optional and
should be replaced with the immediately preceding operand if it is
omitted.  This allows official and relaxed forms of nondestructive
instructions to be written on one line.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agochanges.src: fix some odd spacing
H. Peter Anvin [Wed, 24 Jun 2009 23:50:54 +0000 (16:50 -0700)]
changes.src: fix some odd spacing

15 years agoparser: don't use midcode declarations
H. Peter Anvin [Tue, 23 Jun 2009 18:34:42 +0000 (11:34 -0700)]
parser: don't use midcode declarations

OpenWatcom can't handle midcode variable declarations.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoBR 2782055: reject invalid tokens after ]
Victor van den Elzen [Tue, 23 Jun 2009 01:47:07 +0000 (03:47 +0200)]
BR 2782055: reject invalid tokens after ]

A bracketed memory reference should be followed by a comma or
the end of the line. Enforce this.

15 years agospecfile: update URLs
H. Peter Anvin [Tue, 26 May 2009 23:06:57 +0000 (16:06 -0700)]
specfile: update URLs

Update the URLs in the specfile to point to http://www.nasm.us/.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNindent: add back the -nut option
H. Peter Anvin [Tue, 26 May 2009 04:57:27 +0000 (21:57 -0700)]
Nindent: add back the -nut option

NASM is developed under a bunch on environments, to tabs aren't the
best choice.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNindent: update with the -npro and -il0 options
H. Peter Anvin [Tue, 26 May 2009 04:40:06 +0000 (21:40 -0700)]
Nindent: update with the -npro and -il0 options

Update with the -npro and, if recent enough, the -il0 options.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: use NASM syntax for x87 registers
H. Peter Anvin [Sat, 23 May 2009 23:25:14 +0000 (16:25 -0700)]
doc: use NASM syntax for x87 registers

The x87 registers are called ST0 and ST1 in NASM syntax, not ST(0) and
ST(1).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoinsns.dat - fixup for XOP (SSE5) AMD instructions
Cyrill Gorcunov [Sun, 17 May 2009 08:56:54 +0000 (12:56 +0400)]
insns.dat - fixup for XOP (SSE5) AMD instructions

1) A number of PMA -> VPM misprint fixed.
2) Spec points to ymmreg in mnemonics even for L=0 instructions. Fixed.

The instructions are still sorted in order of specification follows.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoinsns.dat - introcuce base XOP (SSE5) AMD instructions
Cyrill Gorcunov [Fri, 15 May 2009 09:21:49 +0000 (13:21 +0400)]
insns.dat - introcuce base XOP (SSE5) AMD instructions

Introduce base XOP/FMA4/CVT16 instructions (SSE5)
based on official specification from AMD (rev 3.03).
Some fixes from Peter Johnson and H. Peter Anvin
included (not updated in AMD spec yet).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoinsns.pl - add handling of pp VEX/XOP fields
Cyrill Gorcunov [Thu, 14 May 2009 17:26:05 +0000 (21:26 +0400)]
insns.pl - add handling of pp VEX/XOP fields

We already have such kind of aliases for L field
(via l0 and l1). Via p0,p1,p2 it's become easier
to follow AMD docs while encoding VEX/XOP commands.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoAdd symbolic constants for REX_V "classes" (VEX, XOP, ...)
H. Peter Anvin [Sat, 9 May 2009 01:01:21 +0000 (18:01 -0700)]
Add symbolic constants for REX_V "classes" (VEX, XOP, ...)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: remove insref.src
H. Peter Anvin [Sat, 9 May 2009 00:56:18 +0000 (17:56 -0700)]
doc: remove insref.src

Remove the old, obsolete insref.src.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.06rc12
H. Peter Anvin [Wed, 6 May 2009 21:00:48 +0000 (14:00 -0700)]
NASM 2.06rc12

15 years agopreproc: handle %+ even during early token replacement
H. Peter Anvin [Mon, 4 May 2009 17:11:22 +0000 (10:11 -0700)]
preproc: handle %+ even during early token replacement

Preexisting code seems to rely on %+ being processed even during early
token replacement, e.g. Syslinux contains the following code:

%macro          superb 1
bx %+ %1        equ SuperInfo+($-superblock)*8+4
bs %+ %1        equ $
                zb 1
%endmacro

... which is expected to work when invoked as:

                superb Media

As a result, set handle_paste_tokens to true at all times; assuming
this turns out to be the way things are we can really just remove it
as an option.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoUse lower case for VEX and XOP in instructions table
H. Peter Anvin [Mon, 4 May 2009 05:14:03 +0000 (22:14 -0700)]
Use lower case for VEX and XOP in instructions table

Use lower case for VEX and XOP ("vex", "xop") to avoid visual
confusion (and in the future potential real confusion) with upper-case
hexadecimal numbers.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoInfrastructure support for AMD's new XOP prefix
H. Peter Anvin [Mon, 4 May 2009 04:42:34 +0000 (21:42 -0700)]
Infrastructure support for AMD's new XOP prefix

Handle AMD's XOP prefixes; they use basically the same encoding as VEX
prefixes, so treat them simply as a variant of VEX.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agooutbin: replace fprintf(rf, not_defined); with fputs(not_defined, rf);
H. Peter Anvin [Thu, 30 Apr 2009 15:03:10 +0000 (08:03 -0700)]
outbin: replace fprintf(rf, not_defined); with fputs(not_defined, rf);

Some vendors get nervous about parameterized printf patterns;
furthermore, it's completely unnecessary in this case.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.06rc11
H. Peter Anvin [Mon, 20 Apr 2009 21:04:17 +0000 (14:04 -0700)]
NASM 2.06rc11

15 years agopreproc: unify token-pasting code
H. Peter Anvin [Mon, 20 Apr 2009 21:01:18 +0000 (14:01 -0700)]
preproc: unify token-pasting code

Unify the token-pasting code between the macro expansion and the
preprocessor parameter case.  Parameterize whether or not to handle %+
tokens during expansion (%+ tokens have late binding semantics.)

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
15 years agodoc: slightly tidy the copyright page of the manual.
H. Peter Anvin [Mon, 20 Apr 2009 00:24:54 +0000 (17:24 -0700)]
doc: slightly tidy the copyright page of the manual.

15 years agopreproc: make $ and $$ TOKEN_OTHER
H. Peter Anvin [Fri, 17 Apr 2009 21:20:44 +0000 (14:20 -0700)]
preproc: make $ and $$ TOKEN_OTHER

Recognize $ and $$ as TOKEN_OTHER; they aren't really either
TOK_NUMBER nor TOK_ID, even though we have traditionally considered
them TOK_NUMBER.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
15 years agoBR 2760773: $$ tokens
Victor van den Elzen [Fri, 17 Apr 2009 14:17:59 +0000 (16:17 +0200)]
BR 2760773: $$ tokens

The tokenizer didn't handle $$, but relied on token pasting of two $ tokens.
This broke after the improvements in 9bb46df4.

15 years agopreproc: fix more token pasting cases
H. Peter Anvin [Wed, 8 Apr 2009 21:02:25 +0000 (14:02 -0700)]
preproc: fix more token pasting cases

"+" can be a separate token that ends up having to get pulled into the
middle of a floating-point constant.  It's not even that strange.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoAUTHORS: Update information for HPA
H. Peter Anvin [Wed, 8 Apr 2009 20:49:48 +0000 (13:49 -0700)]
AUTHORS: Update information for HPA

15 years agoNASM 2.06rc10
H. Peter Anvin [Wed, 8 Apr 2009 05:10:35 +0000 (22:10 -0700)]
NASM 2.06rc10

15 years agoDocument preprocessor token concatenation fix.
H. Peter Anvin [Wed, 8 Apr 2009 05:09:05 +0000 (22:09 -0700)]
Document preprocessor token concatenation fix.

15 years agoHandle weird cases of token pasting
H. Peter Anvin [Wed, 8 Apr 2009 04:59:24 +0000 (21:59 -0700)]
Handle weird cases of token pasting

Especially when token pasting involves floating-point numbers, we can
have some really strange effects from token pasting: for example,
pasting the two tokens "xyzzy" and "1e+10" ends up with *three*
tokens: "xyzzy1e" "+" "10".  The easiest way to deal with this is to
explicitly combine the string and then run tokenize() on it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.06rc9
H. Peter Anvin [Wed, 8 Apr 2009 03:59:41 +0000 (20:59 -0700)]
NASM 2.06rc9

15 years agonasm.nsi: add COPYING to the list of files to package
H. Peter Anvin [Tue, 7 Apr 2009 02:37:30 +0000 (19:37 -0700)]
nasm.nsi: add COPYING to the list of files to package

15 years agonasm.nsi: add NASM Manual; automate version generation
H. Peter Anvin [Tue, 7 Apr 2009 02:12:34 +0000 (19:12 -0700)]
nasm.nsi: add NASM Manual; automate version generation

Add the NASM Manual (as a PDF) to the Windows installer, and abstract
out the version number.

15 years agoAdd NSIS script to make a Windows installer
Shao Miller [Tue, 7 Apr 2009 02:07:37 +0000 (19:07 -0700)]
Add NSIS script to make a Windows installer

Here is an NSIS script for making a simple NASM package.  It creates a
NASM folder with some of the important binaries in it, as well as a
simple batch file to get a CLI with the NASM folder included in the
PATH.  Expects to be built from inside the bin/ directory.  Fairly
primitive.  Feedback welcome.  - Shao

15 years agoAdd STRUC change to changes.src
Victor van den Elzen [Sun, 29 Mar 2009 01:09:13 +0000 (03:09 +0200)]
Add STRUC change to changes.src

15 years agoFR 2499968: structures with non-zero base offset
Victor van den Elzen [Fri, 27 Mar 2009 02:53:59 +0000 (03:53 +0100)]
FR 2499968: structures with non-zero base offset

Add an optional second argument to struc, document it and test it.
Also removed trailing whitespace in nasmdoc.src in the process.

15 years agodisasm: fix reversed REP vs REPNE in eatbyte()
H. Peter Anvin [Thu, 19 Mar 2009 13:52:07 +0000 (06:52 -0700)]
disasm: fix reversed REP vs REPNE in eatbyte()

F2 is REPNE, F3 is REP(E)

15 years agodisasm: when no instruction is found, consider a naked prefix
H. Peter Anvin [Thu, 19 Mar 2009 06:10:19 +0000 (23:10 -0700)]
disasm: when no instruction is found, consider a naked prefix

If we can't find a matching instruction, rather than printing it as a
"db" literal, consider first if we can disassemble it as a naked prefix.

15 years agoNASM 2.06rc8
H. Peter Anvin [Wed, 18 Mar 2009 23:21:45 +0000 (16:21 -0700)]
NASM 2.06rc8

15 years agooutcoff: BR 2685756: fix SAFESEH with an internal symbol
Andy Polyakov [Wed, 18 Mar 2009 21:49:23 +0000 (14:49 -0700)]
outcoff: BR 2685756: fix SAFESEH with an internal symbol

Fix the SAFESEH directive for the specific case of a symbol internal
to the program.  With the optimizer enabled, it would otherwise fail
unless the symbol is external.

15 years agooutelf32/64: fix uninitialized rbtree
Michael Scherer [Wed, 18 Mar 2009 21:26:29 +0000 (22:26 +0100)]
outelf32/64: fix uninitialized rbtree

Fix crash caused by uninitialised memory that lead to dangling pointer
in the rbtree. This can be seen by compiling zsnes 1.50, with a file
that define many symbols, such as fxemu2c.asm.

15 years agoBR 2690688: Fix opcodes for FMA instructions
H. Peter Anvin [Wed, 18 Mar 2009 01:26:47 +0000 (18:26 -0700)]
BR 2690688: Fix opcodes for FMA instructions

Two bugs with respect to the FMA instructions:
- the variant increment is supposed to be 0x10, not 0x01.
- the base opcode for scalar VFNMADD is 0x9d, not 0x9c

15 years agoAdd test from BR 2690688
H. Peter Anvin [Tue, 17 Mar 2009 23:18:41 +0000 (16:18 -0700)]
Add test from BR 2690688

Add the test case from BR 2690688 to the test collection.

15 years agoBR 2690688: add missing VFM instructions
H. Peter Anvin [Tue, 17 Mar 2009 23:13:10 +0000 (16:13 -0700)]
BR 2690688: add missing VFM instructions

The Perl script which auto-generated the VFM instructions had
incorrectly conflated the VEX.W and VEX.L bits, with the result that
only half the valid instructions were generated.

15 years agoBR 2689316: PEXTRQ requires REX.W
H. Peter Anvin [Mon, 16 Mar 2009 23:32:42 +0000 (16:32 -0700)]
BR 2689316: PEXTRQ requires REX.W

The PEXTRQ instruction requires a REX.W prefix.

15 years agogenfma: fix spelling of the VFNM instructions
H. Peter Anvin [Mon, 16 Mar 2009 18:51:07 +0000 (11:51 -0700)]
genfma: fix spelling of the VFNM instructions

Fix the spelling of the scalar VFNM instruction in genfma.pl, too,
just in case we need to pull this script out again...

15 years agoinsns.dat: fix VFNM instructions incorrectly spelled as VFMN
H. Peter Anvin [Mon, 16 Mar 2009 18:49:27 +0000 (11:49 -0700)]
insns.dat: fix VFNM instructions incorrectly spelled as VFMN

The scalar versions of the VFNM instructions had been incorrectly
spelled VFMN.

15 years agoNASM 2.06rc7
H. Peter Anvin [Sun, 15 Mar 2009 21:38:54 +0000 (14:38 -0700)]
NASM 2.06rc7

15 years agoBR 2672117: handle long lines for db/dw/etc.
H. Peter Anvin [Sun, 8 Mar 2009 05:54:31 +0000 (21:54 -0800)]
BR 2672117: handle long lines for db/dw/etc.

Handle long arrays on a single line in db/dw/etc.

15 years agoautoconf: detect the broken bool in OpenWatcom 1.8
H. Peter Anvin [Sun, 1 Mar 2009 21:57:40 +0000 (13:57 -0800)]
autoconf: detect the broken bool in OpenWatcom 1.8

OpenWatcom 1.8 has a C99 mode, which implements _Bool and
<stdbool.h>.  Unfortunately the implementation is broken, and doesn't
let _Bool be implicitly converted to integer (as required by the C99
spec).  Detect this case in autoconf.

15 years agoMost instruction codes are octal, so print errors that way too
H. Peter Anvin [Sun, 1 Mar 2009 08:22:16 +0000 (00:22 -0800)]
Most instruction codes are octal, so print errors that way too

Most of our instruction opcodes are written in octal.  Thus, it makes
sense to print them that way if we ever have an error message.

15 years agooptimization.asm: more sbyte tests
H. Peter Anvin [Fri, 27 Feb 2009 00:37:55 +0000 (16:37 -0800)]
optimization.asm: more sbyte tests

A few more sbyte optimization tests.

15 years agosbyte: optimization is OK if UNKNOWN isn't set
H. Peter Anvin [Fri, 27 Feb 2009 00:34:56 +0000 (16:34 -0800)]
sbyte: optimization is OK if UNKNOWN isn't set

We can optimize the sbytes if the UNKNOWN flag isn't set

15 years agooptimization.asm: add sbyte tests
H. Peter Anvin [Fri, 27 Feb 2009 00:34:07 +0000 (16:34 -0800)]
optimization.asm: add sbyte tests

15 years agoNASM 2.06rc6
H. Peter Anvin [Thu, 26 Feb 2009 22:58:06 +0000 (14:58 -0800)]
NASM 2.06rc6

15 years agoBR 2413265: don't pessimize displacements
H. Peter Anvin [Thu, 26 Feb 2009 22:48:03 +0000 (14:48 -0800)]
BR 2413265: don't pessimize displacements

Optimize displacements, don't pessimize them.  When running in the
optimizer, we always keep track of when a reference is forward.  That
doesn't mean it is unknown.

15 years agooptimization.asm: add EA optimization tests
H. Peter Anvin [Thu, 26 Feb 2009 22:47:17 +0000 (14:47 -0800)]
optimization.asm: add EA optimization tests

Add tests for EA optimizations

15 years agonasm.c: another readability cleanup
H. Peter Anvin [Thu, 26 Feb 2009 22:36:19 +0000 (14:36 -0800)]
nasm.c: another readability cleanup

Yet another change for readability

15 years agonasm.c: readability cleanup for seg:off parsing
H. Peter Anvin [Thu, 26 Feb 2009 22:34:48 +0000 (14:34 -0800)]
nasm.c: readability cleanup for seg:off parsing

The code to pick apart seg:off in nasm.c was virtually unreadable due
to mechanized line breaking.

15 years agoRename convergence.asm to optimization.asm
Victor van den Elzen [Wed, 25 Feb 2009 16:49:23 +0000 (17:49 +0100)]
Rename convergence.asm to optimization.asm

15 years agoDo not confuse segmentless adresses and unknown forward references
Victor van den Elzen [Wed, 25 Feb 2009 16:32:00 +0000 (17:32 +0100)]
Do not confuse segmentless adresses and unknown forward references

Also be optimistic with immediate forward references.

15 years agoAdd VPCLMUL instructions
H. Peter Anvin [Tue, 24 Feb 2009 02:27:29 +0000 (18:27 -0800)]
Add VPCLMUL instructions

15 years agoassemble: only be optimistic with NO_SEG if we're really in pass 1
H. Peter Anvin [Tue, 24 Feb 2009 01:51:25 +0000 (17:51 -0800)]
assemble: only be optimistic with NO_SEG if we're really in pass 1

Only be optimistic about the reachability of a symbol with NO_SEG if
we are truly in pass 1, i.e. it could possibly be just a forward
reference.  After we have done a single pass, if it is still NO_SEG,
then it is an absolute symbol and need to be treated as such.

15 years agoconvergence.asm: add test of jmp to an absolute address
H. Peter Anvin [Tue, 24 Feb 2009 01:47:25 +0000 (17:47 -0800)]
convergence.asm: add test of jmp to an absolute address

A JMP to an absolute address can't be short.  Thus, we must not try to
make it so.

15 years agoAdd test file for optimal convergence
Victor van den Elzen [Mon, 23 Feb 2009 04:16:35 +0000 (05:16 +0100)]
Add test file for optimal convergence

Some edge cases where starting with a long form
converges suboptimally.

15 years agoBR 2420167: jmp not always optimized
Victor van den Elzen [Mon, 23 Feb 2009 03:35:00 +0000 (04:35 +0100)]
BR 2420167: jmp not always optimized

Begin by assuming short jumps are possible to prevent suboptimal convergence.

15 years agoPCLMUL is apparently targeted for Westmere with the AES stuff
H. Peter Anvin [Sun, 22 Feb 2009 04:45:42 +0000 (20:45 -0800)]
PCLMUL is apparently targeted for Westmere with the AES stuff

The PCLMUL instruction is apparently targetted for Westmere.

15 years agoNASM 2.06rc5
H. Peter Anvin [Sun, 22 Feb 2009 03:02:58 +0000 (19:02 -0800)]
NASM 2.06rc5

15 years agoBR 2557903: fix disassembly of a set of SSE MOV* instructions
H. Peter Anvin [Sun, 22 Feb 2009 02:58:15 +0000 (18:58 -0800)]
BR 2557903: fix disassembly of a set of SSE MOV* instructions

Fix the disassembly of the alternate forms of register-register
MOVAPD, MOVDQA, MOVDQU, MOVQ, MOVSD, and MOVUPD.

NASM never generates these, but they would be disassembled
incorrectly.

15 years agoBR 2541252: Fix issues in insns.dat, mostly related to LZCNT and POPCNT
H. Peter Anvin [Sun, 22 Feb 2009 02:51:17 +0000 (18:51 -0800)]
BR 2541252: Fix issues in insns.dat, mostly related to LZCNT and POPCNT

Fix various flags on LZCNT and POPCNT, and fix a few instructions
tagged \360\332, which makes no sense.

15 years agochanges.src: document WAIT and %$$ fixes
H. Peter Anvin [Sun, 22 Feb 2009 02:26:20 +0000 (18:26 -0800)]
changes.src: document WAIT and %$$ fixes

15 years agoBR 2592476: Treat WAIT as a prefix even though it's really an instruction
H. Peter Anvin [Sun, 22 Feb 2009 02:22:56 +0000 (18:22 -0800)]
BR 2592476: Treat WAIT as a prefix even though it's really an instruction

WAIT is technically an instruction, but from an assembler standpoint
it behaves as if it had been a prefix.  In particular, it has to be
ordered *before* any real hardware prefixes.

15 years agobr704736: handle deep context-local macros
H. Peter Anvin [Sun, 22 Feb 2009 01:55:08 +0000 (17:55 -0800)]
br704736: handle deep context-local macros

The documentation says that constructs with %$...$foo can be used
to access macros from deeper in the context stack.  From what
I can tell, that has never actually worked, since we'd enter names
like %$foo into the context-local macro name table.  Instead, only
insert the tail of the macro name into the context-local table;
expand get_ctx to also return a pointer to the macro name proper;
this is rather straightforward since we'd usually save away that
name at the point get_ctx is called anyway.

15 years agonasmlib: make nasm_strcat() take const arguments
H. Peter Anvin [Sun, 22 Feb 2009 01:54:31 +0000 (17:54 -0800)]
nasmlib: make nasm_strcat() take const arguments

None of the strings passed to nasm_strcat() are modified, to
make them const.