Commit graph

204 commits

Author SHA1 Message Date
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
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