Commit graph

983 commits

Author SHA1 Message Date
H. Peter Anvin
0a4d23219e insnsb.c: use 5 digits for index, not 4
We already have indexes up to 9500, so use 5 digits instead of 4.
2008-05-12 15:28:33 -07:00
H. Peter Anvin
ff3b57c253 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.
2008-05-12 11:36:24 -07:00
H. Peter Anvin
aaa088fbf3 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.
2008-05-12 11:13:41 -07:00
H. Peter Anvin
3720f7beae 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.
2008-05-12 11:00:50 -07:00
H. Peter Anvin
387c1c2714 Factor out string decoder in insns.pl
Factor out the string decoder into its own subroutine.  This will be
useful shortly ;)
2008-05-12 10:17:27 -07:00
H. Peter Anvin
d58656f797 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.
2008-05-06 20:11:14 -07:00
H. Peter Anvin
e303936391 Fix encoding of VPERMIL2PS instructions 2008-05-06 20:06:14 -07:00
H. Peter Anvin
4e0fd9fb63 Actually spell "Sandy Bridge" correctly 2008-05-06 19:58:52 -07:00
H. Peter Anvin
42a8caecb5 Sandy Bridge, not Sandy Banks; add Westmere 2008-05-06 19:54:28 -07:00
H. Peter Anvin
7334e3ac23 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...)
2008-05-05 18:47:27 -07:00
H. Peter Anvin
4d2c38ce75 The AVX R,X,B, and V fields (but not W) are inverted.
The AVX test cases are still not generated correctly, though.
2008-05-04 23:15:13 -07:00
H. Peter Anvin
d85d250fa2 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.
2008-05-04 17:53:31 -07:00
H. Peter Anvin
7117e80702 Initial support for YMM (AVX) registers
Add support for ymm0..15 registers, and the "ymmreg" qualifier.
No support yet for "yword" or "dy".
2008-04-21 22:44:55 -04:00
Charles Crayne
a762ca544b Avoid long line warning when generating nasm docs
rdsrc.pl limits lines to 68 characters for some formats
2008-04-12 13:35:43 -07:00
Bo Borgerson
7d4d2c3cc9 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>
2008-04-12 11:12:14 -07:00
H. Peter Anvin
72ec0e4144 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.
2008-04-10 14:56:09 -07:00
H. Peter Anvin
2746b624fb autogen.sh: remove config.status
Remove config.status when rebuilding the autoconf files.
2008-04-10 14:54:02 -07:00
Charles Crayne
8ca31b48af Document avaiabily of DWARF for ELF32 and ELF64 2008-04-07 14:26:29 -07:00
Charles Crayne
6f15b9884e Correctly identify dwarf support for elf32
Change architecture tag to i386.
2008-04-07 13:15:53 -07:00
H. Peter Anvin
32cd4c2a62 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.
2008-04-04 13:34:53 -07:00
Charles Crayne
5a7976c925 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.
2008-03-26 17:20:21 -07:00
Charles Crayne
bd45c46cb9 Merge branch 'master' of git+ssh://ccrayne@repo.or.cz/srv/git/nasm 2008-03-22 20:08:20 -07:00
Charles Crayne
fa93735742 Remove KATMAI support for CLFLUSH
Minimal cpu level is WILLAMETTE,SSE2
2008-03-22 20:07:08 -07:00
H. Peter Anvin
234007ff88 Remove redundant, bogus CLFLUSH entry 2008-03-22 19:33:31 -07:00
H. Peter Anvin
accf94ea24 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.
2008-03-19 14:52:27 -07:00
H. Peter Anvin
65e823978b 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.
2008-03-19 14:42:20 -07:00
Charles Crayne
6372b9c5fc Correct opcode for CLFLUSH
Correct opcode is 0FAEh
2008-03-18 15:21:14 -07:00
Charles Crayne
d60059ef41 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.
2008-03-12 22:39:03 -07:00
Charles Crayne
aed5cfea58 Adjust symbol number for global symbols
Reloc entries were pointing to wrong target section
2008-03-04 14:25:34 -08:00
Charles Crayne
82e94990ad Eliminate duplicate symbol definitions
Don't accept -1 as an odd numbered segment
2008-03-03 14:43:55 -08:00
Charles Crayne
90131d500b Report dwarf as V2 for ELF32
Older versions of gdb reject version 3
2008-02-24 21:05:46 -08:00
Charles Crayne
225f82fa12 Dwarf3 support for ELF32
1. Port dwarf3 support from ELF64 to ELF32
2. Move common SAA extentions to nasmlib
2008-02-24 19:14:17 -08:00
Charles Crayne
986312b17a Dwarf support tweeks and clean-up
1. Add relocation entries for dwarf sections.
2. Combine common dwarf and stabs routines.
2008-02-23 18:35:11 -08:00
H. Peter Anvin
75ed1ebfb4 NASM 2.02 2008-02-19 11:01:08 -08:00
H. Peter Anvin
27713625c1 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.
2008-02-17 18:54:13 -08:00
H. Peter Anvin
134b94665d Add %ifempty and variants 2008-02-16 17:01:40 -08:00
H. Peter Anvin
3f3bd41de0 CHANGES: Document %iftoken 2008-02-16 16:46:45 -08:00
H. Peter Anvin
b8536e1f06 NASM 2.02rc2 2008-02-16 16:44:46 -08:00
H. Peter Anvin
cbf768d67d 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.
2008-02-16 16:41:25 -08:00
H. Peter Anvin
88ab419cc6 OpenWatcom: optimize for 686
Apparently -6 compiles are defined to run on anything 386 or newer,
and just use different instruction timings.
2008-02-16 15:44:24 -08:00
H. Peter Anvin
714ad04bb8 Some compilers define __386__ instead of __i386__
OpenWatcom, and possibly other compilers from the DOS universe,
defines __386__ rather than __i386__.
2008-02-16 15:28:02 -08:00
H. Peter Anvin
338a3b6882 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.
2008-02-16 15:25:02 -08:00
H. Peter Anvin
848dbc8ff8 Bring CHANGES hopefully up to date 2008-02-16 15:08:41 -08:00
H. Peter Anvin
8c01b0b409 Use term "host platform" consistently 2008-02-16 14:57:45 -08:00
H. Peter Anvin
70e63c9a9a Add standard time macro boilerplate to __POSIX_TIME__ 2008-02-16 14:56:49 -08:00
H. Peter Anvin
6b18bcce46 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
2008-02-16 14:54:10 -08:00
H. Peter Anvin
188ce76c46 Constipate the stdmac[] array. 2008-02-16 13:58:45 -08:00
H. Peter Anvin
927c92b478 BR 1582430: Allow numbers with leading + or - for %ifnum
Allow numbers with a leading + or - to return true for %ifnum.
2008-02-16 13:44:52 -08:00
H. Peter Anvin
373281afde BR 1893952: XGETBV is not privileged. 2008-02-16 13:29:56 -08:00
H. Peter Anvin
f6c51f084b 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.)
2008-02-14 11:25:36 -08:00