Commit Graph

1666 Commits

Author SHA1 Message Date
H. Peter Anvin
a564a02788 ELF: make debugging functions static
The debugging functions can and should all be static.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25 17:43:54 -07:00
H. Peter Anvin
ca2a788edf ELF: remove loop invariant calculation of global offset
The global symbol offset is a loop invariant; no need to compute it
over and over.  The compiler probably will not be able to do this for
us due to global variables and function calls.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25 17:30:58 -07:00
H. Peter Anvin
559d936ad7 ELF: clean up the arithmetic for global symbols
Clean up the arithmetic for global symbols; in particular, make it
clear where the dependency on the debug format comes from (DWARF needs
three symbol table entries all by itself.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25 17:26:43 -07:00
H. Peter Anvin
3716238058 ELF: bump GLOBAL_TEMP_BASE
Bump GLOBAL_TEMP_BASE so far that it *cannot* conflict for ELF32
(which has 24-bit symbol table indicies) and is *unlikely* to conflict
for ELF64 (which has 32-bit symbol table indicies.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25 17:25:35 -07:00
H. Peter Anvin
c4471462dc ELF: eliminate hard-coded section numbers
Eliminiate hard-coded section numbers, at least to the best of our
ability.  There is still a very odd piece of computation in
elf_build_reltab() which I can't really figure out...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25 14:54:44 -07:00
H. Peter Anvin
1acf6ba822 Handle the new ELF headers in the dependency generation
The dependency machinery relies on properly rooted includes, so give
it to them... the path syntax munging machinery in the dependency
script handles it from a Makefile syntax perspective, and then we can
hope that C compilers are smart enough to deal with forward-slash
paths even when that is not the native syntax.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25 13:06:49 -07:00
H. Peter Anvin
d219a3e46f ELF: add header files, begin merging common code, drop .comment
Add something approaching real ELF header files.

Begin merging the common ELF code, beginning with the section name
detection.

Drop automatic generation of .comment section, and in particular the
treatment of .common as a special section (if we decide generating
.comment is still a good idea, we should just do it as a macro.)

Augment the list of known sections, and make it table-driven.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25 12:30:50 -07:00
H. Peter Anvin
538628803b NASM 2.06rc13 2009-06-25 11:27:18 -07:00
H. Peter Anvin
883735f4c3 changes.src: update 2009-06-25 11:23:37 -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
d15bb009f6 Intel FMA: drop relaxed forms
The Intel FMA instructions are destructive, so relaxed forms are not
appropriate.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 21:45:27 -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
9472dab6ed Add support for instructions which always use low 8-bit registers
Add a byte code to explicitly support instructions which only uses the
low 8-bit registers (as if a REX prefix always was present.)  This is
usable for instructions which are officially documented as using "the
low byte of a 32-bit register" and so on.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 21:38:29 -07:00
H. Peter Anvin
f9fc3fde55 insns.dat: fix typos: VCMPORD_SP[SD] entered as VCMPORS_SP[SD]
Fix typos in two instructions in the relaxed forms.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 21:03:29 -07:00
H. Peter Anvin
79c2e37bc0 insns.dat: collapse relaxed forms
Change the relaxed forms to the compact representation.  This
*deliberately* does not fix bugs where the relaxed form does not match
the official form; this is strictly a "no change in output" checkin.

All remaining open-coded relaxed forms are very likely bugs, and need
to be individually audited.  Furthermore, it is questionable if the
Intel FMA instructions, being destructive, should have relaxed forms
at all.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 18:36:24 -07:00
H. Peter Anvin
37b3c59fc8 insns.pl: allow relaxed forms to be created without duplication
Allow a * to be put on an operand, indicating that it is optional and
should be replaced with the immediately preceding operand if it is
omitted.  This allows official and relaxed forms of nondestructive
instructions to be written on one line.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24 18:06:26 -07:00
H. Peter Anvin
a5e0279cbd changes.src: fix some odd spacing 2009-06-24 16:50:54 -07:00
H. Peter Anvin
552bc2c394 parser: don't use midcode declarations
OpenWatcom can't handle midcode variable declarations.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-23 11:34:42 -07:00
Victor van den Elzen
02846d30c0 BR 2782055: reject invalid tokens after ]
A bracketed memory reference should be followed by a comma or
the end of the line. Enforce this.
2009-06-23 03:56:07 +02:00
H. Peter Anvin
1957e65ca4 specfile: update URLs
Update the URLs in the specfile to point to http://www.nasm.us/.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-05-26 16:09:15 -07:00
H. Peter Anvin
57fd9c2142 Nindent: add back the -nut option
NASM is developed under a bunch on environments, to tabs aren't the
best choice.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-05-25 21:57:27 -07:00
H. Peter Anvin
8bb4c6dafa Nindent: update with the -npro and -il0 options
Update with the -npro and, if recent enough, the -il0 options.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-05-25 21:40:06 -07:00
H. Peter Anvin
b9cc7f1449 doc: use NASM syntax for x87 registers
The x87 registers are called ST0 and ST1 in NASM syntax, not ST(0) and
ST(1).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-05-23 16:25:14 -07:00
Cyrill Gorcunov
e49b5bf21c insns.dat - fixup for XOP (SSE5) AMD instructions
1) A number of PMA -> VPM misprint fixed.
2) Spec points to ymmreg in mnemonics even for L=0 instructions. Fixed.

The instructions are still sorted in order of specification follows.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-05-17 14:50:30 -07:00
Cyrill Gorcunov
bc095662d5 insns.dat - introcuce base XOP (SSE5) AMD instructions
Introduce base XOP/FMA4/CVT16 instructions (SSE5)
based on official specification from AMD (rev 3.03).
Some fixes from Peter Johnson and H. Peter Anvin
included (not updated in AMD spec yet).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-05-15 07:20:08 -07:00
Cyrill Gorcunov
52fb2575f3 insns.pl - add handling of pp VEX/XOP fields
We already have such kind of aliases for L field
(via l0 and l1). Via p0,p1,p2 it's become easier
to follow AMD docs while encoding VEX/XOP commands.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-05-15 07:20:02 -07:00
H. Peter Anvin
40b81a40c7 Add symbolic constants for REX_V "classes" (VEX, XOP, ...)
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-05-08 18:01:21 -07:00
H. Peter Anvin
03b9f94133 doc: remove insref.src
Remove the old, obsolete insref.src.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-05-08 17:56:59 -07:00
H. Peter Anvin
bd9e3a67c5 NASM 2.06rc12 2009-05-06 14:00:48 -07:00
H. Peter Anvin
ba7a0d0566 preproc: handle %+ even during early token replacement
Preexisting code seems to rely on %+ being processed even during early
token replacement, e.g. Syslinux contains the following code:

%macro          superb 1
bx %+ %1        equ SuperInfo+($-superblock)*8+4
bs %+ %1        equ $
                zb 1
%endmacro

... which is expected to work when invoked as:

                superb Media

As a result, set handle_paste_tokens to true at all times; assuming
this turns out to be the way things are we can really just remove it
as an option.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-05-04 10:11:22 -07:00
H. Peter Anvin
0bff6a48fd Use lower case for VEX and XOP in instructions table
Use lower case for VEX and XOP ("vex", "xop") to avoid visual
confusion (and in the future potential real confusion) with upper-case
hexadecimal numbers.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-05-03 22:14:03 -07:00
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