Commit graph

221 commits

Author SHA1 Message Date
Cyrill Gorcunov
e6775697bb test: Add br3074517.asm
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-24 15:25:59 +04:00
Cyrill Gorcunov
8fe1f65087 Merge branch 'nasm-2.09.xx' 2010-09-18 02:59:08 +04:00
Cyrill Gorcunov
ae7c916b6a Add test-case for BR3066383
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-18 02:48:53 +04:00
H. Peter Anvin
21d4ccc3c3 BR 3052618: handle segment register operations in 64-bit mode
Handle segment register operations in 64-bit mode, and add a few
optimization patterns.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-24 17:30:00 -07:00
H. Peter Anvin
9df010725f Optimize mov r64,imm
Handle immediate-size optimization for "mov r64,imm" -- reduce it to
"mov r32,imm32" or "mov r64,imm32" as appropriate.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-24 14:08:16 -07:00
H. Peter Anvin
dbdb6d3df6 test/avx: remove deleted instructions
Remove the deleted VPERMIL2 instructions.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-16 15:23:16 -07:00
Cyrill Gorcunov
753a60de63 test: Add br3041451 testcase
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-08-09 18:47:05 +04:00
Cyrill Gorcunov
acf1cbb250 test: Add automatizing annotations to imm64.asm
H. Peter Anvin pointed
|
| Btw, test/imm64.asm needs test engine annotations.
|

Make it so.

Reported-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-08-04 20:18:30 +04:00
H. Peter Anvin
ab5bd05d82 Revert "Improve process_ea and introduce -OL"
This reverts commit ac732cb6a5.

Resolved Conflicts:

	doc/nasmdoc.src

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-25 12:43:30 -07:00
Victor van den Elzen
ac732cb6a5 Improve process_ea and introduce -OL
Two fixes:
1. Optimization of [bx+0xFFFF] etc
   0xFFFF is an sbyte under 16-bit semantics,
   so make sure to check it right.

2. Don't optimize displacements in -O0
   Displacements that fit into an sbyte or
   can be removed should *not* be optimized in -O0.

   Implicit zero displacements are still optimized, e.g.:
   [eax] -> 0 bit displacement, [ebp] -> 8 bit displacement.
   However explicit displacements are not optimized:
   [eax+0] -> 32 bit displacement, [ebp+0] -> 32 bit displacement.

Because #2 breaks compatibility with 0.98,
I introduced a new optimization level: -OL, legacy.
2010-07-24 22:00:12 +02:00
Cyrill Gorcunov
4e1d5ab0cf preproc.: Fix NULL dereference on broken %strlen argument
Under particular circumstances %strlen may cause SIGSEG. A typical
example is %strlen with nonexistent macro argument.

[ Testcase test/strlen.asm ]

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-23 18:51:51 +04:00
H. Peter Anvin
077fb93d2b preproc: allow non-identifier character in environment variables
Allow non-identifier characters in the name of environment variables,
by surrounding them with string quotes (subject to ordinary
string-quoting rules.)

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-07-20 14:56:30 -07:00
Cyrill Gorcunov
6405229b6d Check in test for BR3028880
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-13 21:17:31 +04:00
Cyrill Gorcunov
8ab945a259 preproc: add another test case
Add another test case for preprocessor token pasting.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-07-09 15:05:32 -07:00
H. Peter Anvin
f86b8b22e1 Check in test case from bug report br3005117
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-08 08:30:23 -07:00
H. Peter Anvin
4106753f6c br3026808: add test case
Add test case for BR 3026808 (%assign %$local).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-08 07:31:45 -07:00
H. Peter Anvin
0416b232ce Add RD*SBASE, WR*SBASE, RDRAND from AVX v7
Add the RD*SBASE, WR*SBASE and RDRAND instructions from version 7 of
the AVX specification, Intel document 319433-007.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-06 09:17:18 -07:00
Cyrill Gorcunov
1f6a046d85 BR2975768: Update AMD LWP instructions to match upcoming changes
The former changes have been committed to binutils.
From initial message:

|
| 2010-03-22 Quentin Neill <quentin.neill@amd.com>
|           Sebastian Pop  <sebastian.pop@amd.com>
|
|	opcodes/
|	* i386-dis.c (OP_LWP_I): Removed.
|	(reg_table): Do not use OP_LWP_I, use Iq.
|	(OP_LWPCB_E): Remove use of names16.
|	(OP_LWP_E): Same.
|	* i386-opc.tbl: Removed 16bit LWP insns.  32bit LWP insns
|	should not set the Vex.length bit.
|	* i386-tbl.h: Regenerated.
|
|	gas/
|	* testsuite/gas/i386/x86-64-lwp.s: Remove use of 16bit LWP insns.
|	* testsuite/gas/i386/lwp.s: Same.
|	* testsuite/gas/i386/x86-64-lwp.d: Updated.
|	* testsuite/gas/i386/lwp.d: Updated.
|

So there is no 16 bit instructions anymore.
Also xop.l field should be set to 0.

Based on patch from nasm64developer

Reported-by: nasm64developer
Signed-off-by: nasm64developer
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-03-25 00:37:26 +03:00
Victor van den Elzen
0d268fb78c BR 2496848: Tighten ea checks
Check if the offset and the representation are equivalent.

Disallow REL on absolute addresses.
I'm not sure what that would mean and the output formats don't support it.

Warn about ignored displacement size modifiers.
2010-03-12 23:52:04 +01:00
H. Peter Anvin
1199cddebb test/Makefile: make it easier to inject options
Make it easier to inject options into test compiles.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-11-28 15:34:32 -08:00
Victor van den Elzen
02c9a72fdd Update test files
Remove references to DREX instructions
2009-11-11 08:09:03 +01:00
Victor van den Elzen
30621f4d0c Add test/bisect.sh for use with "git bisect" 2009-11-11 07:47:39 +01:00
H. Peter Anvin
638c1ac078 test: imul.asm: move warning-generated tests under WARN
Only make the tests under WARN actually issue warnings.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-11-03 16:35:19 -08:00
H. Peter Anvin
623fedfa59 test: imul.asm: more IMUL pattern tests
Test more IMUL patterns.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-11-03 15:59:47 -08:00
H. Peter Anvin
892bafc9b1 test/Makefile: add more output rules
Add more output rules to be able to try things quickly.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-16 22:44:43 -04:00
H. Peter Anvin
fd18c5c42b test/Makefile: add ith and srec targets
Add ith and srec targets because, well, why not...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-05 16:14:33 -07:00
H. Peter Anvin
5ca5007695 test/Makefile: add rule to produce a .dbg file
Add a rule to produce a .dbg file, that is, a dump of all the calls to
the back end.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27 21:28:09 -07:00
H. Peter Anvin
ef3ef70ccf insns: make the MMX version of PINSRW match the SSE/AVX ones
Make the MMX version of PINSRW match the SSE and AVX ones, and add it
to the tests.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 21:53:23 -07:00
H. Peter Anvin
1d3e304546 Fix the PINSR series of instructions
Clean up a number of errors in the PINSR series instructions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 21:43:04 -07:00
H. Peter Anvin
d784a083a3 preproc: unify token-pasting code
Unify the token-pasting code between the macro expansion and the
preprocessor parameter case.  Parameterize whether or not to handle %+
tokens during expansion (%+ tokens have late binding semantics.)

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2009-04-20 14:01:18 -07:00
Victor van den Elzen
fb5f2519ad BR 2760773: $$ tokens
The tokenizer didn't handle $$, but relied on token pasting of two $ tokens.
This broke after the improvements in 9bb46df4.
2009-04-17 16:17:59 +02:00
H. Peter Anvin
6125b62403 preproc: fix more token pasting cases
"+" can be a separate token that ends up having to get pulled into the
middle of a floating-point constant.  It's not even that strange.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-04-08 14:02:25 -07:00
H. Peter Anvin
9bb46df4b7 Handle weird cases of token pasting
Especially when token pasting involves floating-point numbers, we can
have some really strange effects from token pasting: for example,
pasting the two tokens "xyzzy" and "1e+10" ends up with *three*
tokens: "xyzzy1e" "+" "10".  The easiest way to deal with this is to
explicitly combine the string and then run tokenize() on it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-04-07 21:59:24 -07:00
Victor van den Elzen
56b820355c FR 2499968: structures with non-zero base offset
Add an optional second argument to struc, document it and test it.
Also removed trailing whitespace in nasmdoc.src in the process.
2009-03-27 03:53:59 +01:00
H. Peter Anvin
fc2297e945 Add test from BR 2690688
Add the test case from BR 2690688 to the test collection.
2009-03-17 16:18:41 -07:00
H. Peter Anvin
ae2597b116 optimization.asm: more sbyte tests
A few more sbyte optimization tests.
2009-02-26 16:37:55 -08:00
H. Peter Anvin
943c9d7458 optimization.asm: add sbyte tests 2009-02-26 16:34:07 -08:00
H. Peter Anvin
ed2dcb8dc0 optimization.asm: add EA optimization tests
Add tests for EA optimizations
2009-02-26 14:47:17 -08:00
Victor van den Elzen
5a653cb65b Rename convergence.asm to optimization.asm 2009-02-25 17:49:23 +01:00
Victor van den Elzen
154e5920a1 Do not confuse segmentless adresses and unknown forward references
Also be optimistic with immediate forward references.
2009-02-25 17:32:00 +01:00
H. Peter Anvin
130360f8f5 convergence.asm: add test of jmp to an absolute address
A JMP to an absolute address can't be short.  Thus, we must not try to
make it so.
2009-02-23 17:47:25 -08:00
Victor van den Elzen
a5869fb666 Add test file for optimal convergence
Some edge cases where starting with a long form
converges suboptimally.
2009-02-23 05:16:35 +01:00
H. Peter Anvin
475421695d Merge branch 'nasm-2.05.xx' 2008-11-06 09:41:23 -08:00
H. Peter Anvin
b46a0037c5 test/popcnt.asm: simple test for the POPCNT instruction
Very simple test of POPCNT instructions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-11-06 09:40:39 -08:00
H. Peter Anvin
695a171ec9 test: add test for BR 2222615
Add a test for %ifmacro, per BR 2222615.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-11-04 14:25:12 -08:00
H. Peter Anvin
912595dfc0 Merge branch 'indirect' 2008-10-23 23:13:44 -07:00
H. Peter Anvin
bcc3bb975c test/crc32.asm: test the CRC32 instruction
Test for the CRC32 instruction.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-23 16:24:02 -07:00
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