Commit Graph

1589 Commits

Author SHA1 Message Date
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
Victor van den Elzen
ccafc3c4b7 BR 2420167: jmp not always optimized
Begin by assuming short jumps are possible to prevent suboptimal convergence.
2009-02-23 04:35:00 +01:00
H. Peter Anvin
79b5972824 PCLMUL is apparently targeted for Westmere with the AES stuff
The PCLMUL instruction is apparently targetted for Westmere.
2009-02-21 20:45:42 -08:00
H. Peter Anvin
84f823a71a NASM 2.06rc5 2009-02-21 19:02:58 -08:00
H. Peter Anvin
5b4d263e50 BR 2557903: fix disassembly of a set of SSE MOV* instructions
Fix the disassembly of the alternate forms of register-register
MOVAPD, MOVDQA, MOVDQU, MOVQ, MOVSD, and MOVUPD.

NASM never generates these, but they would be disassembled
incorrectly.
2009-02-21 18:58:15 -08:00
H. Peter Anvin
c5d0462a80 BR 2541252: Fix issues in insns.dat, mostly related to LZCNT and POPCNT
Fix various flags on LZCNT and POPCNT, and fix a few instructions
tagged \360\332, which makes no sense.
2009-02-21 18:51:17 -08:00
H. Peter Anvin
875138830b changes.src: document WAIT and %$$ fixes 2009-02-21 18:26:20 -08:00
H. Peter Anvin
c2acf7b047 BR 2592476: Treat WAIT as a prefix even though it's really an instruction
WAIT is technically an instruction, but from an assembler standpoint
it behaves as if it had been a prefix.  In particular, it has to be
ordered *before* any real hardware prefixes.
2009-02-21 18:22:56 -08:00
H. Peter Anvin
f8ad53216f br704736: handle deep context-local macros
The documentation says that constructs with %$...$foo can be used
to access macros from deeper in the context stack.  From what
I can tell, that has never actually worked, since we'd enter names
like %$foo into the context-local macro name table.  Instead, only
insert the tail of the macro name into the context-local table;
expand get_ctx to also return a pointer to the macro name proper;
this is rather straightforward since we'd usually save away that
name at the point get_ctx is called anyway.
2009-02-21 17:55:08 -08:00
H. Peter Anvin
00bf04f742 nasmlib: make nasm_strcat() take const arguments
None of the strings passed to nasm_strcat() are modified, to
make them const.
2009-02-21 17:54:31 -08:00
H. Peter Anvin
577f57614a outelf32/64: remove align_str in favor of fwritezero()
Drop the use of yet another local all-zero buffer, align_str, in favor
of calling fwritezero().
2009-02-21 17:27:51 -08:00
H. Peter Anvin
a5c2455f8a outbin: fix typo: "sections" not "section"
Fix silly typo: the variable is "sections" not "section"...
2009-02-21 17:27:13 -08:00
H. Peter Anvin
999868f06f Unify all-zero buffers; add fwritezero()
We have a number of all-zero buffers in the code.  Put a single
all-zero buffer in nasmlib.c.  Additionally, add fwritezero()
which can be used to write an arbitrary number of all-zero bytes;
this prevents the situation where the all-zero buffer is simply
too small.
2009-02-21 17:24:08 -08:00
H. Peter Anvin
04616f4e85 BR 2611906: proper error message for start < origin
When a section other than .text has a start < origin, we would
segfault; fix that.

Furthermore, at bin_cleanup() we don't have usable file/line
information, so pass ERR_NOFILE to the error() function.  Perhaps less
than ideal, but better than printing a null pointer.
2009-02-21 17:19:05 -08:00
H. Peter Anvin
719f55938e NASM 2.06rc4 2009-02-21 16:58:34 -08:00
H. Peter Anvin
2c784d9024 Fix opcode for VADDSUBPS; operands for VBLEND; add SSE for AES ops
Fix the opcode for VADDSUBPS
Fix the operands for VBLEND
Corrent the instruction flags for the AES ops (they're SSE)
2009-02-21 16:56:52 -08:00
H. Peter Anvin
d8e47f6da9 FMA instructions won't be in Sandy Bridge
The FMA instructions aren't scheduled for Sandy Bridge after all.
They will be "in a future processor", so create a placeholder for now.
2009-02-21 16:43:48 -08:00
H. Peter Anvin
0662203978 Perl script used to generate FMA instruction patterns
Small perl script used to generate the FMA instruction patterns.  May
come in useful if the spec changes again.
2009-02-18 14:13:45 -08:00
H. Peter Anvin
e8a3e6278a changes.src: document updated AVX specification 2009-02-18 14:13:25 -08:00
H. Peter Anvin
37c1ad1dfb Update the VFMA* instructions per the AVX spec version 5
Update the VFMA* instructions to match the AVX spec version 5.
Since these are highly regular, use a small Perl script to generate
the instruction patterns.
2009-02-18 14:07:14 -08:00
H. Peter Anvin
cec96d09e8 insns.dat: fix minor formatting anomalies
Fix minor anomalies in insns.dat.
2009-02-18 14:05:15 -08:00
H. Peter Anvin
58af1fbbe9 insns.pl: handle the new VEX.DDS flag per AVX spec version 5
The AVX spec version 5 introduces the new VEX.DDS flag; support it.
2009-02-18 14:04:02 -08:00
H. Peter Anvin
2186415f01 BR 2593349: Move version message back to stdout
Checkin 4b9358928b changed the version
message from stdout to stderr, but:

a) doesn't motivate the change in the commit log;
b) bundles that with other changes;
c) is inconsistent with other programs;
d) was done by me and I can't remember any reason for it.

Hence conclude it was unintentional and therefore a bug.  Since this
commit was done after 2.05.01 no stable release has been affected.
2009-02-13 09:36:47 -08:00
H. Peter Anvin
f8914800f8 NASM 2.06rc3 2009-02-11 10:54:59 -08:00
Charles Crayne
18152f0e33 Allow global declaration after symbol definition
This experimental feature needs to be tested for
all output formats which recognize global symbols.
2009-01-28 19:07:18 -08:00
Charles Crayne
dd1e6f5c37 Fix Bugs item #2537867
Module labels.c has code to issue error message when global
directive appears after symbol definition, but the test condition
was incorrectly punctuated.
2009-01-27 14:43:37 -08:00
Soronel Haetir
e5fdc60c2b Document the as86 ..start label
I realized that a documentation change is required to inform users about the
addition of entry point support for the as86 format.  The following produces
reasonable output for .txt output, but I am blind and so can't check the
other formats as readily.
2009-01-21 15:30:27 -08:00
H. Peter Anvin
3e8ac5366f doc: clean up the "String Manipulation in Macros" section
Minor cleanups to the "String Manipulation in Macros" section.
2009-01-18 23:04:45 -08:00
H. Peter Anvin
33a5ad1f8e doc: indent the time macro example
Indent the time macro example for ease of reading.
2009-01-18 22:59:13 -08:00
H. Peter Anvin
bed44b3889 doc: fix typo
verson -> version
2009-01-18 22:55:53 -08:00
H. Peter Anvin
c8c62fe4d3 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/nasm 2009-01-18 22:55:33 -08:00
H. Peter Anvin
55a9c08dac doc: update the section on numeric constants
Update the section on numeric constants, and add a few more examples.
2009-01-18 22:51:46 -08:00
Charles Crayne
cc88d658ce Generate warning for unknown section atributes
Previously, the ELF backends silently ignored incorrect or unknown
attributes on section declarations, and therefore used default values
in cases where the user had make an error in attempting to specify
custom values.
2009-01-18 15:27:03 -08:00
H. Peter Anvin
f1e46600d2 Fix the [warning] directive
Fix multiple bugs in the [warning] directive:

- Only parsed on pass 1
- "-" was interpreted as "+"
2009-01-05 09:08:06 -08:00
H. Peter Anvin
f5fb723495 outas86: slight stylistic cleanups
Minor stylistic cleanups to previous patch.
2009-01-03 17:56:41 -08:00
Soronel Haetir
e07949dc3f Add entry point support to as86 backend
I needed entry point support with the as86 format, and after looking through
the archives found a similar desire from someone in 2002.  For some reason
such a patch never made it into the code, even though the required flag
value is present, so I offer the a patch of my own.

I compared against what is done in the .obj format and the approaches are
quite similar which I hope will aid in its acceptability.  While I have
tested it extensively it does do the job asked, and I'm honestly not sure
what extensive testing of the change would look like.
2009-01-03 17:54:48 -08:00
H. Peter Anvin
6cda414a0e BR 2432826: Fix enforcement of the LONG bit
Somewhere we lost the enforcement of the LONG bit, as opposed to
NOLONG.  Fix this in the most obvious way.
2008-12-29 20:52:28 -08:00
H. Peter Anvin
9ed8594a28 BR 2413278: Nonoptimal forms of arithmetic instructions involving AX
At some point, we lost the optimizations for the core arithmetic
operations involving AX.  Put them back.
2008-12-29 19:58:36 -08:00
H. Peter Anvin
fd925d9512 changes.src: document Mach-O alignment fix. 2008-12-22 16:37:59 -08:00
H. Peter Anvin
d23191e106 NASM 2.06rc2 2008-12-19 16:48:07 -08:00
David DeHaven
74a8755fe3 Mach-O alignment fix
Several projects have taken to using .text to store read-only data
when building on Mac OS X due to crashes in SSE code from the .rodata
section being mis-aligned. It seems there was a misunderstanding about
how ld/ld64 handles section alignment in outmacho.c so I wrote a patch
to fix it. I tested it against x264 git, modified it to use ".rodata
align=16" for the data section and use movdqa instructions (guaranteed
to crash when built with unpatched nasm) and it passed all tests in
its checkasm tool.

If you want more data I can provide, but it's late and I've had a
couple glasses of mulled wine :)

-DrD-
2008-12-18 14:58:24 -08:00
Victor van den Elzen
352fe06e02 BR 2413272: Warn about byte displacement overflow
Remove the special case for single byte displacements,
which was already in out() anyway.
2008-12-10 13:04:58 +01:00
H. Peter Anvin
2b5ad13bc1 NASM 2.06rc1 2008-11-30 15:53:02 -08:00
H. Peter Anvin
1fee7d2d23 ELF: use rbtree for symbol searches
Linear searches are evil, so use an llrbtree to search for symbols by
offset.  This doesn't change the preexisting behaviour that we only
look for global symbols.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-11-06 19:55:05 -08:00
H. Peter Anvin
ef11aa889b rbtree: drop "const" from search function
Having the search argument and result be "const" is nice in theory,
but causes problems in practice.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-11-06 19:54:05 -08:00
H. Peter Anvin
674788166f changes.src: document POPCNT fix.
Add POPCNT fix to release notes.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-11-06 09:42:11 -08: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
81cef52e7a The POPCNT instruction does not need sizes on memory operands
The POPCNT instruction should not require sizes on memory operands.
Add the appropriate size flags for that to work.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-11-06 09:39:48 -08:00
H. Peter Anvin
0ad8ffd6e2 BR 2229703: POPCNT r64,rm64 not POPCNT r64,rm32
The 64-bit version of the POPCNT instruction takes r64,rm64; not
r64,rm32.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-11-06 09:35:02 -08:00