Commit Graph

1785 Commits

Author SHA1 Message Date
H. Peter Anvin
a04019c7f4 Infrastructure support for AMD's new XOP prefix
Handle AMD's XOP prefixes; they use basically the same encoding as VEX
prefixes, so treat them simply as a variant of VEX.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-05-03 21:42:34 -07:00
H. Peter Anvin
34c768fcc5 outbin: replace fprintf(rf, not_defined); with fputs(not_defined, rf);
Some vendors get nervous about parameterized printf patterns;
furthermore, it's completely unnecessary in this case.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-04-30 08:06:25 -07:00
H. Peter Anvin
37d3357623 NASM 2.06rc11 2009-04-20 14:04:17 -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
H. Peter Anvin
6ca419e7c5 doc: slightly tidy the copyright page of the manual. 2009-04-19 17:26:09 -07:00
H. Peter Anvin
8e1f81110a preproc: make $ and $$ TOKEN_OTHER
Recognize $ and $$ as TOKEN_OTHER; they aren't really either
TOK_NUMBER nor TOK_ID, even though we have traditionally considered
them TOK_NUMBER.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2009-04-17 14:22:49 -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
93f77ac51a AUTHORS: Update information for HPA 2009-04-08 13:49:48 -07:00
H. Peter Anvin
f5b4a502cf NASM 2.06rc10 2009-04-07 22:10:35 -07:00
H. Peter Anvin
9c7f3f5608 Document preprocessor token concatenation fix. 2009-04-07 22:09:05 -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
H. Peter Anvin
1582d52863 NASM 2.06rc9 2009-04-07 20:59:41 -07:00
H. Peter Anvin
4c4177cb4d nasm.nsi: add COPYING to the list of files to package 2009-04-06 19:37:30 -07:00
H. Peter Anvin
d8979222e9 nasm.nsi: add NASM Manual; automate version generation
Add the NASM Manual (as a PDF) to the Windows installer, and abstract
out the version number.
2009-04-06 19:12:34 -07:00
Shao Miller
a606aced2c Add NSIS script to make a Windows installer
Here is an NSIS script for making a simple NASM package.  It creates a
NASM folder with some of the important binaries in it, as well as a
simple batch file to get a CLI with the NASM folder included in the
PATH.  Expects to be built from inside the bin/ directory.  Fairly
primitive.  Feedback welcome.  - Shao
2009-04-06 19:07:37 -07:00
Victor van den Elzen
b32536cc53 Add STRUC change to changes.src 2009-03-29 03:09:13 +02: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
1d7d7c64cf disasm: fix reversed REP vs REPNE in eatbyte()
F2 is REPNE, F3 is REP(E)
2009-03-19 06:52:07 -07:00
H. Peter Anvin
ed37aa8070 disasm: when no instruction is found, consider a naked prefix
If we can't find a matching instruction, rather than printing it as a
"db" literal, consider first if we can disassemble it as a naked prefix.
2009-03-18 23:10:19 -07:00
H. Peter Anvin
d1174fb1a6 NASM 2.06rc8 2009-03-18 16:21:45 -07:00
Andy Polyakov
08ced1d5b4 outcoff: BR 2685756: fix SAFESEH with an internal symbol
Fix the SAFESEH directive for the specific case of a symbol internal
to the program.  With the optimizer enabled, it would otherwise fail
unless the symbol is external.
2009-03-18 14:49:23 -07:00
Michael Scherer
92cb18f2a8 outelf32/64: fix uninitialized rbtree
Fix crash caused by uninitialised memory that lead to dangling pointer
in the rbtree. This can be seen by compiling zsnes 1.50, with a file
that define many symbols, such as fxemu2c.asm.
2009-03-18 14:47:33 -07:00
H. Peter Anvin
74eed4a9b3 BR 2690688: Fix opcodes for FMA instructions
Two bugs with respect to the FMA instructions:
- the variant increment is supposed to be 0x10, not 0x01.
- the base opcode for scalar VFNMADD is 0x9d, not 0x9c
2009-03-17 18:26:47 -07: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
ef72b03fb4 BR 2690688: add missing VFM instructions
The Perl script which auto-generated the VFM instructions had
incorrectly conflated the VEX.W and VEX.L bits, with the result that
only half the valid instructions were generated.
2009-03-17 16:16:39 -07:00
H. Peter Anvin
cdf42e675d BR 2689316: PEXTRQ requires REX.W
The PEXTRQ instruction requires a REX.W prefix.
2009-03-16 16:32:42 -07:00
H. Peter Anvin
40d37eef81 genfma: fix spelling of the VFNM instructions
Fix the spelling of the scalar VFNM instruction in genfma.pl, too,
just in case we need to pull this script out again...
2009-03-16 11:51:07 -07:00
H. Peter Anvin
b8abbbe826 insns.dat: fix VFNM instructions incorrectly spelled as VFMN
The scalar versions of the VFNM instructions had been incorrectly
spelled VFMN.
2009-03-16 11:49:27 -07:00
H. Peter Anvin
e095cb8009 NASM 2.06rc7 2009-03-15 14:38:54 -07:00
H. Peter Anvin
e5a352516c BR 2672117: handle long lines for db/dw/etc.
Handle long arrays on a single line in db/dw/etc.
2009-03-07 21:54:31 -08:00
H. Peter Anvin
1fb908c0db autoconf: detect the broken bool in OpenWatcom 1.8
OpenWatcom 1.8 has a C99 mode, which implements _Bool and
<stdbool.h>.  Unfortunately the implementation is broken, and doesn't
let _Bool be implicitly converted to integer (as required by the C99
spec).  Detect this case in autoconf.
2009-03-01 13:57:40 -08:00
H. Peter Anvin
16a856cd85 Most instruction codes are octal, so print errors that way too
Most of our instruction opcodes are written in octal.  Thus, it makes
sense to print them that way if we ever have an error message.
2009-03-01 00:22:16 -08: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
e8ab891a65 sbyte: optimization is OK if UNKNOWN isn't set
We can optimize the sbytes if the UNKNOWN flag isn't set
2009-02-26 16:34:56 -08:00
H. Peter Anvin
943c9d7458 optimization.asm: add sbyte tests 2009-02-26 16:34:07 -08:00
H. Peter Anvin
d6e133f00b NASM 2.06rc6 2009-02-26 14:58:06 -08:00
H. Peter Anvin
9945feeed6 BR 2413265: don't pessimize displacements
Optimize displacements, don't pessimize them.  When running in the
optimizer, we always keep track of when a reference is forward.  That
doesn't mean it is unknown.
2009-02-26 14:48:03 -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
H. Peter Anvin
3213a57740 nasm.c: another readability cleanup
Yet another change for readability
2009-02-26 14:36:19 -08:00
H. Peter Anvin
7219198d72 nasm.c: readability cleanup for seg:off parsing
The code to pick apart seg:off in nasm.c was virtually unreadable due
to mechanized line breaking.
2009-02-26 14:34:48 -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
babebffb71 Add VPCLMUL instructions 2009-02-23 18:27:29 -08:00
H. Peter Anvin
eea57cc6c5 assemble: only be optimistic with NO_SEG if we're really in pass 1
Only be optimistic about the reachability of a symbol with NO_SEG if
we are truly in pass 1, i.e. it could possibly be just a forward
reference.  After we have done a single pass, if it is still NO_SEG,
then it is an absolute symbol and need to be treated as such.
2009-02-23 17:51:25 -08: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
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