platform/upstream/nasm.git
15 years agoNASM 2.06rc3
H. Peter Anvin [Wed, 11 Feb 2009 18:54:59 +0000 (10:54 -0800)]
NASM 2.06rc3

15 years agoAllow global declaration after symbol definition
Charles Crayne [Thu, 29 Jan 2009 03:07:18 +0000 (19:07 -0800)]
Allow global declaration after symbol definition

This experimental feature needs to be tested for
all output formats which recognize global symbols.

15 years agoFix Bugs item #2537867
Charles Crayne [Tue, 27 Jan 2009 22:43:37 +0000 (14:43 -0800)]
Fix Bugs item #2537867

Module labels.c has code to issue error message when global
directive appears after symbol definition, but the test condition
was incorrectly punctuated.

15 years agoDocument the as86 ..start label
Soronel Haetir [Tue, 20 Jan 2009 02:27:11 +0000 (17:27 -0900)]
Document the as86 ..start label

I realized that a documentation change is required to inform users about the
addition of entry point support for the as86 format.  The following produces
reasonable output for .txt output, but I am blind and so can't check the
other formats as readily.

15 years agodoc: clean up the "String Manipulation in Macros" section
H. Peter Anvin [Mon, 19 Jan 2009 07:04:45 +0000 (23:04 -0800)]
doc: clean up the "String Manipulation in Macros" section

Minor cleanups to the "String Manipulation in Macros" section.

15 years agodoc: indent the time macro example
H. Peter Anvin [Mon, 19 Jan 2009 06:59:13 +0000 (22:59 -0800)]
doc: indent the time macro example

Indent the time macro example for ease of reading.

15 years agodoc: fix typo
H. Peter Anvin [Mon, 19 Jan 2009 06:55:53 +0000 (22:55 -0800)]
doc: fix typo

verson -> version

15 years agoMerge branch 'master' of git+ssh://repo.or.cz/srv/git/nasm
H. Peter Anvin [Mon, 19 Jan 2009 06:55:33 +0000 (22:55 -0800)]
Merge branch 'master' of git+ssh://repo.or.cz/srv/git/nasm

15 years agodoc: update the section on numeric constants
H. Peter Anvin [Mon, 19 Jan 2009 06:51:46 +0000 (22:51 -0800)]
doc: update the section on numeric constants

Update the section on numeric constants, and add a few more examples.

15 years agoGenerate warning for unknown section atributes
Charles Crayne [Sun, 18 Jan 2009 23:27:03 +0000 (15:27 -0800)]
Generate warning for unknown section atributes

Previously, the ELF backends silently ignored incorrect or unknown
attributes on section declarations, and therefore used default values
in cases where the user had make an error in attempting to specify
custom values.

15 years agoFix the [warning] directive
H. Peter Anvin [Mon, 5 Jan 2009 17:08:06 +0000 (09:08 -0800)]
Fix the [warning] directive

Fix multiple bugs in the [warning] directive:

- Only parsed on pass 1
- "-" was interpreted as "+"

15 years agooutas86: slight stylistic cleanups
H. Peter Anvin [Sun, 4 Jan 2009 01:56:41 +0000 (17:56 -0800)]
outas86: slight stylistic cleanups

Minor stylistic cleanups to previous patch.

15 years agoAdd entry point support to as86 backend
Soronel Haetir [Sun, 4 Jan 2009 01:21:52 +0000 (16:21 -0900)]
Add entry point support to as86 backend

I needed entry point support with the as86 format, and after looking through
the archives found a similar desire from someone in 2002.  For some reason
such a patch never made it into the code, even though the required flag
value is present, so I offer the a patch of my own.

I compared against what is done in the .obj format and the approaches are
quite similar which I hope will aid in its acceptability.  While I have
tested it extensively it does do the job asked, and I'm honestly not sure
what extensive testing of the change would look like.

15 years agoBR 2432826: Fix enforcement of the LONG bit
H. Peter Anvin [Tue, 30 Dec 2008 04:52:28 +0000 (20:52 -0800)]
BR 2432826: Fix enforcement of the LONG bit

Somewhere we lost the enforcement of the LONG bit, as opposed to
NOLONG.  Fix this in the most obvious way.

15 years agoBR 2413278: Nonoptimal forms of arithmetic instructions involving AX
H. Peter Anvin [Tue, 30 Dec 2008 03:58:36 +0000 (19:58 -0800)]
BR 2413278: Nonoptimal forms of arithmetic instructions involving AX

At some point, we lost the optimizations for the core arithmetic
operations involving AX.  Put them back.

15 years agochanges.src: document Mach-O alignment fix.
H. Peter Anvin [Tue, 23 Dec 2008 00:37:59 +0000 (16:37 -0800)]
changes.src: document Mach-O alignment fix.

15 years agoNASM 2.06rc2
H. Peter Anvin [Sat, 20 Dec 2008 00:48:07 +0000 (16:48 -0800)]
NASM 2.06rc2

15 years agoMach-O alignment fix
David DeHaven [Tue, 9 Dec 2008 08:18:43 +0000 (00:18 -0800)]
Mach-O alignment fix

Several projects have taken to using .text to store read-only data
when building on Mac OS X due to crashes in SSE code from the .rodata
section being mis-aligned. It seems there was a misunderstanding about
how ld/ld64 handles section alignment in outmacho.c so I wrote a patch
to fix it. I tested it against x264 git, modified it to use ".rodata
align=16" for the data section and use movdqa instructions (guaranteed
to crash when built with unpatched nasm) and it passed all tests in
its checkasm tool.

If you want more data I can provide, but it's late and I've had a
couple glasses of mulled wine :)

-DrD-

15 years agoBR 2413272: Warn about byte displacement overflow
Victor van den Elzen [Wed, 10 Dec 2008 12:04:58 +0000 (13:04 +0100)]
BR 2413272: Warn about byte displacement overflow

Remove the special case for single byte displacements,
which was already in out() anyway.

15 years agoNASM 2.06rc1
H. Peter Anvin [Sun, 30 Nov 2008 23:53:02 +0000 (15:53 -0800)]
NASM 2.06rc1

15 years agoELF: use rbtree for symbol searches
H. Peter Anvin [Fri, 7 Nov 2008 03:55:05 +0000 (19:55 -0800)]
ELF: use rbtree for symbol searches

Linear searches are evil, so use an llrbtree to search for symbols by
offset.  This doesn't change the preexisting behaviour that we only
look for global symbols.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agorbtree: drop "const" from search function
H. Peter Anvin [Fri, 7 Nov 2008 03:54:05 +0000 (19:54 -0800)]
rbtree: drop "const" from search function

Having the search argument and result be "const" is nice in theory,
but causes problems in practice.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agochanges.src: document POPCNT fix.
H. Peter Anvin [Thu, 6 Nov 2008 17:42:11 +0000 (09:42 -0800)]
changes.src: document POPCNT fix.

Add POPCNT fix to release notes.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoMerge branch 'nasm-2.05.xx'
H. Peter Anvin [Thu, 6 Nov 2008 17:41:23 +0000 (09:41 -0800)]
Merge branch 'nasm-2.05.xx'

15 years agotest/popcnt.asm: simple test for the POPCNT instruction
H. Peter Anvin [Thu, 6 Nov 2008 17:40:39 +0000 (09:40 -0800)]
test/popcnt.asm: simple test for the POPCNT instruction

Very simple test of POPCNT instructions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoThe POPCNT instruction does not need sizes on memory operands
H. Peter Anvin [Thu, 6 Nov 2008 17:39:48 +0000 (09:39 -0800)]
The POPCNT instruction does not need sizes on memory operands

The POPCNT instruction should not require sizes on memory operands.
Add the appropriate size flags for that to work.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoBR 2229703: POPCNT r64,rm64 not POPCNT r64,rm32
H. Peter Anvin [Thu, 6 Nov 2008 17:35:02 +0000 (09:35 -0800)]
BR 2229703: POPCNT r64,rm64 not POPCNT r64,rm32

The 64-bit version of the POPCNT instruction takes r64,rm64; not
r64,rm32.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agopreproc: BR 2222615: fix segfault on bogus %ifmacro
H. Peter Anvin [Tue, 4 Nov 2008 22:24:34 +0000 (14:24 -0800)]
preproc: BR 2222615: fix segfault on bogus %ifmacro

BR 2222615: Fix segmentation fault on %ifmacro without an argument.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: better description of %line
H. Peter Anvin [Wed, 5 Nov 2008 23:55:40 +0000 (15:55 -0800)]
doc: better description of %line

The implication that %line allows NASM to digest cpp output is just
plain wrong, at least without additional intermediate processing.  Be
a little more circumspect.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoFix BR #916647
Victor van den Elzen [Wed, 5 Nov 2008 13:11:46 +0000 (14:11 +0100)]
Fix BR #916647

nasm.c should respect the default debug format of the output format,
instead of replacing it with the first format in the list.
This is cleaner and allows the list to be sorted normally.

This commit rewrites commit 116994111b which was very fragile.

15 years agochanges.src: document if for %ifmacro.
H. Peter Anvin [Tue, 4 Nov 2008 22:26:32 +0000 (14:26 -0800)]
changes.src: document if for %ifmacro.

Document fixed %ifmacro.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agotest: add test for BR 2222615
H. Peter Anvin [Tue, 4 Nov 2008 22:25:12 +0000 (14:25 -0800)]
test: add test for BR 2222615

Add a test for %ifmacro, per BR 2222615.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agopreproc: BR 2222615: fix segfault on bogus %ifmacro
H. Peter Anvin [Tue, 4 Nov 2008 22:24:34 +0000 (14:24 -0800)]
preproc: BR 2222615: fix segfault on bogus %ifmacro

BR 2222615: Fix segmentation fault on %ifmacro without an argument.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoPrevent erroneous extra "final" pass
Charles Crayne [Tue, 4 Nov 2008 02:21:24 +0000 (18:21 -0800)]
Prevent erroneous extra "final" pass

Specifically check for end of final pass.

15 years agodoc/changes.src: document ELF TLS
H. Peter Anvin [Mon, 3 Nov 2008 04:41:29 +0000 (20:41 -0800)]
doc/changes.src: document ELF TLS

Add ELF TLS to the release notes.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: minor edit to the TLS documentation examples.
H. Peter Anvin [Mon, 3 Nov 2008 04:40:16 +0000 (20:40 -0800)]
doc: minor edit to the TLS documentation examples.

Minimize the TLS documentation examples (we don't need "dword" in a
mov from ebx, for example.)  This is just to avoid user confusion.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoDocument differences between TLS coding in ELF32 and ELF64
Charles Crayne [Sun, 2 Nov 2008 00:09:36 +0000 (17:09 -0700)]
Document differences between TLS coding in ELF32 and ELF64

Absolute relocation wrt ..tlsie for ELF32
Relative relocation wrt ..gottpoff for ELF64

15 years agoELF32 support for offset to IE GOT entry
Charles Crayne [Sat, 1 Nov 2008 23:48:31 +0000 (16:48 -0700)]
ELF32 support for offset to IE GOT entry

Add new WRT type ..tlsie.
Generate R_386_TLS_IE relocation entries
for references to thread local variables.

15 years agoversion.pl: snapshot releases *only* have digits in the tail
H. Peter Anvin [Sat, 1 Nov 2008 19:57:05 +0000 (12:57 -0700)]
version.pl: snapshot releases *only* have digits in the tail

Snapshot releases have *only* digits in the tail.  "git describe"
produces tails that have digits in them, but aren't numeric.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoMove all version strings to a single compilation unit (ver.c)
H. Peter Anvin [Fri, 31 Oct 2008 23:53:49 +0000 (16:53 -0700)]
Move all version strings to a single compilation unit (ver.c)

Move all the version strings to a single compilation unit, ver.c; this
does not include the version macros, which are fed into macros.c.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoELF32 bit support of .tdata and .tbss sections
Charles Crayne [Fri, 31 Oct 2008 04:59:42 +0000 (21:59 -0700)]
ELF32 bit support of .tdata and .tbss sections

Set default attributes for .tdata and .tbss sections
Implement new attribute 'tls' for arbitrary section names
Flag variables in sections with tls attribute with STT_TLS

15 years agorbtree: drop the data pointer; instead rely on being embedded
H. Peter Anvin [Thu, 30 Oct 2008 17:58:28 +0000 (10:58 -0700)]
rbtree: drop the data pointer; instead rely on being embedded

Drop the data pointer, and instead assume the struct rbtree will be
embedded in a bigger data structure (to be extracted via
container_of()).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agocompiler.h: add offsetof() and container_of()
H. Peter Anvin [Thu, 30 Oct 2008 17:52:08 +0000 (10:52 -0700)]
compiler.h: add offsetof() and container_of()

offsetof() is a C99 construct; provided here as an ersatz for older
systems.

container_of() is a nonstandard but highly useful construct, which
allows data structure control items like tree structures to be
embedded in larger data structures without the penalty of extra
pointers and allocations.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoLeft-leaning red-black tree data structure
H. Peter Anvin [Thu, 30 Oct 2008 06:29:23 +0000 (23:29 -0700)]
Left-leaning red-black tree data structure

Implement library functions for "left-leaning red-black trees" with
uint64_t keys.  This is meant for looking up symbols by address in the
backends that need to do so, e.g. ELF.

A good question is if there is a better way to do this, that recovers
the original symbol, but that's a future issue.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoFix header guards for outlib.h
H. Peter Anvin [Tue, 28 Oct 2008 06:01:57 +0000 (23:01 -0700)]
Fix header guards for outlib.h

Fix typo in header guards for outlib.h

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agomake alldeps
H. Peter Anvin [Thu, 30 Oct 2008 04:03:17 +0000 (21:03 -0700)]
make alldeps

Run "make alldeps"

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: cross-reference macro parameter concatenation with %[...]
H. Peter Anvin [Thu, 30 Oct 2008 04:02:30 +0000 (21:02 -0700)]
doc: cross-reference macro parameter concatenation with %[...]

Explicitly document that %[...] and macro parameters concatenate the
same way, and cross-reference the two.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoMerge branch 'nasm-2.05.xx'
H. Peter Anvin [Thu, 30 Oct 2008 03:47:58 +0000 (20:47 -0700)]
Merge branch 'nasm-2.05.xx'

15 years agodoc: fix typo in the description of %unmacro
H. Peter Anvin [Thu, 30 Oct 2008 03:46:30 +0000 (20:46 -0700)]
doc: fix typo in the description of %unmacro

The description of %unmacro used %unmacro in a place which should
obviously have been %macro.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: fix capitalization
H. Peter Anvin [Thu, 30 Oct 2008 01:17:59 +0000 (18:17 -0700)]
doc: fix capitalization

Make the capitalization of "The -t Option" consistent with the other
options.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: remove duplicate entry for the "error" warning class
H. Peter Anvin [Thu, 30 Oct 2008 01:16:31 +0000 (18:16 -0700)]
doc: remove duplicate entry for the "error" warning class

Remove duplicate entry for the "error" warning class; leave at the end
with "all", as being another meta-warning class.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: retroactively document updates to the warning options
H. Peter Anvin [Thu, 30 Oct 2008 01:14:03 +0000 (18:14 -0700)]
doc: retroactively document updates to the warning options

Retroactively document the following changes to the warning options:

  - gcc-like syntax (-Wfoo, -Wno-foo)
  - "all" alias
  - "error" metawarning

Added in 2.00rc1 but never documented.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: fix typo in the description of %unmacro
H. Peter Anvin [Thu, 30 Oct 2008 03:46:30 +0000 (20:46 -0700)]
doc: fix typo in the description of %unmacro

The description of %unmacro used %unmacro in a place which should
obviously have been %macro.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: fix capitalization
H. Peter Anvin [Thu, 30 Oct 2008 01:17:59 +0000 (18:17 -0700)]
doc: fix capitalization

Make the capitalization of "The -t Option" consistent with the other
options.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: remove duplicate entry for the "error" warning class
H. Peter Anvin [Thu, 30 Oct 2008 01:16:31 +0000 (18:16 -0700)]
doc: remove duplicate entry for the "error" warning class

Remove duplicate entry for the "error" warning class; leave at the end
with "all", as being another meta-warning class.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: retroactively document updates to the warning options
H. Peter Anvin [Thu, 30 Oct 2008 01:14:03 +0000 (18:14 -0700)]
doc: retroactively document updates to the warning options

Retroactively document the following changes to the warning options:

  - gcc-like syntax (-Wfoo, -Wno-foo)
  - "all" alias
  - "error" metawarning

Added in 2.00rc1 but never documented.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoMerge commit 'nasm-2.05.01'
H. Peter Anvin [Wed, 29 Oct 2008 17:53:37 +0000 (10:53 -0700)]
Merge commit 'nasm-2.05.01'

Conflicts:
doc/changes.src

15 years agoNASM 2.05.01
H. Peter Anvin [Wed, 29 Oct 2008 17:52:53 +0000 (10:52 -0700)]
NASM 2.05.01

15 years agodoc/changes.src: document -W/-w fix as a NASM 2.05.01 feature.
H. Peter Anvin [Wed, 29 Oct 2008 17:51:51 +0000 (10:51 -0700)]
doc/changes.src: document -W/-w fix as a NASM 2.05.01 feature.

Make -W/-w fix a release note for NASM 2.05.01.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoMerge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
Charles Crayne [Tue, 28 Oct 2008 05:54:38 +0000 (22:54 -0700)]
Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm

15 years agoInitial documentation for ELF64 TLS
Charles Crayne [Tue, 28 Oct 2008 05:53:40 +0000 (22:53 -0700)]
Initial documentation for ELF64 TLS

More to come.

15 years agooutput: add common file outlib.c for common functions; realsize()
H. Peter Anvin [Tue, 28 Oct 2008 05:19:59 +0000 (22:19 -0700)]
output: add common file outlib.c for common functions; realsize()

Add a common file, outlib.c, for output formats.  Add the function
realsize() instead of open-coded variants in almost every backend.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agopreproc: merge expand_mmac_params() and expand_indirect()
H. Peter Anvin [Mon, 27 Oct 2008 06:49:00 +0000 (23:49 -0700)]
preproc: merge expand_mmac_params() and expand_indirect()

These two really need to be done together, in order for constructs
such as %[%1] to work properly.  Furthermore, fix a token-pasting bug
in expand_mmac_params().

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoMerge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
Charles Crayne [Mon, 27 Oct 2008 00:33:43 +0000 (17:33 -0700)]
Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm

15 years agoELF64 support for PC relative offset to IE GOT entry
Charles Crayne [Mon, 27 Oct 2008 00:32:38 +0000 (17:32 -0700)]
ELF64 support for PC relative offset to IE GOT entry

Add new WRT type ..gottpoff.
Generate R_X86_64_GOTTPOFF relocation entries
for references to thread local variables.

15 years agoMerge branch 'nasm-2.05.xx'
H. Peter Anvin [Sun, 26 Oct 2008 16:00:45 +0000 (09:00 -0700)]
Merge branch 'nasm-2.05.xx'

15 years agoBetter description of the number-overflow warning
H. Peter Anvin [Sun, 26 Oct 2008 15:59:04 +0000 (08:59 -0700)]
Better description of the number-overflow warning

Better grammar and fix incorrect description of the number-overflow
warning (it is not just limited to 64-bit arithmetic overflow, it also
triggers when trying to squeeze in a value which is too large into an
immediate.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoBR: 2196966: make the -w/-W options work again
H. Peter Anvin [Sun, 26 Oct 2008 15:57:13 +0000 (08:57 -0700)]
BR: 2196966: make the -w/-W options work again

The code to parse the -w/-W options was updating warning_on[], not
warning_on_global[], but warning_on[] is reset at the beginning of
each pass (to let the warning directive work); as a result the -w/-W
options don't actually do anything at all.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoMerge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
Charles Crayne [Sun, 26 Oct 2008 02:32:48 +0000 (19:32 -0700)]
Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm

15 years agoFlag thread local symbols in symbol table
Charles Crayne [Sun, 26 Oct 2008 02:31:09 +0000 (19:31 -0700)]
Flag thread local symbols in symbol table

Set STT_TLS in symbol table for symbols declared
in thread local storage sections. Note that,
for now at least, such symbols must also be
declared as GLOBAL.

15 years agosmartalign: clean up unnecessary duplication; tweak dependencies
H. Peter Anvin [Sun, 26 Oct 2008 00:48:33 +0000 (17:48 -0700)]
smartalign: clean up unnecessary duplication; tweak dependencies

Remove unnecessary duplicated patterns; with indirection we can handle
lists of any length.

For 16-bit generic padding, alternate between SI and DI dependencies.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoELF64 segment definitions for TLS
Charles Crayne [Sat, 25 Oct 2008 22:23:30 +0000 (15:23 -0700)]
ELF64 segment definitions for TLS

Add default definitions for .tdata & .tbss sections
Add definition for SHF_TLS section header flag
Add support for "tls" keyword on section statement

15 years agoFor snapshot releases, expand out the mangled version numbers.
H. Peter Anvin [Sat, 25 Oct 2008 19:41:29 +0000 (12:41 -0700)]
For snapshot releases, expand out the mangled version numbers.

For snapshot releases, expand out the mangled version number,
e.g. 2.05.00.0.20081025.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodisasm: introduce opy
H. Peter Anvin [Sat, 25 Oct 2008 07:42:51 +0000 (00:42 -0700)]
disasm: introduce opy

Introduce the opy pointer into the disassembler, and use it where
appropriate.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoassemble: use opx and opy in a few more places
H. Peter Anvin [Sat, 25 Oct 2008 07:41:00 +0000 (00:41 -0700)]
assemble: use opx and opy in a few more places

Use opx and opy in a few more places where we can do so.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc/changes.src: retroactively document anonymous %push
H. Peter Anvin [Fri, 24 Oct 2008 23:53:53 +0000 (16:53 -0700)]
doc/changes.src: retroactively document anonymous %push

Retroactively document the anonymous %push, which was added in version
2.04 but not documented.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agopreproc: don't macro-expand the argument to %use
H. Peter Anvin [Fri, 24 Oct 2008 23:38:17 +0000 (16:38 -0700)]
preproc: don't macro-expand the argument to %use

Use expand_id() for the argument to %use, instead of expand_smacro().
This really makes more sense for a "naked" argument.  This is a
semantic change, but is unlikely to break any real code.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: document %pop with argument
H. Peter Anvin [Fri, 24 Oct 2008 23:27:11 +0000 (16:27 -0700)]
doc: document %pop with argument

Document that %pop can now take an argument, and what it does.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agopreproc: allow %pop to take an identifier, unify %push/%repl/%pop
H. Peter Anvin [Fri, 24 Oct 2008 23:24:21 +0000 (16:24 -0700)]
preproc: allow %pop to take an identifier, unify %push/%repl/%pop

Allow the %pop directive to take an identifier (an assert on the
context name); unify the parsing parts of %push, %repl,  and %pop.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: document anonymous %push
H. Peter Anvin [Fri, 24 Oct 2008 23:19:03 +0000 (16:19 -0700)]
doc: document anonymous %push

The anonymous %push was never documented, document it now.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc/changes.src: begin the release notes for 2.06
H. Peter Anvin [Fri, 24 Oct 2008 23:05:19 +0000 (16:05 -0700)]
doc/changes.src: begin the release notes for 2.06

The next version will presumably be called 2.06; begin collecting
release notes.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: fix awkward word order
H. Peter Anvin [Fri, 24 Oct 2008 17:15:46 +0000 (10:15 -0700)]
doc: fix awkward word order

"the exactly same" -> "exactly the same"

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoversion.pl: don't add an extra .00 for subminor if we don't need it
H. Peter Anvin [Fri, 24 Oct 2008 17:10:32 +0000 (10:10 -0700)]
version.pl: don't add an extra .00 for subminor if we don't need it

When producing the mangled version number, don't add a subminor if
there isn't a patch level or release candidate number.  Thus, 2.05p1
is 2.05.00.01, but 2.05 can just be 2.05.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoMerge branch 'indirect'
H. Peter Anvin [Fri, 24 Oct 2008 06:13:44 +0000 (23:13 -0700)]
Merge branch 'indirect'

15 years agoFix op2 references that had not yet been converted; introduce opy
H. Peter Anvin [Fri, 24 Oct 2008 06:07:53 +0000 (23:07 -0700)]
Fix op2 references that had not yet been converted; introduce opy

Fix op2 references not yet converted to accessing op2; add an opy
pointer similar to the opx pointer instead of multiple references.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodisasm: extension byte support in the disassembler
H. Peter Anvin [Wed, 15 Oct 2008 18:51:24 +0000 (11:51 -0700)]
disasm: extension byte support in the disassembler

Add support to the disassembler for the extension bytes (for operand
4+).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoAdd extension bytecodes to support operands 4+
H. Peter Anvin [Sat, 11 Oct 2008 05:10:31 +0000 (22:10 -0700)]
Add extension bytecodes to support operands 4+

The bytecode format assumes max 4 operands pretty strictly, but we
already have one instruction with 5 operands, and it's likely to get
more.  Support them via extension prefixes (similar to REX prefixes).
For bytecodes which use argument bytes we encode the number directly,
however.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoWhen issuing warnings for EA displacements, use the *EA* operand
H. Peter Anvin [Fri, 24 Oct 2008 03:49:09 +0000 (20:49 -0700)]
When issuing warnings for EA displacements, use the *EA* operand

When issuing warnings for EA displacements during address generation,
actually look a the proper operand!

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.05
H. Peter Anvin [Fri, 24 Oct 2008 02:42:17 +0000 (19:42 -0700)]
NASM 2.05

15 years agodoc/changes.src: update release notes
H. Peter Anvin [Fri, 24 Oct 2008 02:29:28 +0000 (19:29 -0700)]
doc/changes.src: update release notes

Update the release notes in preparation for NASM 2.05.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoThe CRC32 instructions can take 66 prefixes as well as F2
H. Peter Anvin [Thu, 23 Oct 2008 23:39:25 +0000 (16:39 -0700)]
The CRC32 instructions can take 66 prefixes as well as F2

The CRC32 instructions require F2, but can also take a 66 prefix to
set the operand size.  This is not the SSE model of prefix extension.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agotest/crc32.asm: test the CRC32 instruction
H. Peter Anvin [Thu, 23 Oct 2008 23:24:02 +0000 (16:24 -0700)]
test/crc32.asm: test the CRC32 instruction

Test for the CRC32 instruction.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoBR 2190521: fix the CRC32 opcodes
H. Peter Anvin [Thu, 23 Oct 2008 23:23:19 +0000 (16:23 -0700)]
BR 2190521: fix the CRC32 opcodes

A stray \1 bytecode was hiding in the CRC32 opcodes, causing complete
havoc.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.05rc8
H. Peter Anvin [Wed, 22 Oct 2008 18:23:18 +0000 (11:23 -0700)]
NASM 2.05rc8

15 years agoBR 2187210: Fix PFRCPV and PFRSQRTV
H. Peter Anvin [Wed, 22 Oct 2008 18:18:27 +0000 (11:18 -0700)]
BR 2187210: Fix PFRCPV and PFRSQRTV

Fix the Geode instructions PFRCPV and PFRSQRTV per bug report 2187210.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoassemble: not all backends handle intra-segment OUT_REL*ADR
H. Peter Anvin [Wed, 22 Oct 2008 18:15:00 +0000 (11:15 -0700)]
assemble: not all backends handle intra-segment OUT_REL*ADR

Not all backends can handle being handled an intrasegment OUT_REL*ADR,
and we don't fix them up in common code either (which would be the
logical thing to do -- right now we fix them up in a bunch of
individual places.)

For now, just fix up the one in address generation.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoBR 2148448: fix relative addresses in bin output
H. Peter Anvin [Wed, 22 Oct 2008 18:03:09 +0000 (11:03 -0700)]
BR 2148448: fix relative addresses in bin output

The "bin" format was misinterpreting the overloading of the "size"
argument to out(), which caused another source of 64-bit relative
offset errors.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoUpdate .gitignore to include additional generated files
H. Peter Anvin [Mon, 20 Oct 2008 05:25:11 +0000 (22:25 -0700)]
Update .gitignore to include additional generated files

pptok.ph and doc/inslist.src are generated files; list them in
.gitignore.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agotest/ppindirect.asm: test token pasting inside %[...]
H. Peter Anvin [Mon, 20 Oct 2008 05:23:12 +0000 (22:23 -0700)]
test/ppindirect.asm: test token pasting inside %[...]

Test for token pasting inside %[...].

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agopreproc: fix terminal token pasting in indirect sequences
H. Peter Anvin [Mon, 20 Oct 2008 05:22:05 +0000 (22:22 -0700)]
preproc: fix terminal token pasting in indirect sequences

Fix the case where the terminal token pastes with the first token of
the unmodified sequence.  This is a really ugly version; we need to
merge the two instances plus the one in expand_mmac_params().

Signed-off-by: H. Peter Anvin <hpa@zytor.com>