Commit Graph

1418 Commits

Author SHA1 Message Date
H. Peter Anvin
a5c31197f5 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>
2008-10-08 16:56:35 -07:00
H. Peter Anvin
e67484e3cb NASM 2.05rc3 2008-10-08 16:25:26 -07:00
H. Peter Anvin
22098d3618 test/imul.asm: remove obsolete ERROR marker
Error already fixed...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-07 16:53:49 -07:00
H. Peter Anvin
e831d67cec Test for various IMUL patterns
Test for IMUL patterns.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-07 11:28:29 -07:00
H. Peter Anvin
65feb5ae33 Add missing IMUL pattern: reg64,imm8
Make "imul rax,byte 5" work as expected.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-07 11:26:41 -07:00
H. Peter Anvin
37c6d166d2 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>
2008-10-07 10:56:32 -07:00
H. Peter Anvin
55f58acdae 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>
2008-10-07 10:53:08 -07:00
H. Peter Anvin
588df78b0d 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>
2008-10-07 10:05:10 -07:00
H. Peter Anvin
f70fce6cc9 test/immwarn.asm: add a few more non-warning tests
A few non-warning conditions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-07 09:59:18 -07:00
H. Peter Anvin
ad6b8595b9 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>
2008-10-07 09:56:38 -07:00
H. Peter Anvin
98a22a65c0 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>
2008-10-06 23:49:01 -07:00
H. Peter Anvin
c1377e9a98 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>
2008-10-06 23:40:31 -07:00
H. Peter Anvin
94cacf8ea9 NASM 2.05rc2 2008-10-06 19:16:27 -07:00
H. Peter Anvin
68b41d3d47 changes: document immediate fix 2008-10-06 19:15:42 -07:00
H. Peter Anvin
9f8171317d 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>
2008-10-06 19:11:07 -07:00
H. Peter Anvin
a9ed99bddf 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>
2008-10-06 18:49:00 -07:00
H. Peter Anvin
e9d7f1a074 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>
2008-10-06 18:47:29 -07:00
H. Peter Anvin
733cbb3197 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>
2008-10-06 18:28:42 -07:00
H. Peter Anvin
04c6052670 changes: document CVT fixes.
Document fixes to the CVT instructions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-06 18:00:13 -07:00
H. Peter Anvin
ee6789ceb1 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>
2008-10-06 17:58:57 -07:00
H. Peter Anvin
1755a719a4 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>
2008-10-06 17:57:18 -07:00
H. Peter Anvin
9ac2b843b4 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>
2008-10-05 19:41:32 -07:00
H. Peter Anvin
1b221bed25 test/Makefile: rule to run performtest --diff
Rule to run performtest with the --diff option.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-04 22:02:44 -07:00
H. Peter Anvin
9c209cc256 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>
2008-10-04 22:01:42 -07:00
H. Peter Anvin
13d9d869a5 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>
2008-10-04 21:59:38 -07:00
H. Peter Anvin
833caeab28 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>
2008-10-04 19:02:30 -07:00
H. Peter Anvin
6c80ab6f7f 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>
2008-10-04 18:50:47 -07:00
H. Peter Anvin
ece980c38b NASM 2.05rc1 2008-10-01 16:08:23 -07:00
H. Peter Anvin
a3a60e95a0 doc/changes.src: update
Add information about the recent bug fixes.
2008-10-01 10:02:44 -07:00
Victor van den Elzen
fd49408ed9 Already aligned aligns should be 0 bytes, not %1. 2008-10-01 13:21:02 +02:00
Victor van den Elzen
4c9d6220b4 Apply patch from BR 890790 2008-10-01 13:09:27 +02:00
Victor van den Elzen
cf9332ca51 Apply patch from BR 1197827 2008-10-01 12:18:28 +02:00
H. Peter Anvin
1abb9e5370 changes.src: document JMP reg64 fix.
Document the fixed JMP reg64.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-09-30 17:14:54 -07:00
H. Peter Anvin
2aa72b64a6 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>
2008-09-30 17:12:19 -07:00
H. Peter Anvin
e232d9a6bf doc: remove tab
The documentation processor doesn't like tabs.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-09-30 17:07:14 -07:00
H. Peter Anvin
972079f6a8 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>
2008-09-30 17:01:23 -07:00
H. Peter Anvin
2f16043879 Allow %warning output to be suppressed
Allow the user to suppress user-specified warnings.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-09-30 16:39:17 -07:00
H. Peter Anvin
2d5baaa69a assemble.c: cleanups
Formatting and some other minor cleanups.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-09-30 16:31:06 -07:00
H. Peter Anvin
dc0bf47feb 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>
2008-09-30 16:24:47 -07:00
Charles Crayne
f1aefd8456 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).
2008-09-30 16:11:32 -07:00
Charles Crayne
3cc2459944 Document a64 and o64 qualifiers
Add references and index entries for a64 and o64.
2008-09-26 17:13:09 -07:00
H. Peter Anvin
0819e3b9a7 Add more 64-bit jump tests 2008-09-25 23:45:20 -07:00
H. Peter Anvin
6f87180c3f 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>
2008-09-25 23:42:28 -07:00
H. Peter Anvin
bbf8be4b57 NASM 2.04 2008-09-25 17:07:41 -07:00
H. Peter Anvin
61f130f4e9 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>
2008-09-25 15:45:06 -07:00
H. Peter Anvin
2c8ad285fd Clean up unterminated lines 2008-09-25 02:33:24 -07:00
H. Peter Anvin
152656f8d3 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>
2008-09-25 02:31:50 -07:00
H. Peter Anvin
6e79efc26b NASM 2.04rc6 2008-09-24 17:39:03 -07:00
H. Peter Anvin
010aee270f Document __PASS__
Document __PASS__, but discourage users from using it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-09-24 17:34:37 -07:00
H. Peter Anvin
7383b407d9 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>
2008-09-24 10:20:40 -07:00