platform/upstream/nasm.git
15 years agoFix typo in previous outelf64.c commit
Charles Crayne [Sun, 12 Oct 2008 21:14:45 +0000 (14:14 -0700)]
Fix typo in previous outelf64.c commit

Stray line fragment left in when removing debug code.

15 years agoRIP rel relocations for PIC released for testing.
Charles Crayne [Sun, 12 Oct 2008 21:00:11 +0000 (14:00 -0700)]
RIP rel relocations for PIC released for testing.

Expressions like
  mov r15,[rel integer wrt ..got]
  lea   rax,[rel integer wrt ..gotoff]
now assemble correctly.

In addition, a fix has been made to the corresponding
abs relocations.

Both of these areas still need additional testing.

15 years agoassemble.c: use case4() macros like in disasm.c
H. Peter Anvin [Thu, 9 Oct 2008 22:37:10 +0000 (15:37 -0700)]
assemble.c: use case4() macros like in disasm.c

Use the case4() macros as we already do in disasm.c.  It helps reduce
visual clutter, and more clearly demonstrates that groups of four
belong together.  Furthermore, it makes the text compact enough that
we can now use case statements to mask down the EA patterns correctly.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodisasm: collapse all the segment register push/pop bytecodes
H. Peter Anvin [Thu, 9 Oct 2008 21:15:36 +0000 (14:15 -0700)]
disasm: collapse all the segment register push/pop bytecodes

As far as the disassembler is concerned, the segment register push/pop
bytecodes can be collapsed to a simple expression; the remaining
differences are handled by the filter expressions in insns.pl.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agotest/pushseg.asm: add "pop cs"
H. Peter Anvin [Thu, 9 Oct 2008 06:32:33 +0000 (23:32 -0700)]
test/pushseg.asm: add "pop cs"

"pop cs" is an 8086-only opcode; we support it for assembly but not
for disassembly.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agotest/pushseg.asm: test for push/pop of segment registers
H. Peter Anvin [Thu, 9 Oct 2008 06:30:41 +0000 (23:30 -0700)]
test/pushseg.asm: test for push/pop of segment registers

Simple test for push/pop of segment registers.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoReshuffle and move the bytecodes for segment register push/pop
H. Peter Anvin [Thu, 9 Oct 2008 04:17:32 +0000 (21:17 -0700)]
Reshuffle and move the bytecodes for segment register push/pop

Reshuffle the bytecodes for segment register push/pop to make more
sense, and move them from \4 to \344, thus freeing up the single-digit
bytecodes \4..\7 for future use.  It doesn't really make sense to use
single-digit bytecodes for this very oddball use.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoCollect statistics on bytecode use in insnsb.c
H. Peter Anvin [Wed, 8 Oct 2008 23:56:35 +0000 (16:56 -0700)]
Collect statistics on bytecode use in insnsb.c

We are starting to have to worry about running short on available
bytecodes, especially where we encode the operand number in the byte
code.  Thus, compile a table of bytecode usage and include as a
comment in insnsb.c.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.05rc3
H. Peter Anvin [Wed, 8 Oct 2008 23:25:26 +0000 (16:25 -0700)]
NASM 2.05rc3

15 years agotest/imul.asm: remove obsolete ERROR marker
H. Peter Anvin [Tue, 7 Oct 2008 23:53:49 +0000 (16:53 -0700)]
test/imul.asm: remove obsolete ERROR marker

Error already fixed...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoTest for various IMUL patterns
H. Peter Anvin [Tue, 7 Oct 2008 18:28:29 +0000 (11:28 -0700)]
Test for various IMUL patterns

Test for IMUL patterns.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoAdd missing IMUL pattern: reg64,imm8
H. Peter Anvin [Tue, 7 Oct 2008 18:26:41 +0000 (11:26 -0700)]
Add missing IMUL pattern: reg64,imm8

Make "imul rax,byte 5" work as expected.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoAdd a few missing \15 -> \275 conversions
H. Peter Anvin [Tue, 7 Oct 2008 17:56:32 +0000 (10:56 -0700)]
Add a few missing \15 -> \275 conversions

Add a few \15 -> \275 conversions that had been missed earlier.
Still haven't done the work on IMUL.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoChange \40 class opcodes to \254, except IMUL
H. Peter Anvin [Tue, 7 Oct 2008 17:53:08 +0000 (10:53 -0700)]
Change \40 class opcodes to \254, except IMUL

Change \40 class opcodes which need to be changed to \254.  IMUL will
need a separate audit; I'm not convinced we are really sure what all
the IMUL conditions should be.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNew opcode for 32->64 bit sign-extended immediate with warning
H. Peter Anvin [Tue, 7 Oct 2008 17:05:10 +0000 (10:05 -0700)]
New opcode for 32->64 bit sign-extended immediate with warning

Add a new opcode for 32->64 bit sign-extended immediate, with warning
on the number not matching.

This unfortunately calls for an audit of all the \4[0123] opcodes, if
they should be replaced by \25[4567].  This only replaces one
instruction (MOV reg64,imm32); other instructions need to be
considered.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agotest/immwarn.asm: add a few more non-warning tests
H. Peter Anvin [Tue, 7 Oct 2008 16:59:18 +0000 (09:59 -0700)]
test/immwarn.asm: add a few more non-warning tests

A few non-warning conditions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoRemove is_sbyte64() and replace with is_sbyte32() plus custom warning
H. Peter Anvin [Tue, 7 Oct 2008 16:56:38 +0000 (09:56 -0700)]
Remove is_sbyte64() and replace with is_sbyte32() plus custom warning

is_sbyte64() was equivalent to is_sbyte32() plus the warning; however,
the warning is only used in one place (and conflicts with another
warning there), so remove the function.

Furthermore, add back the test for pure immediates in
possible_sbyte(); they had been broken out but never folded back in --
and are essential.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoAvoid double warning for signed dword immediate
H. Peter Anvin [Tue, 7 Oct 2008 06:47:58 +0000 (23:47 -0700)]
Avoid double warning for signed dword immediate

Avoid double warning for the case where a signed dword immediate is
incorrectly extended to 64 bits.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNew opcodes to deal with 8-bit immediate sign extended to opsize
H. Peter Anvin [Tue, 7 Oct 2008 06:40:31 +0000 (23:40 -0700)]
New opcodes to deal with 8-bit immediate sign extended to opsize

New opcodes to deal with 8-bit immediates which are then sign-extended
to the operand size.  These allow us to warn appropriately.
Not sure I'm using these in all the proper places; need audit of all
uses of the \14..\17 opcodes.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.05rc2
H. Peter Anvin [Tue, 7 Oct 2008 02:16:27 +0000 (19:16 -0700)]
NASM 2.05rc2

15 years agochanges: document immediate fix
H. Peter Anvin [Tue, 7 Oct 2008 02:15:42 +0000 (19:15 -0700)]
changes: document immediate fix

15 years agoBR 2148448: Fix RIP-relative addressing with an immediate
H. Peter Anvin [Tue, 7 Oct 2008 02:11:07 +0000 (19:11 -0700)]
BR 2148448: Fix RIP-relative addressing with an immediate

When there is an immediate in the instruction, a RIP-relative offset
may not be relative to the end of the offset itself, since it is
relative to the end of the *instruction*, not the end of the *offset*.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoimmwarn: more immediate warnings test, with notes of where we fail
H. Peter Anvin [Tue, 7 Oct 2008 01:49:00 +0000 (18:49 -0700)]
immwarn: more immediate warnings test, with notes of where we fail

More tests for immediate warnings, with notes for the ones where we
currently fail to do the right thing.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoBetter warnings for out-of-range values
H. Peter Anvin [Mon, 6 Oct 2008 02:42:55 +0000 (19:42 -0700)]
Better warnings for out-of-range values

Issue better warnings for out-of-range values.  This is not yet
complete.

In particular, note we may have out-of-range for values that end up
being subject to optimization.  That is because the optimization takes
place on the *truncated* value, not the pre-truncated value.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agotest: change .stdout/.stderr to stdout/stderr
H. Peter Anvin [Tue, 7 Oct 2008 01:27:30 +0000 (18:27 -0700)]
test: change .stdout/.stderr to stdout/stderr

Using hidden files are rather antisocial, and rather pointless in this
particular context.  Change .stdout and .stderr to simply stdout and
stderr.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agochanges: document CVT fixes.
H. Peter Anvin [Tue, 7 Oct 2008 01:00:13 +0000 (18:00 -0700)]
changes: document CVT fixes.

Document fixes to the CVT instructions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoBR 2148476: Fix arguments for a bunch of the CVT* instructions
H. Peter Anvin [Tue, 7 Oct 2008 00:58:57 +0000 (17:58 -0700)]
BR 2148476: Fix arguments for a bunch of the CVT* instructions

Fix bugs exposed by test for BR 2148476.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agotest/br2148476.asm: comprehensive test of the CVT* instructions
H. Peter Anvin [Tue, 7 Oct 2008 00:57:18 +0000 (17:57 -0700)]
test/br2148476.asm: comprehensive test of the CVT* instructions

Do a best attempt at a comprehensive test of the various CVT* SSE
instructions.  This includes the bug of BR 2148476.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agotest/immwarn.asm: new test for immediate warnings
H. Peter Anvin [Mon, 6 Oct 2008 02:41:32 +0000 (19:41 -0700)]
test/immwarn.asm: new test for immediate warnings

Test for various conditions that should or should not generate
immediate warnings.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agotest/Makefile: rule to run performtest --diff
H. Peter Anvin [Sun, 5 Oct 2008 05:02:44 +0000 (22:02 -0700)]
test/Makefile: rule to run performtest --diff

Rule to run performtest with the --diff option.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoperformtest: use -u with diff
H. Peter Anvin [Sun, 5 Oct 2008 05:01:42 +0000 (22:01 -0700)]
performtest: use -u with diff

Unified diffs are the only sane option.  When calling diff, pass the
-u option.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agotest/Makefile: add rules for the automatic tests
H. Peter Anvin [Sun, 5 Oct 2008 04:59:38 +0000 (21:59 -0700)]
test/Makefile: add rules for the automatic tests

Add Makefile rules to run the automatic tests.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoassemble.c: be smarter about when to suppress warnings due to SBYTE
H. Peter Anvin [Sun, 5 Oct 2008 02:02:30 +0000 (19:02 -0700)]
assemble.c: be smarter about when to suppress warnings due to SBYTE

Be smarter and don't suppress warnings due to SBYTE when the SBYTE
didn't actually match.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoassemble.c: do not warn on valid SBYTE optimizations
H. Peter Anvin [Sun, 5 Oct 2008 01:50:47 +0000 (18:50 -0700)]
assemble.c: do not warn on valid SBYTE optimizations

Do not warn on valid SBYTE optimizations.  If we are optimizing and
match one of the SBYTE conditions, do not error out.

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

15 years agodoc/changes.src: update
H. Peter Anvin [Wed, 1 Oct 2008 17:02:44 +0000 (10:02 -0700)]
doc/changes.src: update

Add information about the recent bug fixes.

15 years agoAlready aligned aligns should be 0 bytes, not %1.
Victor van den Elzen [Wed, 1 Oct 2008 11:16:26 +0000 (13:16 +0200)]
Already aligned aligns should be 0 bytes, not %1.

15 years agoApply patch from BR 890790
Victor van den Elzen [Wed, 1 Oct 2008 11:08:50 +0000 (13:08 +0200)]
Apply patch from BR 890790

15 years agoApply patch from BR 1197827
Victor van den Elzen [Wed, 1 Oct 2008 10:18:28 +0000 (12:18 +0200)]
Apply patch from BR 1197827

15 years agochanges.src: document JMP reg64 fix.
H. Peter Anvin [Wed, 1 Oct 2008 00:14:54 +0000 (17:14 -0700)]
changes.src: document JMP reg64 fix.

Document the fixed JMP reg64.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agordsrc.pl: handle tabs in the input
H. Peter Anvin [Wed, 1 Oct 2008 00:12:19 +0000 (17:12 -0700)]
rdsrc.pl: handle tabs in the input

It is just to painful to keep the source files tab-free.  Handle tabs
in the input as required.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: remove tab
H. Peter Anvin [Wed, 1 Oct 2008 00:07:14 +0000 (17:07 -0700)]
doc: remove tab

The documentation processor doesn't like tabs.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoPut the static information about warnings in a structure
H. Peter Anvin [Wed, 1 Oct 2008 00:01:23 +0000 (17:01 -0700)]
Put the static information about warnings in a structure

Put the static information about warnings in a structure, so one can
see what goes with what.  Also, change the sense so "true" means
enabled.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoAllow %warning output to be suppressed
H. Peter Anvin [Tue, 30 Sep 2008 23:39:17 +0000 (16:39 -0700)]
Allow %warning output to be suppressed

Allow the user to suppress user-specified warnings.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoassemble.c: cleanups
H. Peter Anvin [Tue, 30 Sep 2008 23:31:06 +0000 (16:31 -0700)]
assemble.c: cleanups

Formatting and some other minor cleanups.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoDocument the -O0 and -O1 behaviors.
H. Peter Anvin [Tue, 30 Sep 2008 23:24:47 +0000 (16:24 -0700)]
Document the -O0 and -O1 behaviors.

Document the way the -O0 and -O1 options actually behave.  -O0, in
particular, is NASM 0.98 compatibility mode.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoChange behavior of -O0 and -O1 for backward compatibility
Charles Crayne [Tue, 30 Sep 2008 23:11:32 +0000 (16:11 -0700)]
Change behavior of -O0 and -O1 for backward compatibility

-O0: JMP default to NEAR, Jcc/LOOP/JCXZ default to SHORT.
      In other words, this is reverting to full-blown 0.98 behavior, not
      0.98.39.
-O1: JMP and Jcc default to NEAR, LOOP/JCXZ default to SHORT (only
      possible form).

15 years agoDocument a64 and o64 qualifiers
Charles Crayne [Sat, 27 Sep 2008 00:13:09 +0000 (17:13 -0700)]
Document a64 and o64 qualifiers

Add references and index entries for a64 and o64.

15 years agoAdd more 64-bit jump tests
H. Peter Anvin [Fri, 26 Sep 2008 06:45:20 +0000 (23:45 -0700)]
Add more 64-bit jump tests

15 years agoJMP reg64 does not require a REX.W prefix.
H. Peter Anvin [Fri, 26 Sep 2008 06:42:28 +0000 (23:42 -0700)]
JMP reg64 does not require a REX.W prefix.

We were redundantly emitting a REX.W prefix for JMP reg64.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.04
H. Peter Anvin [Fri, 26 Sep 2008 00:07:41 +0000 (17:07 -0700)]
NASM 2.04

15 years agoSet __PASS__ to 3 for preprocess only
H. Peter Anvin [Thu, 25 Sep 2008 22:45:06 +0000 (15:45 -0700)]
Set __PASS__ to 3 for preprocess only

When running the preprocessor only, set __PASS__ to 3.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoClean up unterminated lines
H. Peter Anvin [Thu, 25 Sep 2008 09:33:24 +0000 (02:33 -0700)]
Clean up unterminated lines

15 years agoActually make non-power-of-2 alignments work
H. Peter Anvin [Thu, 25 Sep 2008 09:31:50 +0000 (02:31 -0700)]
Actually make non-power-of-2 alignments work

We can't use ($$-$) % (%1) since the wraparound will be wrong except
for powers of 2.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.04rc6
H. Peter Anvin [Thu, 25 Sep 2008 00:39:03 +0000 (17:39 -0700)]
NASM 2.04rc6

15 years agoDocument __PASS__
H. Peter Anvin [Thu, 25 Sep 2008 00:34:37 +0000 (17:34 -0700)]
Document __PASS__

Document __PASS__, but discourage users from using it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoAdd __PASS__ builtin macro
H. Peter Anvin [Wed, 24 Sep 2008 17:20:40 +0000 (10:20 -0700)]
Add __PASS__ builtin macro

Add a new builtin macro, __PASS__, which is either 1 (for a
preparatory pass), 2 (for a final pass, including preprocessor only),
or 0 (for dependency generation.)  This might be useful in special
contexts.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoUnbreak %warning
H. Peter Anvin [Wed, 24 Sep 2008 16:14:49 +0000 (09:14 -0700)]
Unbreak %warning

Since the error directives, including %warning, are now issued in the
final pass only, it is important that we do *not* pass ERR_PASS1 with
%warning.  Rather than playing even more ugly games in error(),
require ERR_PASS1 to be passed in with warnings elsewhere in the
preprocessor, just like the rest of the system.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc/changes.src: something closer to final release notes for 2.04
H. Peter Anvin [Wed, 24 Sep 2008 15:59:29 +0000 (08:59 -0700)]
doc/changes.src: something closer to final release notes for 2.04

doc/changes.src should contain the user-visible changes in human
comprehensible form (release notes, not a changelog.)  Get something
closer to what it should look like for 2.04.

15 years agonasmdoc.src: more consistent indentation in %error section
H. Peter Anvin [Wed, 24 Sep 2008 15:46:50 +0000 (08:46 -0700)]
nasmdoc.src: more consistent indentation in %error section

We had different indentation levels only two paragraphs apart.
Overall, the document is horribly inconsistent about indentation,
which should be fixed.

15 years agotest/fwdoptpp: test %error, %warning, %fatal
H. Peter Anvin [Wed, 24 Sep 2008 07:30:46 +0000 (00:30 -0700)]
test/fwdoptpp: test %error, %warning, %fatal

Test all of %error, %warning, and %fatal.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.04rc5
H. Peter Anvin [Wed, 24 Sep 2008 07:26:09 +0000 (00:26 -0700)]
NASM 2.04rc5

15 years ago%error, %warning out on the final pass, add %fatal
H. Peter Anvin [Wed, 24 Sep 2008 07:21:58 +0000 (00:21 -0700)]
%error, %warning out on the final pass, add %fatal

Only process %error or %warning directives on the final pass.  Add a
new %fatal directive which terminates assembly immediately.

15 years agoAllow value to TIMES to be negative while optimization is in progress
Charles Crayne [Wed, 24 Sep 2008 04:49:09 +0000 (21:49 -0700)]
Allow value to TIMES to be negative while optimization is in progress

Change the parser to only issue the "TIMES value %d is negative"
error message if all optimization passes have completed.

15 years agotest: test for code that relies on the optimizer to be valid
H. Peter Anvin [Wed, 24 Sep 2008 00:09:52 +0000 (17:09 -0700)]
test: test for code that relies on the optimizer to be valid

There exists a fair bit of code out there which relies on the
optimizer in order to fit inside a predefined envelope.  NASM 2.04rc4
breaks this; write a simple test to demonstrate.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.04rc4
H. Peter Anvin [Tue, 23 Sep 2008 00:16:30 +0000 (17:16 -0700)]
NASM 2.04rc4

15 years agoBR 1239818 - handle multiple %else clauses
Victor van den Elzen [Thu, 18 Sep 2008 11:51:36 +0000 (13:51 +0200)]
BR 1239818 - handle multiple %else clauses

Using multiple %else clauses or mixing %else and %elif
caused strange results.
Warn about it and produce sensible results.

15 years agoNASM 2.04rc3
H. Peter Anvin [Sat, 13 Sep 2008 01:12:03 +0000 (18:12 -0700)]
NASM 2.04rc3

15 years agoHalt assembly if addresses are not converging.
Charles Crayne [Fri, 12 Sep 2008 01:54:06 +0000 (18:54 -0700)]
Halt assembly if addresses are not converging.

Change global_offset_changed from bool to int so that
progress of convergence can be monitored. If change count
does not decrease from previous pass, increment stall counter.
If stall count reaches threshold, terminate assembly
with error message.

15 years agoLimit number of passes to 1000
Victor van den Elzen [Thu, 11 Sep 2008 13:07:05 +0000 (15:07 +0200)]
Limit number of passes to 1000

Now NASM won't take unreasonable an amount of time to generate
wrong code when it encounters equ's that don't converge, ex:

FOO equ FOO + 1

15 years agoRemove obsolete ROL-EQU hack
Victor van den Elzen [Thu, 11 Sep 2008 11:14:23 +0000 (13:14 +0200)]
Remove obsolete ROL-EQU hack

Now that there is proper forward reference resolution,
we can get rid of this junk. Wiping the flags also
removed the SBYTEnn flags, causing

cmp eax, a-b
a: nop
b:

to assemble with -Ox like

cmp eax, strict dword -1

This is now fixed.

15 years agodoc: document the use of macros in %error
H. Peter Anvin [Thu, 11 Sep 2008 06:34:39 +0000 (23:34 -0700)]
doc: document the use of macros in %error

Document the use of macros in %error and %warning, valid since 2.03.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: Call %xdefine a "resolving define" instead of "enhancing define"
H. Peter Anvin [Thu, 11 Sep 2008 06:29:45 +0000 (23:29 -0700)]
doc: Call %xdefine a "resolving define" instead of "enhancing define"

%xdefine is an early-binding %define (%define being late-binding.)
There is nothing "enhanced" about it, it just specifies a different
policy.  Call it a "resolving define" instead.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agodoc: clean up formatting around -O option
H. Peter Anvin [Thu, 11 Sep 2008 06:27:10 +0000 (23:27 -0700)]
doc: clean up formatting around -O option

Clean up the formatting in descriptions of the -O option.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.04rc2
H. Peter Anvin [Thu, 11 Sep 2008 06:05:18 +0000 (23:05 -0700)]
NASM 2.04rc2

15 years agochanges: document optimizer change
H. Peter Anvin [Thu, 11 Sep 2008 06:04:56 +0000 (23:04 -0700)]
changes: document optimizer change

15 years agoDecouple forward references from optimization
Charles Crayne [Thu, 11 Sep 2008 02:21:52 +0000 (19:21 -0700)]
Decouple forward references from optimization

Users who wish to control the level of optimization can
continue to specify -O0, -O1, or -Ox,
where x can be the letter itself, or any number > 1.

However, even with optimization turned off,
NASM will always make enough passes to resolve
forward references. As a result, INCBIN is now the only
item left in the critical expressions list, although TIMES
still has its own constant value check.

15 years agoRun "make alldeps"
H. Peter Anvin [Tue, 9 Sep 2008 16:54:47 +0000 (09:54 -0700)]
Run "make alldeps"

15 years agomacros.pl: don't include macros for disabled output formats
H. Peter Anvin [Tue, 9 Sep 2008 16:54:03 +0000 (09:54 -0700)]
macros.pl: don't include macros for disabled output formats

Don't include macros for output formats we aren't compiling in.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agooutaout.mac: aoutb is an alias for aout
H. Peter Anvin [Tue, 9 Sep 2008 16:53:20 +0000 (09:53 -0700)]
outaout.mac: aoutb is an alias for aout

aoutb is an alias format for aout (in the sense they use the same
macro set.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agomacros.pl: be a bit more careful with open()
H. Peter Anvin [Tue, 9 Sep 2008 16:43:16 +0000 (09:43 -0700)]
macros.pl: be a bit more careful with open()

Be a bit more strict with open() calls.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agomacros: win32 and win64 are COFF, not Mach-O
H. Peter Anvin [Tue, 9 Sep 2008 16:37:37 +0000 (09:37 -0700)]
macros: win32 and win64 are COFF, not Mach-O

Somehow the win32 and win64 aliases got listed on Mach-O, not on
COFF.  This doesn't have any effect on the current code, but might in
the future.  Correct.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoNASM 2.04rc1
H. Peter Anvin [Wed, 3 Sep 2008 22:25:33 +0000 (15:25 -0700)]
NASM 2.04rc1

15 years agoRemove obsolete tagrelease script (duplicate of tag-release)
H. Peter Anvin [Wed, 3 Sep 2008 22:22:23 +0000 (15:22 -0700)]
Remove obsolete tagrelease script (duplicate of tag-release)

15 years agoUpdate doc/changes.src
H. Peter Anvin [Wed, 3 Sep 2008 22:16:44 +0000 (15:16 -0700)]
Update doc/changes.src

15 years agoDocument %use smartalign
H. Peter Anvin [Wed, 3 Sep 2008 22:03:20 +0000 (15:03 -0700)]
Document %use smartalign

15 years agoDocument %unmacro
H. Peter Anvin [Wed, 3 Sep 2008 21:31:20 +0000 (14:31 -0700)]
Document %unmacro

15 years agooutcoff: stylistic cleanups
H. Peter Anvin [Tue, 2 Sep 2008 19:56:39 +0000 (12:56 -0700)]
outcoff: stylistic cleanups

Don't use explicit L's for things which are really size_t; not only is
it unnecessarily ugly, but it's wrong in a lot of ways.  Do some other
minor stylistic cleanups.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agooutcoff: default output symbols to T_NULL
H. Peter Anvin [Tue, 2 Sep 2008 19:55:35 +0000 (12:55 -0700)]
outcoff: default output symbols to T_NULL

We would leave the output symbol type uninitialized.  Explicitly
initialize it to zero (T_NULL, meaning no symbol type information),
since that's what was effectively done.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
15 years agoBR 2048950: fix crash due to mmacro list overflow
H. Peter Anvin [Mon, 1 Sep 2008 17:56:33 +0000 (10:56 -0700)]
BR 2048950: fix crash due to mmacro list overflow

When allocating the buffer for an mmacro list, we apparently failed to
guarantee space for the terminating NULL.  This almost certainly
caused the crash described in BR 2048950, and quite possibly BR
1284169.

15 years agotest/new: clean up whitespace
H. Peter Anvin [Sat, 30 Aug 2008 01:04:16 +0000 (18:04 -0700)]
test/new: clean up whitespace

15 years agoScript to create new test case boilerplate
H. Peter Anvin [Sat, 30 Aug 2008 00:27:00 +0000 (17:27 -0700)]
Script to create new test case boilerplate

15 years agoAccept implicit memory size for VMREAD/VMWRITE
H. Peter Anvin [Fri, 29 Aug 2008 01:05:23 +0000 (18:05 -0700)]
Accept implicit memory size for VMREAD/VMWRITE

15 years agoBR 2029472: Wrong operand size for VMREAD/VMWRITE in 64-bit mode
H. Peter Anvin [Fri, 29 Aug 2008 01:03:49 +0000 (18:03 -0700)]
BR 2029472: Wrong operand size for VMREAD/VMWRITE in 64-bit mode

Fix the operand size for VMREAD/VMWRITE in 64-bit mode

15 years ago.gitignore: ignore some editor backup files
H. Peter Anvin [Fri, 29 Aug 2008 00:56:17 +0000 (17:56 -0700)]
.gitignore: ignore some editor backup files

Ignore a couple of variants of editor backup files.

15 years agoBR 2028995: Missing MOVNTI m64, r64
H. Peter Anvin [Fri, 29 Aug 2008 00:54:55 +0000 (17:54 -0700)]
BR 2028995: Missing MOVNTI m64, r64

Fix MOVNTI with a 64-bit argument.

15 years agoTestcase for XCRYPT
H. Peter Anvin [Fri, 29 Aug 2008 00:48:34 +0000 (17:48 -0700)]
Testcase for XCRYPT

15 years agoBR 2029829: Accept VIA XCRYPT instructions with or without REP
H. Peter Anvin [Fri, 29 Aug 2008 00:47:16 +0000 (17:47 -0700)]
BR 2029829: Accept VIA XCRYPT instructions with or without REP

Accept the VIA XCRYPT instructions either with or without a REP
prefix, as documented.

Add the missing XCRYPTCTR instruction.

15 years agoBR 2039212: Handle indirect far jumps in 64-bit mode
H. Peter Anvin [Fri, 29 Aug 2008 00:35:25 +0000 (17:35 -0700)]
BR 2039212: Handle indirect far jumps in 64-bit mode

Handle indirect far jumps in 64-bit mode.  Default to 64 bit unless
overridden, for consistency with other jumps.

15 years agoInclude "nasm.h" in "float.h"
H. Peter Anvin [Thu, 28 Aug 2008 20:36:10 +0000 (13:36 -0700)]
Include "nasm.h" in "float.h"

"float.h" references efunc, so it needs "nasm.h".
It also has uint8_t and so need <inttypes.h>, but that's part of
"nasm.h".