Commit Graph

324 Commits

Author SHA1 Message Date
H. Peter Anvin
207b1c4d3d test/ppindirect.asm: test token pasting inside %[...]
Test for token pasting inside %[...].

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-19 22:23:12 -07:00
H. Peter Anvin
2d4722fe4c test: better smartalign tests
Smartalign tests for 16, 32 and 64-bit mode.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-19 16:47:53 -07:00
H. Peter Anvin
45d5f2f822 test: add test for preprocessor indirection construct
Add a test for the preprocessor indirection construct, %[...].

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-19 16:25:57 -07:00
H. Peter Anvin
93c7aa2302 test/elf64so.asm: demonstrate a case where we bind to the wrong symbol
Show an artificial case where we bind to the wrong symbol, due to the
confusion in the output system between the size of relative symbols
and their position.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-17 23:14:53 -07:00
H. Peter Anvin
9d8b57d081 test/Makefile: enable debugging info for elftest/elftest64
Enable debugging information for the ELF tests.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-17 23:03:54 -07:00
H. Peter Anvin
15ed768673 elftest64: both Small PIC and Medium PIC model tests
Try both Small PIC and Medium PIC model references.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-17 22:10:33 -07:00
H. Peter Anvin
9a1f9f5ab6 test/Makefile: the elftest objects depend on $(NASM)
If NASM has changed, we logically want to re-run the ELF tests...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-17 19:29:15 -07:00
H. Peter Anvin
e41b69beaf Test and Makefile rules for 32- and 64-bit ELF shared libraries
Add Makefile rules for the 32-bit ELF shared library test, and add a
64-bit ELF shared library test (still work in progress.)
2008-10-17 17:13:26 -07:00
H. Peter Anvin
d41e07bd2e Test for BR 2172659
Test for the bug fix for BR 2172659 (invalid byte-sized immediates.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-16 13:03:40 -07:00
H. Peter Anvin
b048324b9e Test for various ELF64 GOT references
Try to test for various GOT references in ELF64.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-15 15:22:03 -07:00
H. Peter Anvin
aac7c0c174 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>
2008-10-08 23:32:33 -07:00
H. Peter Anvin
c3ba3acf70 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>
2008-10-08 23:30:41 -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
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
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
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
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
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
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
H. Peter Anvin
0819e3b9a7 Add more 64-bit jump tests 2008-09-25 23:45:20 -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
9ebf2cb938 test/fwdoptpp: test %error, %warning, %fatal
Test all of %error, %warning, and %fatal.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-09-24 00:30:46 -07:00
H. Peter Anvin
8e3f75ea6e %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.
2008-09-24 00:21:58 -07:00
H. Peter Anvin
0af3e7ed3c 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>
2008-09-23 17:09:52 -07:00
Victor van den Elzen
3b404c0f6b 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.
2008-09-18 13:51:36 +02:00
Victor van den Elzen
28f4634634 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.
2008-09-11 13:14:23 +02:00
H. Peter Anvin
5c10c17ba0 test/new: clean up whitespace 2008-08-29 18:04:16 -07:00
H. Peter Anvin
1c7cb9e28c Script to create new test case boilerplate 2008-08-29 17:27:00 -07:00
H. Peter Anvin
163e5874d9 Accept implicit memory size for VMREAD/VMWRITE 2008-08-28 18:05:23 -07:00
H. Peter Anvin
5e7d6f1105 BR 2029472: Wrong operand size for VMREAD/VMWRITE in 64-bit mode
Fix the operand size for VMREAD/VMWRITE in 64-bit mode
2008-08-28 18:03:49 -07:00
H. Peter Anvin
dd1de39ece BR 2028995: Missing MOVNTI m64, r64
Fix MOVNTI with a 64-bit argument.
2008-08-28 17:54:55 -07:00
H. Peter Anvin
3ba3af3290 Testcase for XCRYPT 2008-08-28 17:48:34 -07:00
H. Peter Anvin
7b4dc622c6 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.
2008-08-28 17:35:25 -07:00
H. Peter Anvin
dace226187 test: Fix file with no final newline
Fix test/br2030823.asm, which had no final newline.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-08-24 18:17:09 -07:00
H. Peter Anvin
2a09b3bf11 BR 2030823: Problem with the 256-bit FMA instructions
Fix the 256-bit FMA instructions per bug report.
2008-08-13 16:25:08 -07:00
Victor van den Elzen
a21194646a minor bugfix in performtest.pl 2008-08-06 15:15:01 +02:00
Victor van den Elzen
22343c2c72 Add macro-defaults warning class and documentation. 2008-08-06 14:48:55 +02:00
H. Peter Anvin
932de6c252 BR 2034542: fix crash when touching __FILE__
Touching __FILE__ would cause a dereference of an uninitialized
pointer.  Fix.
2008-07-31 18:46:11 -07:00
Victor van den Elzen
0e857f1fe5 Improve checking and documentation for %ifctx 2008-07-23 13:21:29 +02:00
H. Peter Anvin
289ff7e2a8 BR 2003451: add test case
Add test case for BR 2003451: forwardness leakage between operands.
2008-07-19 21:40:07 -07:00
Slavik Gnatenko
1b67bd25b2 BR 2010180: outobj: Garbage may be written in a last PUBDEF
The testcase illustrates the problem. After "nasm -f obj
alonesym.nasm"
let's look to dump:

======
PUBDEF386(91) recnum:5, offset:0000005bh, len:03f9h, chksum:bbh(bb)
Group: 0, Seg: 1
00020000h - 'sym0000' Type:0
00020004h - 'sym0001' Type:0
....
00020134h - 'sym0077' Type:0

PUBDEF(90) recnum:6, offset:00000457h, len:000ah, chksum:b6h(b6)
Group: 0, Seg: 1
00000138h - 's' Type:2
0000b600h - '' Type:0
======

The problem is while 's' offset is 20138h it is marked as type 90h not
91h.  The root cause is located in obj_x():

static ObjRecord *obj_x(ObjRecord * orp, uint32_t val)
{
    if (orp->type & 1)
    	orp->x_size = 32;
    if (val > 0xFFFF)
        orp = obj_force(orp, 32);
    if (orp->x_size == 32)
        return (obj_dword(orp, val));
    orp->x_size = 16;
    return (obj_word(orp, val));
}

It sets up x_size and than writes data. In the testcase data are the
offset and this offset overflows a record. In this case the record is
emitted and its x_size is cleared. Because this is last PUBDEF the new
record with only 's' symbol is emitted also but its x_size is not 32
(it's still zero) so obj_fwrite doesn't switch to 91h type.

The problem seems to be very generic and expected to be occurred on
many other record types as well.

        ----

And the fix is simple:

if (orp->x_size == 32)
{
  ObjRecord * nxt = obj_dword(orp, val);
  nxt->x_size = 32; /* x_size is cleared when a record overflows */
  return nxt;
}
2008-07-19 19:27:41 -07:00
H. Peter Anvin
4fb7ed0566 test: more smart alignment test 2008-07-17 14:29:07 -07:00
H. Peter Anvin
f5975eead1 smartalign.mac: smart alignments macro package
"%use smartalign" followed by an optional "alignmode" can be used to
enable smart macros.
2008-07-16 14:41:39 -07:00
Victor van den Elzen
1f1f38bcd0 update tests 2008-07-16 12:20:26 +02:00
Victor van den Elzen
cabec40a39 Improve performtest.pl
Improve arguments and documentation of performtest.pl
Remove carriage returns in .stdout/.stderr so *nix can
read Windows test results
2008-07-16 12:20:21 +02:00
H. Peter Anvin
96a6954db4 BR 2017453: indirect jumps in 64-bit mode are implicitly 64 bits
Indirect jumps in 64-bit mode implicitly have 64-bit operand size.
Fix this; the disassembly is still unnecessarily ugly, however.
2008-07-13 15:21:01 -07:00
H. Peter Anvin
570b1c12b6 test: add test of nested %rep, BCD constants, and %warning
Add a test case which has smoked out errors in the handling of nested
%rep, BCD constants, and %warning...
2008-07-13 15:06:55 -07:00
H. Peter Anvin
514c8de2a3 test: simple test of packed BCD. 2008-07-03 20:16:40 -07:00
H. Peter Anvin
a676075b51 test: add a test for %imacro
Add a test for case-insensitive matching of %imacro.
2008-06-28 18:32:16 -07:00
H. Peter Anvin
6f4252afea utf.asm: add some error cases
Add some error cases for testing
2008-06-15 17:53:12 -07:00
H. Peter Anvin
9c749101ef Support __utf16__ and __utf32__ in an expression context
Support __utf16__ and __utf32__ in expression contexts.
2008-06-14 21:08:38 -07:00
H. Peter Anvin
6e6cd16a45 Merge commit 'autotest/master' 2008-05-27 18:15:39 -07:00
H. Peter Anvin
f9ca812cf8 avx.bin: clean up screwy whitespace 2008-05-26 22:52:57 -07:00
H. Peter Anvin
62449a6ce0 VCVTPD2PS, VCVTPD2DQ, VCVTTPD2DQ mem need explicit op size (BR 1974170)
BR 1974170: VCVTPD2PS, VCVTPD2DQ, VCVTTPD2DQ with a memory operand are
ambiguous without a specific operand size, so force one to be added.

Split the instruction pattern due to our current clunky handling of
MMX/XMM/YMM registers together with sizes.  Fix in the future, please!
2008-05-26 22:48:51 -07:00
H. Peter Anvin
7c71949931 AVX: instruction table up to PE
Complete the instruction table up to and including PE (document
319433-002, start next on page 5-330).
2008-05-21 23:21:57 -07:00
H. Peter Anvin
895f56b611 Add legacy blendvpd to avx.asm, as a disassembler test. 2008-05-21 15:03:26 -07:00
Victor van den Elzen
1fc045591b Add automation to avx test. 2008-05-21 13:33:26 +02:00
Victor van den Elzen
82fa68acec Configure tests to be performed automatically 2008-05-21 12:42:46 +02:00
Victor van den Elzen
533385ace5 Add automated testing script 2008-05-21 12:42:45 +02:00
H. Peter Anvin
52dc353868 Handle is4 bytes without meaningful information in the bottom bits
Support is4 bytes without meaningful information in the bottom bits.
This is equivalent to /is4=0 for the assembler, but makes the bottom
bits don't care for the disassembler.
2008-05-20 19:29:04 -07:00
H. Peter Anvin
e303936391 Fix encoding of VPERMIL2PS instructions 2008-05-06 20:06:14 -07:00
H. Peter Anvin
7334e3ac23 Initial NDISASM support for AVX instructions/VEX prefixes
Initial NDISASM support for AVX instructions and VEX prefixes.  It
doesn't mean it's correct, but it seems to match my current
understanding.  It can disassemble *some*, but not *all*, of the AVX
test cases (which are known to be at least partially incorrect...)
2008-05-05 18:47:27 -07:00
H. Peter Anvin
d85d250fa2 First cut at AVX machinery.
First cut at AVX machinery support.  The only instruction implemented
is VPERMIL2PS, and it's probably buggy.  I'm checking this in with the
hope that other people can start helping out with (a) testing this,
and (b) adding instructions.

NDISASM support is not there yet.
2008-05-04 17:53:31 -07:00
H. Peter Anvin
accf94ea24 Better handling of 32-bit imms in 64-bit moves
A much better way to handle the 32-bit immediates in 64-bit moves.
Add a test file.
2008-03-19 14:52:27 -07:00
H. Peter Anvin
134b94665d Add %ifempty and variants 2008-02-16 17:01:40 -08:00
H. Peter Anvin
cbf768d67d Implement %iftoken, test for a single token
Implement %iftoken, a test for a single token.  This is useful in
cases using %+ to splice a macro-provided token.
2008-02-16 16:41:25 -08:00
H. Peter Anvin
6b18bcce46 BR 774131: date and time macros
This checkin creates the following date and time macros:

__DATE__, __TIME__, __UTC_DATE__, __UTC_TIME__: strings

__DATE_NUM__, __TIME_NUM__, __UTC_DATE_NUM__, __UTC_TIME_NUM__:
civil dates in digit-string formats

__POSIX_TIME__: time in POSIX time_t format
2008-02-16 14:54:10 -08:00
H. Peter Anvin
053a01f143 Test for BR 1879590 2008-01-30 14:13:46 -08:00
Beroset
095e6a2973 regularized spelling of license to match name of LICENSE file 2007-12-29 09:44:23 -05:00
H. Peter Anvin
7812644665 BR 993895: Support zero-operand floating-point insn
Support the zero-operand form of floating-point instructions.  Note
that in most cases, the form generated is actually the "popping" form,
e.g. "FADD" becomes "FADDP st0,st1".  This is in accordance with the
Intel documentation.  "FADDP" is also supported.
2007-11-15 14:38:19 -08:00
H. Peter Anvin
bb72f7f111 Un-special-case "xchg rax,rax"; disassemble o64
Un-special-case "xchg rax,rax"; allow it to be encoded as 48 90 for
orthogonality's sake.  It's a no-op, to be sure, but so are many other
instructions.

"xchg eax,eax" is still special-cased in 64-bit mode since it is not a
no-op; unadorned opcode 90 is now simply "nop" and nothing else.

Make the disassembler detect unused REX.W and display them as an "o64"
prefix.
2007-11-12 22:56:07 -08:00
H. Peter Anvin
4b3390eb47 BR 1828866: fix handling of LAR/LSL
Fix handling of LAR/LSL with various sized operands
2007-11-12 22:05:31 -08:00
H. Peter Anvin
f72151f43e Test of XCHG
Test for XCHG
2007-11-12 20:18:33 -08:00
H. Peter Anvin
8781cb0d00 BR 1828103: Fix %arg and %local
Correct the implementation of %arg and %local.

It's questionable how much they make sense for 64-bit mode; even in
32-bit mode one normally make references off the stack pointer instead
of the base pointer (frame pointer), but that requires keeping track
of the stack pointer offset.
2007-11-08 20:01:11 -08:00
H. Peter Anvin
9c98769a33 Permit opcode names as labels as long as they are followed by a colon
Permit opcode names to be used as labels if and only if they are
succeeded by a colon.  Opcode names occurring when parsing expressions
are all treated as labels; a leading colon occurred when parsing an
instruction forces a parser restart with the instruction forcibly
treated as an identifier.
2007-11-04 21:10:42 -08:00
H. Peter Anvin
1b9dd7d1e1 Even more "riprel" tests
Add a64 and a32 combinations.
2007-10-31 10:59:26 -07:00
H. Peter Anvin
a30acb52cd floatx.asm: add tests for "rounds up to smallest denorm"
Add tests for the case where we round upwards to reach the smallest
possible denorm, i.e. "saved from underflow by rounding."
2007-10-30 01:17:57 -07:00
H. Peter Anvin
84b5d2c539 Exhaustive test for 8-bit floating point values 2007-10-30 00:59:27 -07:00
H. Peter Anvin
2ce0274303 Use a 32-bit floating-point limb size; support 8-bit float
Use a 32-bit limb size ("like a digit, but bigger") for floating-point
conversion.  This cuts the number of multiplications per constant by a
factor of four.

This means supporting fractional-limb-sized numbers, so while we're at
it, add support for 8-bit floating point numbers (apparently used in
graphics and in audio compression applications.)
2007-10-29 20:20:12 -07:00
H. Peter Anvin
6745d722f4 Test of some addressing modes in 64-bit mode. 2007-10-28 23:23:24 -07:00
H. Peter Anvin
083f0c32e7 readnum(): handle prefix-suffix collision like "0h"
Suffixed versions of zero will look like both a prefix and a suffix.
Reject the prefixed version as being too short to decode.
2007-10-26 21:38:02 -07:00
H. Peter Anvin
c2df282092 Fix the handling of floating-point tokens in the preprocessor
Correct the handling of floating-point tokens in the preprocessor.
The preprocessor scanner and the main scanner really are painfully
divergent for no good reason.
2007-10-24 15:29:51 -07:00
H. Peter Anvin
50620f4a3f Unbreak particularly tricky hex constants
Unbreak hex constants which contain 'b' or 'd' in potentially tricky
places.
2007-10-22 19:48:06 -07:00
H. Peter Anvin
c65a2f634b Support binary and octal floating-point
For consistency, support binary and octal floating-point, and accept
a "0d" or "0t" prefix for decimal floating-point.  However, we do not
accept a binary exponent (p) for a decimal mantissa, or vice versa.
2007-10-22 17:34:10 -07:00
H. Peter Anvin
bea0bbb62c More consistent handling of radix letters
Allow any radix letter from the set [bydtoqhx] to be used either
"Intel-style" (0...x) or "C-style" (0x...).  In Intel style, the
leading 0 remains optional as long as the first digit is in the range
0-9.

As a consequence, allow the prefix "0h" for hexadecimal floating
point.
2007-10-22 16:53:48 -07:00
H. Peter Anvin
449e04b330 Allow $-prefixed hexadecimal FP as an alternative to 0x
Since we allow the prefix $ instead of 0x for integer constants, do
the same for floating point.  No suffix support at this time; we may
want to consider if that would be appropriate.
2007-10-19 18:33:57 -07:00
H. Peter Anvin
7065309739 Formatting: kill off "stealth whitespace"
"Stealth whitespace" makes it harder to read diffs, and just generally
cause unwanted weirdness.  Do a source-wide pass to get rid of it.
2007-10-19 14:42:29 -07:00
H. Peter Anvin
31420e76d1 test/floatx.asm: fix test case
"dq" should have been "dt"
2007-10-19 14:26:52 -07:00
H. Peter Anvin
513e3c1bd2 uscore.asm: Fix test case
"$1e+16" was missing, instead "$1e16" was duplicated
2007-10-19 14:19:52 -07:00
H. Peter Anvin
37d88e4125 Don't confuse suffixed hexadecimal with floating-point
1e30 is a floating-point constant, but 1e30h is not.  The scanner
won't know that until it sees the "h", so make sure we keep enough
state to be able to distinguish "1e30" (a possible hex constant) from
"1.e30", "1e+30" or "1.0" (unabiguously floating-point.)
2007-10-19 14:10:35 -07:00
H. Peter Anvin
487a087066 test/Makefile: Use -Ox instead of -O999 2007-10-19 13:16:51 -07:00
H. Peter Anvin
361584882e Test of underscored constants 2007-10-19 13:14:06 -07:00
H. Peter Anvin
a366cac2a6 Tests of obscenely large exponents 2007-10-16 15:46:04 -07:00
H. Peter Anvin
125c878e96 Handle rounding of denorms correctly; make fp overflow a warning
- Handle rounding of denorms correctly
- Make fp overflow a warning, not an error (produces Inf)
- Make fp warnings controllable
2007-10-16 11:32:58 -07:00
H. Peter Anvin
61872221ad Add 1.5 as a test case: representative of an exact fraction
1.5 is an exactly representable fraction, useful for test.
2007-10-16 10:31:16 -07:00
H. Peter Anvin
32f21f16fc Add testnos3 from the gdtoa package (floating-point test) 2007-10-15 17:48:43 -07:00
Charles Crayne
b263b504bc Must define types before using them 2007-10-11 20:32:33 -07:00
H. Peter Anvin
f57f55c9cb Revert "floatb.asm: fix broken testcase"
This reverts commit d9e3116be1.

0x513c1704 is 50.49e9, not 50.40e9
2007-10-08 19:26:57 -07:00
H. Peter Anvin
d9e3116be1 floatb.asm: fix broken testcase
50.40e9 as a 32-bit float is 0x513c1704
2007-10-08 18:39:24 -07:00
H. Peter Anvin
36a8f95bd0 Add Frank's floattest.asm test file 2007-10-08 12:12:23 -07:00
H. Peter Anvin
30c3ad1024 zerobyte.asm: use a real instruction to avoid confusing ndisasm
It's useful to be able to disassemble a test case, so avoid mixing
data bytes and code.
2007-10-05 17:44:16 -07:00
H. Peter Anvin
653e03bef5 zerobyte.asm: add test cases for non-initial \170 uses
Add test cases for noninitial uses of \170, in order to test for
accidental duplication of REX prefixes.
2007-10-05 17:42:31 -07:00
H. Peter Anvin
5d4fd7accc Check in the proper zerobyte test
The previous checkin checked in zerobyte.bin, not zerobyte.asm
2007-10-05 17:29:01 -07:00
H. Peter Anvin
c189b44032 Emit REX prefix before literal zero (\170) 2007-10-05 17:04:32 -07:00
H. Peter Anvin
9d14a10858 Add test for problematic floats 2007-10-05 14:36:03 -07:00
H. Peter Anvin
6b74577d7f floatx.asm: add Inf and NaN to the boundary condition tests 2007-10-04 23:51:08 -07:00
H. Peter Anvin
6b8abf54d3 floatx.asm: add specific tests for exponent boundary conditions
Add tests for the exponent boundaries (underflow, denorm, normal).
2007-10-04 23:09:19 -07:00
H. Peter Anvin
b8e604eb5d Additional rules in test/Makefile
Add rules for .pl -> .asm
2007-10-04 15:18:23 -07:00
H. Peter Anvin
d0b0d28f42 Unbreak relative references to immediate addresses
Remove bogus "treat labels different from immediates" code, which
would result in generating of a relative mod/rm but without adjusting
the address accordingly.

Update addressing mode test.
2007-09-28 17:17:20 -07:00
H. Peter Anvin
3f9bc94b6e Test for various addressing modes in 64-bit mode
Test of various addressing modes in 64-bit mode.  Relative addresses
specified as numbers are currently broken!!
2007-09-26 17:00:18 -07:00
H. Peter Anvin
b0aff17908 test/movimm.asm: add optimizable forms
Add optimizable forms that probably should be shrunk by the optimizer.
2007-09-25 15:44:40 -07:00
H. Peter Anvin
0bd2565dd7 Test of immediate handling on 64-bit mode 2007-09-25 15:39:42 -07:00
H. Peter Anvin
3e1aaa9dd0 Fix BR 1490407: size of the second operand of LAR/LSL
The second operand of LAR/LSL is always 16 bits.
2007-09-25 14:26:03 -07:00
H. Peter Anvin
9713703db7 test/Makefile: make a bit more useful 2007-09-24 13:42:09 -07:00
H. Peter Anvin
dc467ba8af Support __float*__ for floating-point numbers in expressions
Add special operators to allow the use of floating-point constants in
contexts other than DW/DD/DQ/DT/DO.

As part of this checkin, make MAX_KEYWORD generated by tokhash.pl,
since it knows what all the keywords are so it can tell which one is
the longest.
2007-09-24 12:30:54 -07:00
H. Peter Anvin
fc565dd362 Implement INVLPGA according to the documentation
INVLPGA is defined as taking rax,ecx but "the portion of rax used to
form the address is determined by the effective address size", so it
is really ax/eax/rax.
2007-09-22 22:35:28 -07:00
H. Peter Anvin
20dec371dc Simple test for 0x67 prefixes 2007-09-22 21:50:03 -07:00
H. Peter Anvin
f04031bbd7 Make test/Makefile a bit more useful
Make all the tests depend on the nasm binary...
2007-09-22 21:47:13 -07:00
H. Peter Anvin
eb49a4e1d4 Merge commit 'origin/sse5' 2007-09-19 16:22:03 -07:00
H. Peter Anvin
b4b4317878 test/Makefile: make a bit more useful 2007-09-19 16:15:22 -07:00
H. Peter Anvin
f48bc6fb48 Support generating NaNs and infinities
Support generating NaNs and infinities as part of floating-point
constants.
2007-09-18 21:55:56 -07:00
H. Peter Anvin
72ac77bb0b Simple test for hexadecimal floating-point numbers
Very trivial test for hexadecimal floating-point numbers
2007-09-18 18:37:36 -07:00
H. Peter Anvin
e31747e95b Unify all standard IEEE floating-point formats; add 128-bit
Unify all the standard IEEE formats into one function, add support for
IEEE standard 128-bit floating point numbers.

The 80-bit format is still special since it explicitly represents the
integer portion.
2007-09-18 17:50:34 -07:00
H. Peter Anvin
cf5180a955 Actually generate SSE5 instructions
This checkin completes what is required to actually generate SSE5
instructions.  No support in the disassembler yet.

This checkin covers:

- Support for actually generating DREX prefixes.
- Support for matching operand "operand X must match Y"
2007-09-17 17:25:27 -07:00
H. Peter Anvin
2ced2ec370 test/r13.asm: test special-casing of rbp and r13 in 64-bit mode
Test that we correctly special-case the modr/m generation for r13 in
64-bit mode.
2007-09-17 13:19:25 -07:00
H. Peter Anvin
9ab60dabcc Simple performance benchmarks: label, macro and token lookups
Simple scripts to generate performance benchmarks for label,
macro and token lookups.  The label and macro lookups are simple
numerical sequences; it may be desirable to add some more
sophisticated algorithms for producing tokens in case we want to
compare different hash functions against each other.
2007-09-13 18:13:20 -07:00
H. Peter Anvin
53a3c687dd Fix some MMX/SSE irregularities which interact with the 64-bit support 2007-09-02 16:37:03 +00:00
H. Peter Anvin
4768f5f6f2 Simple 64-bit org test 2007-09-02 06:23:29 +00:00
H. Peter Anvin
3894519675 Use standard macro for the default directive 2007-08-29 16:41:43 +00:00
H. Peter Anvin
859f085985 More test cases for rel and abs addressing 2007-08-29 16:38:47 +00:00
H. Peter Anvin
12fc7bc4b2 Add test cases for IP-relative addressing 2007-08-29 15:49:53 +00:00
Keith Kanios
b7a89544d0 General push for x86-64 support, dubbed 0.99.00. 2007-04-12 02:40:54 +00:00
H. Peter Anvin
e2c80181b6 Apply Nindent to all .c and .h files 2005-01-15 22:15:51 +00:00
Stanislav Karchebny
d52236c00e Revert erroneous macro added and modify __OUTPUT_FORMAT__ to a string const 2003-09-25 11:43:28 +00:00
Stanislav Karchebny
5e8f36611f Consistency fix 2003-09-25 11:28:45 +00:00
Stanislav Karchebny
88a049aca1 Added _NASM_FORMAT_ macro 2003-09-24 10:30:56 +00:00
H. Peter Anvin
88dce03d8e Use the version of tmap.nas that actually caused problems 2003-09-10 23:33:38 +00:00
H. Peter Anvin
8b3d1a546d More test files... 2003-09-08 22:59:45 +00:00
Frank Kotler
16486faf30 fix comment in test/lnxhello.asm 2003-08-06 07:13:59 +00:00
H. Peter Anvin
a3cacd74f5 Add Linux "hello world" example 2003-07-10 00:40:46 +00:00
H. Peter Anvin
752cbe511b Add a test for incorrect handing of offsets with prefixes 2002-11-07 22:45:46 +00:00
H. Peter Anvin
24cfef4f8f Clean up unnecessary dependencies. 2002-09-12 16:34:06 +00:00
H. Peter Anvin
628168c502 Fix Borland C++ optimization bug; add test for bad DOS binaries. 2002-09-12 04:33:58 +00:00
H. Peter Anvin
3ba467795a Deal with another case of address/operand size confusion, BR 560873 2002-05-27 23:19:35 +00:00
H. Peter Anvin
24762d487c Correct handling of SEG <nonsegment>; per BR 560575 2002-05-27 02:19:43 +00:00
Debbie Wiles
591553d88d Added extra tests, to fully test multisection support for .bin format 2002-05-24 14:33:35 +00:00
H. Peter Anvin
52c9ad7b3c Add %elif preprocessor test 2002-05-22 23:01:06 +00:00
H. Peter Anvin
e4b9254447 Add 16-bit imul test for strictness 2002-05-22 20:48:01 +00:00
H. Peter Anvin
8c1da7b3ce Fix the handling of the STRICT keyword 2002-05-22 20:45:09 +00:00
H. Peter Anvin
01377d8d7c Implement new "strict" keyword to inhibit optimization. 2002-05-21 03:16:33 +00:00
H. Peter Anvin
77a036e213 Make .rodata a recognized ELF section with default attributes 2002-05-17 04:51:10 +00:00
H. Peter Anvin
94e6ee0873 Tests for the %ifmacro directives 2002-05-07 04:31:28 +00:00
H. Peter Anvin
9a633fa3b9 NASM 0.98.25alt 2002-04-30 21:08:11 +00:00
H. Peter Anvin
caa82a1e66 NASM 0.98.16 2002-04-30 21:03:11 +00:00
H. Peter Anvin
9eb185bfdb NASM 0.98.15 2002-04-30 21:02:47 +00:00
H. Peter Anvin
788e6c10e1 NASM 0.98.12 2002-04-30 21:02:01 +00:00
H. Peter Anvin
4cf1748e68 NASM 0.98.11 2002-04-30 21:01:38 +00:00
H. Peter Anvin
1cd0e2d5bf NASM 0.98.08 2002-04-30 21:00:33 +00:00
H. Peter Anvin
af535c16cf NASM 0.98.03 2002-04-30 20:59:21 +00:00
H. Peter Anvin
76690a12ad NASM 0.96 2002-04-30 20:52:49 +00:00
H. Peter Anvin
6768eb71d8 NASM 0.95 2002-04-30 20:52:26 +00:00
H. Peter Anvin
d7ed89eac9 NASM 0.94 2002-04-30 20:52:08 +00:00
H. Peter Anvin
ea6e34db64 NASM 0.91 2002-04-30 20:51:32 +00:00