summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2009-06-27Move prototypes for null_debug to outform.h and outlib.hH. Peter Anvin6-14/+17
Move the prototypes for the null debugging format to outform.h (for the top-level structure declaration only) and outlib.h (for the internal routines.) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27Move backend-specific code to output/; break out null debug stuffH. Peter Anvin27-194/+222
Move backend-specific code into the output/ directory, and make the null debugging backend a separate file (it certainly isn't needed for ndisasm...) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27debug: make *all* the null debug routines available as a libraryH. Peter Anvin3-20/+12
Make all the null debug routines available as a library, so we can use them whenever appropriate. We really don't need to have a bunch of dummy functions scattered all over the code. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27output: call debug init from a central locationH. Peter Anvin4-5/+2
We already call current_dfmt->init in the same place (at the very end of ofmt->init) in all the backends that do it; instead call it centrally in nasm.c after ofmt->init. This fixes invalid ELF files with when compiling with -F dwarf, since the dwarf initialization routine never got called. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27test/Makefile: add rule to produce a .dbg fileH. Peter Anvin1-0/+3
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-27outform: build ALL formats by default, including DBGH. Peter Anvin1-0/+6
There really is no point to ever excluding a backend anymore... all it leads to is bitrot. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27outelf.c: add appropriate #ifdefsH. Peter Anvin1-0/+5
Only build outelf.c if ELF32 or ELF64 is included. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27outdbg: make outdbg.c compile cleanlyH. Peter Anvin1-10/+12
Make outdbg.c compile cleanly again. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27NASM 2.06rc15H. Peter Anvin1-1/+1
2009-06-27BR 2781900: handle common labels while optimizingH. Peter Anvin2-70/+81
When optimizing, we have to keep track of common labels, since a common symbol cannot be optimized -- only the linker will know where it will end up. In that sense it is similar to an EXTERN symbol. Thus, allow them to be entered in the symbol table but make sure we don't holler too hard on redefinition. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27parser.c: fix stylistic nitpickH. Peter Anvin1-1/+0
Fix stray blank line in parser.c Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27assemble.c: stylistic nitpickH. Peter Anvin1-3/+2
Fix stylistic nitpick Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27preproc: use %if 0 instead of %ifdef BOGUSH. Peter Anvin1-5/+6
When processing an unparsable TASM argument, convert it to %if 0 which is guaranteed to not happen, rather than %ifdef BOGUS. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27hashtbl: make hash_iterate() not crash on an uninitalized tableH. Peter Anvin1-1/+4
Trying to walk an uninitialized table (->table == NULL) should just return nothing. This can happen due when pp_cleanup() is called after a failure. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-27nasm.c: clean up pass exit logicH. Peter Anvin1-26/+25
Clean up the pass exit logic. In particular, we had a whole routine to do the same thing that the normal exit logic would do anyway if we only would actually get there. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-26ndisasm: fix disassembly of JRCXZH. Peter Anvin3-3/+3
Fix the disassembly of JRCXZ; in 64-bit mode, we should only accept JECXZ for disassembly with 32-bit address size override. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-26NASM 2.06rc14H. Peter Anvin1-1/+1
2009-06-26insns.dat: reformatH. Peter Anvin1-104/+104
Reformat insns.dat with standard formatting Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-26insns.dat: add relaxed forms for XOP/FMA4/CVT16 instructionsH. Peter Anvin1-146/+148
Add relaxed forms of the XOP/FMA4/CVT16 instructions, without looking too hard at if it makes sense. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-26Add Cyrill Gorcunov to AUTHORSH. Peter Anvin1-0/+4
2009-06-25insns.pl: remove stray whitespaceH. Peter Anvin1-1/+1
Clean up whitespace in insns.pl. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25insns.pl: add "nohi" code for REX_NHH. Peter Anvin1-0/+2
Add a "nohi" code flag for the \325 byte code, which sets the REX_NH flag. That is, REX_P not required to support high registers, high registers are not supported and spl/bpl/sil/dil enabled even in non-64-bit mode. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25insns.pl: fix indentationH. Peter Anvin1-141/+141
Canonicalize indentation of some blocks. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25ELF: make debugging functions staticH. Peter Anvin2-65/+70
The debugging functions can and should all be static. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-25ELF: remove loop invariant calculation of global offsetH. Peter Anvin2-6/+18
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-25ELF: clean up the arithmetic for global symbolsH. Peter Anvin2-32/+52
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-25ELF: bump GLOBAL_TEMP_BASEH. Peter Anvin1-1/+1
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-25ELF: eliminate hard-coded section numbersH. Peter Anvin4-81/+146
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-25Handle the new ELF headers in the dependency generationH. Peter Anvin10-27/+48
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-25ELF: add header files, begin merging common code, drop .commentH. Peter Anvin11-324/+678
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-25NASM 2.06rc13H. Peter Anvin1-1/+1
2009-06-25changes.src: updateH. Peter Anvin1-0/+6
2009-06-24insns: make the MMX version of PINSRW match the SSE/AVX onesH. Peter Anvin4-9/+24
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-24Intel FMA: drop relaxed formsH. Peter Anvin2-210/+196
The Intel FMA instructions are destructive, so relaxed forms are not appropriate. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24Fix the PINSR series of instructionsH. Peter Anvin4-18/+178
Clean up a number of errors in the PINSR series instructions. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24Add support for instructions which always use low 8-bit registersH. Peter Anvin3-3/+24
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-24insns.dat: fix typos: VCMPORD_SP[SD] entered as VCMPORS_SP[SD]H. Peter Anvin1-4/+2
Fix typos in two instructions in the relaxed forms. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-24insns.dat: collapse relaxed formsH. Peter Anvin1-1212/+608
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-24insns.pl: allow relaxed forms to be created without duplicationH. Peter Anvin1-32/+77
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-24changes.src: fix some odd spacingH. Peter Anvin1-2/+2
2009-06-23parser: don't use midcode declarationsH. Peter Anvin1-1/+2
OpenWatcom can't handle midcode variable declarations. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-23BR 2782055: reject invalid tokens after ]Victor van den Elzen1-8/+16
A bracketed memory reference should be followed by a comma or the end of the line. Enforce this.
2009-05-26specfile: update URLsH. Peter Anvin1-2/+2
Update the URLs in the specfile to point to http://www.nasm.us/. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-05-25Nindent: add back the -nut optionH. Peter Anvin1-1/+1
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-25Nindent: update with the -npro and -il0 optionsH. Peter Anvin1-2/+18
Update with the -npro and, if recent enough, the -il0 options. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-05-23doc: use NASM syntax for x87 registersH. Peter Anvin1-1/+1
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-17insns.dat - fixup for XOP (SSE5) AMD instructionsCyrill Gorcunov1-13/+23
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-15insns.dat - introcuce base XOP (SSE5) AMD instructionsCyrill Gorcunov1-0/+199
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-15insns.pl - add handling of pp VEX/XOP fieldsCyrill Gorcunov1-3/+5
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-08Add symbolic constants for REX_V "classes" (VEX, XOP, ...)H. Peter Anvin2-4/+12
Signed-off-by: H. Peter Anvin <hpa@zytor.com>