Commit Graph

563 Commits

Author SHA1 Message Date
H. Peter Anvin
cde08292d6 Define a proper hash table library
Define a proper hash table library, instead of the current ad hoc stuff
used for both labels and macros.  This only implements the actual
library; it is not yet used.

We use a CRC64 as a prehash.  This is almost certainly overkill,
although it is rather efficient (except, arguably, the table lookup)
on 64-bit platforms, and not all that bad on 32-bit platforms.  All we
really need is a function which produces two independent 32-bit
results which are used as the primary and secondary hash
respectively.  Either way, the prehash function is easily replacable
if/when we have a quicker alternative.
2007-09-14 09:24:38 -07:00
H. Peter Anvin
9ab60dabcc Simple performance benchmarks: label, macro and token lookups
Simple scripts to generate performance benchmarks for label,
macro and token lookups.  The label and macro lookups are simple
numerical sequences; it may be desirable to add some more
sophisticated algorithms for producing tokens in case we want to
compare different hash functions against each other.
2007-09-13 18:13:20 -07:00
H. Peter Anvin
942acbf782 release script: fix final cleanup
Make sure we're in the right place for the final cleanup.
2007-09-13 12:25:32 -07:00
H. Peter Anvin
c338779174 Modify release script for a git-centric world
Change the release script to use git rather than CVS.
THE BEHAVIOR OF THE SCRIPT HAS CHANGED -- make sure to look at it
before use.
2007-09-13 12:22:00 -07:00
H. Peter Anvin
1a6e76d682 pptok.c: don't insist on C99 compiler behaviour
Declarations that are not at the head is C99 behaviour, but it's
rather pointless for this little piece of code.  Fix to work with
older compilers.
2007-09-13 11:06:42 -07:00
H. Peter Anvin
388b3ab3a3 Fix literal F2 and F3 prefixes
Correct literal F2 and F3 prefixes and instead use \332 and \333.
Otherwise we get the REX prefixes in the wrong place.
2007-09-12 22:02:06 -07:00
H. Peter Anvin
cb9b690ae6 Add (untested!) SSSE3, SSE4.1, SSE4.2 instructions
Add the SSSE3, SSE4.1 and SSE4.2 instruction sets.  Change \332 to be
a literal 0xF2 prefix, by analog with \333 for 0xF3 prefix (the
previous \332 flag changed to \335).  This is necessary to get the REX
prefix in the right place for instructions that use it.

We are going to have to go in and change existing instruction patterns
which use these, as well.
2007-09-12 21:58:51 -07:00
H. Peter Anvin
daffd79372 Add support for Tejas New Instructions (SSSE3)
Add the SSSE3 instruction set.
2007-09-12 21:06:36 -07:00
H. Peter Anvin
d105682096 Remove $Id$ tags (useless with git)
Remove CVS $Id$ tags, since git doesn't use them.
2007-09-12 21:05:06 -07:00
H. Peter Anvin
c9f8ee92f0 Use rm32 operands for VMREAD/VMWRITE
Use rm32 instead of coding reg32 and mem32 separately.
2007-09-12 21:04:58 -07:00
H. Peter Anvin
2e7dd975eb Macros for SSSE3/SSE4 instruction sets
Add instruction set flags for the SSSE3, SSE4.1 and SSE4.2 instruction
subsets.
2007-09-12 21:04:51 -07:00
H. Peter Anvin
0da6b580eb Support r/m operands for non-integer types
Support r/m operands for non-integer operands types, i.e. mmx or xmm
operands.  This allows mmx and xmm operands to be written more
compactly, speeding up the assembler.
2007-09-12 21:04:39 -07:00
H. Peter Anvin
16b0a33cea Use enumerations where practical to ease debugging
We have a lot of enumerations; by declaring fields as such, we make it
easier when debugging, since the debugger can display the enumerations
in cleartext.  However, make sure exceptional values (like -1) are
included in the enumeration, since the compiler otherwise may not
include it in the valid range of the enumeration.
2007-09-12 20:27:41 -07:00
H. Peter Anvin
7978feebd2 pptok.c: quick-and-dirty downcasing during prehashing
Speed up pptok.c by just doing |= 0x20 instead of calling tolower() for
every character during prehashing.  This is good enough for our needs,
since we don't have any tokens containing the characters @ [ \ ] _ nor
any high-bit characters (in which case we'd have to worry about multibyte
anyway.)
2007-09-12 17:02:55 +00:00
H. Peter Anvin
ff6e9b4699 phash: Tell the user when the graph is OK
Tell the user when the graph is OK, so that we don't get quite so much of
"a list of errors followed by a long pause."
2007-09-12 16:55:57 +00:00
H. Peter Anvin
3100e6cb63 pptok.c: handle holes in the pp_directives array
We need to fail if we land in a hole in the pp_directives array, since
we have a noncontiguous enum preproc_token now.
2007-09-12 05:18:20 +00:00
H. Peter Anvin
95e28828ab preproc.c: adjust whitespace
Be consistent about whitespace.
2007-09-12 04:20:08 +00:00
H. Peter Anvin
da10e7b85e More automation in the preprocessor conditionals handling
Further automate the production of preprocessor conditionals.  Now the
code automatically folds if/elif and the negatives.
2007-09-12 04:18:37 +00:00
H. Peter Anvin
872460fe27 pptok.c: fix spacing 2007-09-12 02:13:39 +00:00
H. Peter Anvin
9bf0aa7c52 Generate automatically correct tests for %if and %elif
Automatically generate macros to test for %if and %elif variants, which
are guaranteed to be correct across future changes.
2007-09-12 02:12:07 +00:00
H. Peter Anvin
9e1c202b69 Run "make alldeps"; add dependencies missing from the previous checkin
It helps to run "make alldeps" when the changes are actually complete...
2007-09-12 01:34:19 +00:00
H. Peter Anvin
4169a47bd9 Use a perfect hash to look up preprocessor directives
Use a perfect hash to look up preprocessor directives, and generate
the preprocessor directive list automatically.
2007-09-12 01:29:43 +00:00
H. Peter Anvin
cdea6f96b6 phash: Be a bit more aggressive about trying to make a small hash
Change the threshold to 0.7 instead of 0.8.
2007-09-12 01:27:53 +00:00
H. Peter Anvin
ce9be34d3d Add RCXZ as a known preprocessor condition 2007-09-12 00:22:29 +00:00
H. Peter Anvin
9c06db6935 doc: add some cross-references 2007-09-11 23:57:23 +00:00
H. Peter Anvin
9b49e24e1f Feeble attempt at updating the documentation; remove Appendix B
Feeble attempt to document 64-bit support.  Also, remove Appendix B since
we have been utterly useless at keeping it up to date, and it's redundant
with the processor manufacturer's documentation anyway.
2007-09-11 23:52:01 +00:00
H. Peter Anvin
62cb606f68 Handle instructions which can have both REX.W and OSP 2007-09-11 22:44:03 +00:00
H. Peter Anvin
b79f0d0cc3 Use enums to make debugging easier
When we're dealing with a field which is guaranteed to have an enum type,
then declare it as such so it shows up in debuggers.
2007-09-11 22:14:18 +00:00
H. Peter Anvin
2ba7ed7122 ndisasm: handle \366 codes, prefer unprefixed instructions
- Implement \366 codes in ndisasm
- Prefer instruction patterns without loose prefixes if possible
- Fix improper initialization of operands in ndisasm
2007-09-11 22:13:17 +00:00
H. Peter Anvin
4f090502fb Simplify tokens.dat slightly 2007-09-11 22:00:34 +00:00
H. Peter Anvin
bfb888c015 Quiet gcc warning about uninitialized variables 2007-09-11 04:26:44 +00:00
H. Peter Anvin
3360d79369 Make the big instruction arrays "const"
Make the big instruction arrays "const", so they end up in readonly
storage.  While we're at it, move their prototypes into insns.h.
2007-09-11 04:16:57 +00:00
H. Peter Anvin
ea6bfb8107 Use an actual enum for the opcode
Use an actual named enum for the opcode, that way it shows up in
cleartext while debugging.
2007-09-10 23:32:05 +00:00
H. Peter Anvin
6fa5c358b5 Fix order of token arguments
Order of token arguments was reversed, but tokens.dat wasn't updated
accordingly.  Fix.
2007-09-10 23:30:21 +00:00
H. Peter Anvin
f5843c614a assemble.c: correct special handing of ESP/RSP
Correct the special handling of ESP/RSP (must be in the base register
slot, but requires SIB.)
2007-09-10 18:59:26 +00:00
H. Peter Anvin
309a8ba340 tokhash: correct duplicate-token test 2007-09-10 18:59:01 +00:00
H. Peter Anvin
d555a64a7f tokhash: adjust table types to reduce size
Adjust the sizes of data types to reduce the total size of the tokhash
data structure.
2007-09-10 18:58:40 +00:00
H. Peter Anvin
a80241f58a Fix the MMXREG and XMMREG flags definitions. 2007-09-10 18:55:52 +00:00
H. Peter Anvin
f6abe44fc8 nasm.spec.in: Copyright -> License 2007-09-05 06:48:38 +00:00
H. Peter Anvin
52e30171ee Fix "make tar"; useful for RPM testing 2007-09-05 06:40:51 +00:00
H. Peter Anvin
da51fc9dac Remove obsolete Serial: construct; we shouldn't need it anyway. 2007-09-05 06:24:43 +00:00
Chuck Crayne
199b96a810 Provide 64-bit support for ORG directive 2007-09-04 01:29:43 +00:00
H. Peter Anvin
53a3c687dd Fix some MMX/SSE irregularities which interact with the 64-bit support 2007-09-02 16:37:03 +00:00
H. Peter Anvin
e17a3cb29d phash.ph: yet another attempt at getting Perl to behave, arithmetically 2007-09-02 14:46:00 +00:00
H. Peter Anvin
4768f5f6f2 Simple 64-bit org test 2007-09-02 06:23:29 +00:00
H. Peter Anvin
e3e9e9fa0d phash.ph: remove some stale code
Remove old randomization code which is no longer used.
2007-09-02 06:20:15 +00:00
Chuck Crayne
757dfad900 Force use of integer values for generating hash keys. 2007-09-02 01:00:34 +00:00
H. Peter Anvin
b938e043ca phash: don't rely on the build platform Perl version of rand()
rand() in Perl can vary between platforms, so don't use it.  Instead,
remove a completely pointless level of indirection (it introduced a
permutation which cancelled itself out) and provide a canned set of
random numbers for the rest.  This guarantees we will always use the
same numbers.
2007-08-31 18:10:23 +00:00
H. Peter Anvin
96a810256f tokhash.pl: formatting changes for readability
No functional change
2007-08-31 07:31:51 +00:00
H. Peter Anvin
91a86cdb31 tokhash: Speed up the rejection of unhashed values
Speed up the rejection of unhashed values (typically identifiers) by
filling unused hash slots with a large value (but not so large that
it is likely to overflow.)  This means those values will be rejected
already by the range check, not needing strcmp().
2007-08-31 07:23:31 +00:00