Commit graph

2197 commits

Author SHA1 Message Date
H. Peter Anvin
af5cb1b4de doc: document imm64 optimization
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-24 14:13:32 -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
47fb7bc088 assemble: add an OPT instruction flags for optimizing assembly only
Add an OPT flag to only use a pattern for optimizing assembly only.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-24 13:53:22 -07:00
H. Peter Anvin
2d3dce2fd7 doc: document the %use fp macro package
Documentation for %use fp was missing...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-08-24 09:55:27 -07:00
H. Peter Anvin
83baad7d9a NASM 2.09 2010-08-24 09:13:34 -07:00
H. Peter Anvin
e7854b98fd insns.pl: make insnsd.c a bit easier to read
Formatting changes (no object code difference) to insnsd.c for
readability.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-19 17:20:18 -07:00
H. Peter Anvin
5d62e57a0c ndisasm: handle VEX.LIG
A lot of instructions ignore the L bit in the VEX prefix, just like
a lot of instructions ignore the W bit, so don't use them in the
sub-table select.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-19 17:04:36 -07:00
H. Peter Anvin
23f0b16c21 ndisasm: unify VEX handling
Unify VEX handling between the 026x and 0270 bytecodes.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-19 16:59:35 -07:00
H. Peter Anvin
7023d638de ndisasm: fix handing of byte codes 250-253, 324
Fix handling of byte codes 250-253 (sign-extended 32-bit immediate,
extended to 64 bits) and 324 (instruction must have osize 64).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-08-16 22:13:14 -07:00
H. Peter Anvin
8810e0f794 NASM 2.09rc7 2010-08-16 15:24:01 -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
H. Peter Anvin
96ba233088 insns.dat: permit contracted forms for VBLENDVP
Allow implicit operands for VBLENDVP, just as for other instructions,
since the semi-legacy forms now are removed.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-16 15:22:21 -07:00
H. Peter Anvin
229fa6c465 assmemble.c: fix VEX.W logic
Fix the generation logic for VEX.W, which unfortunately got the wrong
constants.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-16 15:21:48 -07:00
H. Peter Anvin
cfe6d20e3a insns.dat: fix encoding of VCVTSD2SS
Fix typo in the definition of VCVTSD2SS.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-16 15:08:51 -07:00
H. Peter Anvin
c23c52040f insns.dat: SSE encoding of VBLEND with VEX prefix is forbidden
Version 7 of the AVX spec specifically forbids (#UD) using the
66 0F 38 14/15 forms of the BLENDV instructions with a VEX prefix;
those encodings are strictly legacy SSE 4.1.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-16 15:05:25 -07:00
H. Peter Anvin
0217039cdb insns.dat: updates from AVX v7
Updates from the AVX version 7 specification: mostly tightening of the
rules for VEX.L and VEX.W, but remove the VPERMIL2 instructions.

Also encode all the full-length forms of the VCMP instructions and
prefer those for the disassembly.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-16 14:57:09 -07:00
H. Peter Anvin
421059c689 assemble: handle vex.lig
AVX version 7 introduces the concept of .lig, meaning VEX.L is
ignored.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-16 14:56:33 -07:00
H. Peter Anvin
978c2170fc vex: change .wx to .wig to match the latest AVX spec
Change the .wx (ignore the W field) to .wig, to match the latest
version of the AVX specification.  This is not a functional change,
but just makes instruction patterns a little easier to write.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-16 13:48:43 -07:00
Cyrill Gorcunov
84a9e308c3 doc: Update -O option description
We use -Ox by default since Nasm-2.09 so "-O0" is not
longer "default" option. But first paragraph still has
the reference which confuses people. Get rid of it.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-08-16 13:53:22 +04:00
Cyrill Gorcunov
327edcfc7a doc: Fix typo in changes.src
Reported-by: Frank Kotler <fbkotler@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-08-16 13:47:24 +04:00
Keith Kanios
88d947e909 preproc.c: revamped context-local fall-through warning message 2010-08-14 12:47:45 -05:00
Keith Kanios
c71cb6b72a doc/nasmdoc.src: revamped context fall-through entry 2010-08-14 12:36:49 -05:00
Cyrill Gorcunov
e1b6e5712b doc: Describe context-through lookup
Feel free to update this text as well,
and check it please for being more/less
readable.

CC: Keith Kanios <keith@kanios.net>
CC: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-08-13 12:32:53 +04:00
H. Peter Anvin
e54805b30d LICENSE: update year
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-08-12 20:15:27 -07:00
Cyrill Gorcunov
8cb43d3f68 sectalign: Implement on/off mode
And describe it in documentation. We've introduced
sectalign in 2.09rc series and have to provide an
ability to steer this feature.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-08-12 19:09:28 +04:00
Cyrill Gorcunov
41b17b1e31 standart.mac: Style nitfix
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-08-12 18:47:52 +04:00
Cyrill Gorcunov
d90693c79c preproc.c: Context-through single macros expansion is deprecated
For now we inform users about their sources need to be
updated and also since _all_ context case are legit
for single macros only we split lookup into two phases:

1) Lookup in active context, which is perfectly valid
2) Lookup in external contexts, which will be deprecated soon.

If (2) happens we yield warning.

A typical testcase is
---
  %macro one 0
  %push
    %$a:
    %assign %$b 12
      %push
        mov eax, %$a
        mov eax, %$b  ; hit -- context through
      %pop
    %pop
  %endmacro
  one
---

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-08-11 20:31:46 +04:00
Keith Kanios
404589e558 preproc.c: modified deprecation warning for context-local label fallthrough 2010-08-10 20:12:57 -05:00
Cyrill Gorcunov
71f4f8426c preproc.c: Fix error message typo
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-08-09 20:17:17 +04: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
e091d6ed62 BR3041451: Implement upper bound for %rep counter
Since %rep counter is a 64 bit signed integer we have to use some
"maximum possible value" limit (upper bound) otherwise there may be
a situation when %rep counter is 0 or even negative while user
has been passing big positive integer value.

Reported-by: nasm64developer
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-08-09 18:35:35 +04:00
Keith Kanios
fe55e918fa preproc.c: added deprecation warning for context-local label fallthrough 2010-08-09 00:55:44 -05:00
Cyrill Gorcunov
73b34a5006 NASM 2.09rc6
It likely to be the last -rc before final relase.
Give it a good testing. We should be in pretty good
shape.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-08-06 19:25:17 +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
b936aa61c8 insns.dat: unbreak test/imm64.bin
Unbreak the following subtest in test/imm64.bin:

	mov qword [rax],dword 11223344h

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-02 12:06:13 -07:00
Cyrill Gorcunov
d7b654c73d elf: Move stabs symbol table format into outelf.h
Get rid of code duplication

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-30 00:51:44 +04:00
Cyrill Gorcunov
16cbf9b5c2 nasmlib.c: fix typo in nasm_init_malloc_error
Typo happened in 9b603082 so -DLOGALLOC gets broken.
Not that important since this is a developer oriented
feature but should be fixed anyway.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-29 19:01:34 +04:00
Cyrill Gorcunov
fd90ef56ae NASM 2.09rc5 2010-07-28 22:03:43 +04:00
Cyrill Gorcunov
dea6c7a974 doc: Updates on macro ranges
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-28 18:00:24 +04:00
Cyrill Gorcunov
d143f4f39c labels.c: cleanup
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-28 18:00:18 +04:00
Cyrill Gorcunov
d3034cb13b Get rid of misc/altreg.inc
It's the same as macros/altreg.mac which is already included.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-28 18:00:06 +04:00
Cyrill Gorcunov
407e6c707f doc: Explain SECTALIGN
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-28 17:59:49 +04:00
Cyrill Gorcunov
455e087c6a doc: Fix ..sym section name misprint
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-27 01:48:27 +04:00
Cyrill Gorcunov
d6f31240c5 assemble.c: Style nitfix
Various tabs/space mixture cleaned and some more.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-26 23:16:45 +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
H. Peter Anvin
b453c866ab nasm.h: move "regs.h" to top; make is_register() a bool
Move the #include of regs.h to the top with the other includes, and
make is_register() -- being a boolean predicate -- return bool.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-07-25 00:17:12 -07:00
Cyrill Gorcunov
a38b86aecf move is_register helper to nasm.h
H. Peter Anvin noted:
 |
 | Could we avoid putting static code that has no dynamic content in
 | dynamically generated files... it just complicates things unnecessarily.
 |
 | The above can move into nasm.h for example.
 |

Good idea.

CC: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-25 11:09:56 +04:00
Cyrill Gorcunov
2124b7b7dc Use is_register helper
Save us some line of code

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-25 01:16:33 +04:00
Cyrill Gorcunov
79699d8eda regs.pl: Introduce is_register() helper
Instead of opencoded check use inline helper.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-07-25 01:10:17 +04:00
Victor van den Elzen
b8e699fb3d Remove redundant sentence in docs 2010-07-24 22:24:15 +02:00