H. Peter Anvin [Tue, 20 May 2008 21:21:29 +0000 (14:21 -0700)]
Avoid #including .c files; instead compile as separate units
Don't #include .c files, even if they are auto-generated; instead
compile them as separate compilation units and let the linker do its
job.
H. Peter Anvin [Tue, 20 May 2008 20:07:09 +0000 (13:07 -0700)]
PTEST is SSE4.1; although AMD says it's SSE5.
Fix this when we have proper support for feature sets, or forget about
the concept entirely.
H. Peter Anvin [Tue, 20 May 2008 20:03:39 +0000 (13:03 -0700)]
insns.pl: don't require whitespace before / or \
Use Perl's context-sensitive regular expressions to tell split that a
slash or backslash begins a new operator.
H. Peter Anvin [Tue, 20 May 2008 18:47:01 +0000 (11:47 -0700)]
nasm.h: remove obsolete IP_REG definitions
H. Peter Anvin [Tue, 20 May 2008 18:43:53 +0000 (11:43 -0700)]
Add DY, YWORD, and the SY instruction flag
Add the DY instruction, YWORD keyword, and an SY marker for
instruction sizes. Add a few more AVX sample instructions.
H. Peter Anvin [Tue, 20 May 2008 18:23:18 +0000 (11:23 -0700)]
insns.pl: support operands that serve double duty
Sometimes assembly syntax wants to permit a single operand to serve
multiple functions; allow this.
The disassembler could really use to be smarter about those.
H. Peter Anvin [Tue, 20 May 2008 18:05:59 +0000 (11:05 -0700)]
insns.dat: no subheader for "must be last"
H. Peter Anvin [Tue, 20 May 2008 18:04:26 +0000 (11:04 -0700)]
insns.dat: make even wider to make space for AVX
The AVX instructions take more space, so add a few tab stops across
the entire file.
H. Peter Anvin [Tue, 20 May 2008 18:01:28 +0000 (11:01 -0700)]
insns.dat: use compiler-generated bytecodes for AVX
Use compiler-generated bytecodes for the AVX instruction demos. This
should make it a lot easier for other people (HINT, HINT) to add the
instruction table.
H. Peter Anvin [Tue, 20 May 2008 17:48:22 +0000 (10:48 -0700)]
insns.pl: fix regex subgroup of /is4= codes
The argument is now $1, not $2...
H. Peter Anvin [Tue, 20 May 2008 17:39:15 +0000 (10:39 -0700)]
insns.pl: fix splitting of bracketted operations
H. Peter Anvin [Tue, 20 May 2008 17:29:11 +0000 (10:29 -0700)]
Opcode listing notation is /is4, consistently
H. Peter Anvin [Tue, 20 May 2008 17:21:57 +0000 (10:21 -0700)]
Use the \360..\363 annotations for SSE prefixes
H. Peter Anvin [Tue, 20 May 2008 16:46:24 +0000 (09:46 -0700)]
Same some space by introducing shorthand byte codes for SSE prefixes
Properly done, all SSE instructions which has the 66/F2/F3 opcode
multiplex need two prefixes: one to control the use of OSP and one to
control the use of REP. However, it's a four-way select: np/66/F2/F3;
so introduce shorthand bytecodes for that purpose.
H. Peter Anvin [Tue, 20 May 2008 16:36:41 +0000 (09:36 -0700)]
Allow explicit immediate syntax for imz2 as well as is4
imz2 is just an alias for is4 as far as we are concerned...
H. Peter Anvin [Tue, 20 May 2008 04:10:14 +0000 (21:10 -0700)]
insns.pl: escape literal special character in regex
In Perl code, it is good practice to escape special characters
intended to be literal.
H. Peter Anvin [Tue, 20 May 2008 04:07:08 +0000 (21:07 -0700)]
Bytecode compiler: add support for is4/imz2 operands
H. Peter Anvin [Tue, 20 May 2008 02:08:03 +0000 (19:08 -0700)]
More work on bytecode compiler (not finished yet...)
More work on the bytecode compiler. Not all useful bytecodes are
implemented yet, however.
H. Peter Anvin [Tue, 20 May 2008 01:19:42 +0000 (18:19 -0700)]
insns.pl: first steps toward a "smart" bytecode compiler
First steps toward a smart(er) bytecode compiler, using a syntax that
can be more directly taken from the manuals.
H. Peter Anvin [Tue, 13 May 2008 21:29:47 +0000 (14:29 -0700)]
Make insnsb.c an actual compilation unit
"make alldeps" doesn't really like it when included files end in *.c.
Instead of renaming insnsb.c to insnsb.h, make it an actual
compilation unit, since there really isn't any reason for it not to
be.
H. Peter Anvin [Mon, 12 May 2008 22:28:33 +0000 (15:28 -0700)]
insnsb.c: use 5 digits for index, not 4
We already have indexes up to 9500, so use 5 digits instead of 4.
H. Peter Anvin [Mon, 12 May 2008 18:36:24 +0000 (11:36 -0700)]
Make MAX_OPERANDS a parameter in insns.pl as well
MAX_OPERANDS is present in insns.pl as well (although proper C
compilers shouldn't need this kind of zero padding.) Make sure it's
clear to everyone.
H. Peter Anvin [Mon, 12 May 2008 18:13:41 +0000 (11:13 -0700)]
Remove special hacks to avoid zero bytecodes
We can now have zero bytecodes with impunity, so remove any special
hacks we had to avoid zeroes in the bytecode.
H. Peter Anvin [Mon, 12 May 2008 18:00:50 +0000 (11:00 -0700)]
Generate a byte array instead of using strings for the byte codes
Generate a byte array instead of using C compiler strings for the byte
codes. This has a few advantages:
- No need to special-case zero due to broken C compilers.
- Only insns.pl only ever reads the string, so we can invent our own
syntax.
- Compaction.
- We can give it the proper, unsigned type.
H. Peter Anvin [Mon, 12 May 2008 17:17:27 +0000 (10:17 -0700)]
Factor out string decoder in insns.pl
Factor out the string decoder into its own subroutine. This will be
useful shortly ;)
H. Peter Anvin [Wed, 7 May 2008 03:11:14 +0000 (20:11 -0700)]
Add support for register-number immediates with fixed 4-bit values
Add support for imm8 bytes which has a register value in the top four
bits and an arbitrary fixed value in the bottom four bits.
H. Peter Anvin [Wed, 7 May 2008 03:06:14 +0000 (20:06 -0700)]
Fix encoding of VPERMIL2PS instructions
H. Peter Anvin [Wed, 7 May 2008 02:58:52 +0000 (19:58 -0700)]
Actually spell "Sandy Bridge" correctly
H. Peter Anvin [Wed, 7 May 2008 02:54:28 +0000 (19:54 -0700)]
Sandy Bridge, not Sandy Banks; add Westmere
H. Peter Anvin [Tue, 6 May 2008 01:47:27 +0000 (18:47 -0700)]
Initial NDISASM support for AVX instructions/VEX prefixes
Initial NDISASM support for AVX instructions and VEX prefixes. It
doesn't mean it's correct, but it seems to match my current
understanding. It can disassemble *some*, but not *all*, of the AVX
test cases (which are known to be at least partially incorrect...)
H. Peter Anvin [Mon, 5 May 2008 06:15:13 +0000 (23:15 -0700)]
The AVX R,X,B, and V fields (but not W) are inverted.
The AVX test cases are still not generated correctly, though.
H. Peter Anvin [Mon, 5 May 2008 00:53:31 +0000 (17:53 -0700)]
First cut at AVX machinery.
First cut at AVX machinery support. The only instruction implemented
is VPERMIL2PS, and it's probably buggy. I'm checking this in with the
hope that other people can start helping out with (a) testing this,
and (b) adding instructions.
NDISASM support is not there yet.
H. Peter Anvin [Tue, 22 Apr 2008 02:44:55 +0000 (22:44 -0400)]
Initial support for YMM (AVX) registers
Add support for ymm0..15 registers, and the "ymmreg" qualifier.
No support yet for "yword" or "dy".
Charles Crayne [Sat, 12 Apr 2008 20:35:43 +0000 (13:35 -0700)]
Avoid long line warning when generating nasm docs
rdsrc.pl limits lines to 68 characters for some formats
Bo Borgerson [Sat, 12 Apr 2008 15:47:57 +0000 (11:47 -0400)]
Avoid some warnings in rdoff/rdf2bin.c
I received some warnings when running make on the head revision of
nasm from git:
----
rdf2bin.c: In function 'main':
rdf2bin.c:122: warning: comparison between signed and unsigned
rdf2bin.c:123: warning: comparison between signed and unsigned
rdf2bin.c:124: warning: comparison between signed and unsigned
----
I think these warnings are innocuous and should be safely avoidable
with simple casts (please see attached patch).
* rdoff/rdf2bin.c
(main): cast to size_t for comparison with fwrite return value
Signed-off-by: Bo Borgerson <gigabo@gmail.com>
H. Peter Anvin [Thu, 10 Apr 2008 21:56:09 +0000 (14:56 -0700)]
Temporaries in macros need a unique prefix; WSAA*() macros to header
When using temporaries in macros, given them a unique prefix to avoid
namespace collisions when using one macro inside another.
Move the WSAA*() macros from outelf32/outelf64 to a separate header
file.
H. Peter Anvin [Thu, 10 Apr 2008 21:54:02 +0000 (14:54 -0700)]
autogen.sh: remove config.status
Remove config.status when rebuilding the autoconf files.
Charles Crayne [Mon, 7 Apr 2008 21:26:29 +0000 (14:26 -0700)]
Document avaiabily of DWARF for ELF32 and ELF64
Charles Crayne [Mon, 7 Apr 2008 20:15:53 +0000 (13:15 -0700)]
Correctly identify dwarf support for elf32
Change architecture tag to i386.
H. Peter Anvin [Fri, 4 Apr 2008 20:34:53 +0000 (13:34 -0700)]
Correctly identify SBYTE in the optimizer
Correctly identify SBYTE in the optimizer, *HOWEVER*, this change will
cause nuisance warnings to be issued; that will have to be fixed.
Charles Crayne [Thu, 27 Mar 2008 00:20:21 +0000 (17:20 -0700)]
Restore critical expression checking when optimizer enabled
In the prior code, enabling optimization effectively diabled
critical expression checking, because the optimization passes
took place before checking was enabled.
Charles Crayne [Sun, 23 Mar 2008 03:08:20 +0000 (20:08 -0700)]
Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
Charles Crayne [Sun, 23 Mar 2008 03:07:08 +0000 (20:07 -0700)]
Remove KATMAI support for CLFLUSH
Minimal cpu level is WILLAMETTE,SSE2
H. Peter Anvin [Sun, 23 Mar 2008 02:33:31 +0000 (19:33 -0700)]
Remove redundant, bogus CLFLUSH entry
H. Peter Anvin [Wed, 19 Mar 2008 21:52:27 +0000 (14:52 -0700)]
Better handling of 32-bit imms in 64-bit moves
A much better way to handle the 32-bit immediates in 64-bit moves.
Add a test file.
H. Peter Anvin [Wed, 19 Mar 2008 21:42:20 +0000 (14:42 -0700)]
insns.dat: add "MOV reg64,imm32" as a special rule
Add "MOV reg64,imm32" as a special rule, to handle the case of
"mov rax,dword <foo>", where <foo> is sign-extended; this is a 7-byte
form, as opposed to "mov eax,<foo>" (5 bytes) and "mov rax,<foo>" (10
bytes).
At some point, the optimizer needs to be able to handle these.
Charles Crayne [Tue, 18 Mar 2008 22:21:14 +0000 (15:21 -0700)]
Correct opcode for CLFLUSH
Correct opcode is 0FAEh
Charles Crayne [Thu, 13 Mar 2008 05:39:03 +0000 (22:39 -0700)]
Display fully qualified local label in "not defined" message
Add new function "local_scope" to label subsystem to
return the previous non-local label for a given local label,
and invoke this funcion in eval.c to display the fully
qualified name in the "not defined" error message.
Charles Crayne [Tue, 4 Mar 2008 22:25:34 +0000 (14:25 -0800)]
Adjust symbol number for global symbols
Reloc entries were pointing to wrong target section
Charles Crayne [Mon, 3 Mar 2008 22:43:55 +0000 (14:43 -0800)]
Eliminate duplicate symbol definitions
Don't accept -1 as an odd numbered segment
Charles Crayne [Mon, 25 Feb 2008 05:05:46 +0000 (21:05 -0800)]
Report dwarf as V2 for ELF32
Older versions of gdb reject version 3
Charles Crayne [Mon, 25 Feb 2008 03:14:17 +0000 (19:14 -0800)]
Dwarf3 support for ELF32
1. Port dwarf3 support from ELF64 to ELF32
2. Move common SAA extentions to nasmlib
Charles Crayne [Sun, 24 Feb 2008 02:35:11 +0000 (18:35 -0800)]
Dwarf support tweeks and clean-up
1. Add relocation entries for dwarf sections.
2. Combine common dwarf and stabs routines.
H. Peter Anvin [Tue, 19 Feb 2008 19:01:08 +0000 (11:01 -0800)]
NASM 2.02
H. Peter Anvin [Mon, 18 Feb 2008 02:54:13 +0000 (18:54 -0800)]
outform: make OF_DOS include OF_COFF
DJGPP uses COFF as the file format. Since DJGPP is widely used in the
(remaining) DOS world, include OF_COFF in OF_DOS.
H. Peter Anvin [Sun, 17 Feb 2008 01:01:40 +0000 (17:01 -0800)]
Add %ifempty and variants
H. Peter Anvin [Sun, 17 Feb 2008 00:46:45 +0000 (16:46 -0800)]
CHANGES: Document %iftoken
H. Peter Anvin [Sun, 17 Feb 2008 00:44:46 +0000 (16:44 -0800)]
NASM 2.02rc2
H. Peter Anvin [Sun, 17 Feb 2008 00:41:25 +0000 (16:41 -0800)]
Implement %iftoken, test for a single token
Implement %iftoken, a test for a single token. This is useful in
cases using %+ to splice a macro-provided token.
H. Peter Anvin [Sat, 16 Feb 2008 23:44:24 +0000 (15:44 -0800)]
OpenWatcom: optimize for 686
Apparently -6 compiles are defined to run on anything 386 or newer,
and just use different instruction timings.
H. Peter Anvin [Sat, 16 Feb 2008 23:28:02 +0000 (15:28 -0800)]
Some compilers define __386__ instead of __i386__
OpenWatcom, and possibly other compilers from the DOS universe,
defines __386__ rather than __i386__.
H. Peter Anvin [Sat, 16 Feb 2008 23:25:02 +0000 (15:25 -0800)]
Clear up WRITE macros causing compile failures with Watcom
The OpenWatcom compiler warns about invalid shifts (correctly, it
appears) due to the non-X86_MEMORY versions of the various WRITE
macros. Fix.
H. Peter Anvin [Sat, 16 Feb 2008 23:08:41 +0000 (15:08 -0800)]
Bring CHANGES hopefully up to date
H. Peter Anvin [Sat, 16 Feb 2008 22:57:45 +0000 (14:57 -0800)]
Use term "host platform" consistently
H. Peter Anvin [Sat, 16 Feb 2008 22:56:49 +0000 (14:56 -0800)]
Add standard time macro boilerplate to __POSIX_TIME__
H. Peter Anvin [Sat, 16 Feb 2008 22:54:10 +0000 (14:54 -0800)]
BR 774131: date and time macros
This checkin creates the following date and time macros:
__DATE__, __TIME__, __UTC_DATE__, __UTC_TIME__: strings
__DATE_NUM__, __TIME_NUM__, __UTC_DATE_NUM__, __UTC_TIME_NUM__:
civil dates in digit-string formats
__POSIX_TIME__: time in POSIX time_t format
H. Peter Anvin [Sat, 16 Feb 2008 21:58:45 +0000 (13:58 -0800)]
Constipate the stdmac[] array.
H. Peter Anvin [Sat, 16 Feb 2008 21:44:52 +0000 (13:44 -0800)]
BR 1582430: Allow numbers with leading + or - for %ifnum
Allow numbers with a leading + or - to return true for %ifnum.
H. Peter Anvin [Sat, 16 Feb 2008 21:29:56 +0000 (13:29 -0800)]
BR 1893952: XGETBV is not privileged.
H. Peter Anvin [Thu, 14 Feb 2008 19:25:14 +0000 (11:25 -0800)]
Add XSAVE instruction features (CPU feature is bogus, but oh well.)
Add the XSAVE group of instructions: XSAVE, XRSTOR, XGETBV, XSETBV.
The CPU feature information is bogus, but so is our entire handling of
CPU feature sets for anything but the bare necessities (long jump
emulation, etc.)
Charles Crayne [Thu, 14 Feb 2008 03:58:54 +0000 (19:58 -0800)]
Upgrade dwarf3 support for elf64
Add support for multiple executable segments
Charles Crayne [Thu, 7 Feb 2008 06:17:55 +0000 (22:17 -0800)]
Test version of dwarf debugging format for elf64
Not ready for prime time, but anyone who is interested
is welcome to help me test.
H. Peter Anvin [Wed, 6 Feb 2008 05:35:08 +0000 (21:35 -0800)]
Mkfiles/README: document the Netware Makefile.
H. Peter Anvin [Wed, 6 Feb 2008 05:30:16 +0000 (21:30 -0800)]
Add Makefile for Netware
Add Makefile for Netware, using the GNU toolchain.
H. Peter Anvin [Wed, 6 Feb 2008 05:29:32 +0000 (21:29 -0800)]
version.pl: produce Makefile variables
Add a mode to version.pl to produce Makefile variables (used by
Netware Makefile.)
H. Peter Anvin [Wed, 6 Feb 2008 05:27:43 +0000 (21:27 -0800)]
Fix "carryover" of exclude information from one file to another.
my %foo; doesn't mean %foo is initialized to empty, need my %foo = ();
or my %foo = undef; or similar for that.
H. Peter Anvin [Wed, 30 Jan 2008 22:23:43 +0000 (14:23 -0800)]
NASM 2.02rc1
H. Peter Anvin [Wed, 30 Jan 2008 22:22:17 +0000 (14:22 -0800)]
Add list of changes for 2.02, so far
H. Peter Anvin [Wed, 30 Jan 2008 22:13:46 +0000 (14:13 -0800)]
Test for BR 1879590
Ismail Dönmez [Wed, 30 Jan 2008 22:09:45 +0000 (14:09 -0800)]
BR 1879590: More MMX/SSE size fixes
Fix more instances of MMX/SSE having "SM" instead of "SQ" or "SO".
This should hopefully resolve bug report 1879590.
H. Peter Anvin [Mon, 28 Jan 2008 00:39:26 +0000 (16:39 -0800)]
BR 1880905: make sure we have enough zero-padding data for 'DO'
When using DO with a string that was too short, we would run off the
end of an all-zero buffer. Make sure the buffer is long enough.
Charles Crayne [Sun, 27 Jan 2008 20:49:20 +0000 (12:49 -0800)]
Prevent segfault in stabs64_typevalue
Prevent segfault when type == STT_OBJECT and no symbol
has been defined.
H. Peter Anvin [Fri, 25 Jan 2008 16:11:23 +0000 (08:11 -0800)]
float.c: BR 1879670: fix output byte order
The fix for the memory overwrite output the bytes in the wrong order.
Fix.
H. Peter Anvin [Tue, 22 Jan 2008 22:08:36 +0000 (14:08 -0800)]
Ignore ERR_PASS1 except for actual warnings
is_suppressed_warning() should never return true unless we're actually
dealing with a warning. There is a handful of cases where we pass
ERR_PASS1 down together with errors, but that's mostly because it fits
into an overall pattern. Thus, ignore it.
H. Peter Anvin [Tue, 22 Jan 2008 00:33:00 +0000 (16:33 -0800)]
RAA subsystem: use shift instead of divide
Make the RAA size always a power of two, so we can use shifts instead
of multiple, expensive divides.
H. Peter Anvin [Tue, 22 Jan 2008 00:31:57 +0000 (16:31 -0800)]
preproc.c: simplify detoken() slightly
Probably pointless optimization of detoken()...
H. Peter Anvin [Tue, 22 Jan 2008 00:29:10 +0000 (16:29 -0800)]
nasmlib.c: log nasm_free() before calling free()
If we're logging nasm_free(), then log it before we actually call
free(); that way we can find out what the last thing was if free()
crashes.
H. Peter Anvin [Tue, 22 Jan 2008 00:28:04 +0000 (16:28 -0800)]
nasmlib.h: nasm_zalloc() should call nasm_zalloc_log()
If we're doing logging, we need to call nasm_zalloc_log()
H. Peter Anvin [Tue, 22 Jan 2008 00:26:32 +0000 (16:26 -0800)]
misc/findleak.pl: make executable
misc/findleak.pl: no text change, but mark file executable.
H. Peter Anvin [Tue, 22 Jan 2008 00:26:05 +0000 (16:26 -0800)]
nasm.h: make t_type an enum
Make t_type an enum to make debugging easier.
H. Peter Anvin [Tue, 22 Jan 2008 00:23:59 +0000 (16:23 -0800)]
nasm.c: clean up the handing of response files
Avoid using malloc/free (not nasm_malloc/nasm_free even) in the
processing of response files; move to separate function.
H. Peter Anvin [Tue, 22 Jan 2008 00:19:52 +0000 (16:19 -0800)]
float.c: fix memory overwrite with 8-, 16- or 80-bit constants
We incorrectly clobbered 4 extra bytes when serializing 8-, 16- or
80-bit constants. Be less smart, but actually correct.
H. Peter Anvin [Tue, 22 Jan 2008 00:18:44 +0000 (16:18 -0800)]
OpenWatcom makefiles: add DEBUG option
Add a Makefile variable, DEBUG, which can be used to set debug options
(-d2, -DLOGALLOC, etc.)
H. Peter Anvin [Mon, 21 Jan 2008 19:50:31 +0000 (11:50 -0800)]
Fix the options when compiling under OpenWatcom
OpenWatcom needs different strings for compile and link target, so
using -bcl which uses the same string for both is just plain wrong.
This fixes that bit, but running nasm on test/floatx.asm (at least as
a DOS or a Win32 binary) crashes with a NULL pointer reference inside
the C library free() function.
H. Peter Anvin [Mon, 21 Jan 2008 05:50:02 +0000 (21:50 -0800)]
doc/Makefile.in: avoid deleting opt_var.txt, fix dependencies
Fix dependencies in the generation of the instruction list, and make
sure we don't delete opt_var.txt on "make spotless".
Charles Crayne [Mon, 21 Jan 2008 00:27:03 +0000 (16:27 -0800)]
Add autogenerated instruction list to NASM documentation
1. Allow included files in rdsrc.pl
2. New program inslist.pl to generate instruction list from insns.dat
3. Mark certain comments in insns.dat as documentation subheaders
4. Add Instruction List appendix to nasmdoc.src
5. Update build process to invoke inslist.pl
H. Peter Anvin [Thu, 17 Jan 2008 20:12:05 +0000 (15:12 -0500)]
NASM 2.01
H. Peter Anvin [Thu, 17 Jan 2008 20:11:46 +0000 (15:11 -0500)]
Document change in ELF section limit
Charles Crayne [Thu, 17 Jan 2008 02:41:03 +0000 (18:41 -0800)]
Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm
Charles Crayne [Thu, 17 Jan 2008 02:38:48 +0000 (18:38 -0800)]
Increase GLOBAL_TEMP_BASE
Increase GLOBAL_TEMP_BASE from 4096 to 1048576