summaryrefslogtreecommitdiff
path: root/tokhash.pl
AgeCommit message (Collapse)AuthorFilesLines
2013-11-27stdscan: Rework curly brace parsing routinesJin Kyu Song1-0/+1
As recommended by the community, a comma-separated decorators ({k1,z}) and nested braces ({{k1},{z}}) are dropped out. So only standard syntax is supported from now. This rework made source code neat and easy to maintain. Most of the codes for handling corner cases are removed. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-08-06AVX-512: Add support for parsing bracesJin Kyu Song1-5/+12
AVX-512 introduced new syntax using braces for decorators. Opmask, broadcat, rounding control use this new syntax. http://software.intel.com/sites/default/files/319433-015.pdf Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-11-07Fix Perl deprecation warnings.Victor van den Elzen1-1/+1
Use of defined on aggregates (hashes and arrays) is deprecated. You should instead use a simple test for size.
2009-06-28Add copyright verbiage to Perl scripts; update LICENSEH. Peter Anvin1-0/+33
This adds copyright verbiage to the Perl scripts. Scripts that are known to be clean w.r.t. the 2-clause BSD license are given that license; unclear ones are given the "LGPL for now". Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-05-27tokhash.pl: fix commentH. Peter Anvin1-1/+1
Correct filename in comment
2007-10-19Formatting: kill off "stealth whitespace"H. Peter Anvin1-18/+18
"Stealth whitespace" makes it harder to read diffs, and just generally cause unwanted weirdness. Do a source-wide pass to get rid of it.
2007-10-02Portability fixesH. Peter Anvin1-0/+1
Concentrate compiler dependencies to compiler.h; make sure compiler.h is included first in every .c file (since some prototypes may depend on the presence of feature request macros.) Actually use the conditional inclusion of various functions (totally broken in previous releases.)
2007-10-02Use the crc64 we already use as the perfect hash function prehashH. Peter Anvin1-12/+7
Use the same crc64 that we already use for the symbol table hash as the perfect hash function prehash. We appear to get radically faster convergence this way, and the crc64 is probably *faster*, since the table likely to be resident in memory.
2007-09-24Support __float*__ for floating-point numbers in expressionsH. Peter Anvin1-96/+121
Add special operators to allow the use of floating-point constants in contexts other than DW/DD/DQ/DT/DO. As part of this checkin, make MAX_KEYWORD generated by tokhash.pl, since it knows what all the keywords are so it can tell which one is the longest.
2007-09-24tokhash: allow a bit smarter pattern matchingH. Peter Anvin1-0/+12
Allow constants to match only part of the token string.
2007-09-18Slightly optimize the interface to nasm_token_hash()H. Peter Anvin1-2/+2
Instead of returning -1 from nasm_token_hash, set tv->t_type to TOKEN_ID and return TOKEN_ID, since that's what stdscan.c wants to do with it anyway. This allows us to simply tailcall nasm_token_hash().
2007-09-18Change the token prehash function for better convergenceH. Peter Anvin1-2/+2
Combining arithmetric (add) and bitwise (xor) mixing seems to give better result than either. With the new prehash function, we find a valid hash much quicker.
2007-09-12Use enumerations where practical to ease debuggingH. Peter Anvin1-3/+3
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-10tokhash: correct duplicate-token testH. Peter Anvin1-1/+1
2007-09-10tokhash: adjust table types to reduce sizeH. Peter Anvin1-7/+11
Adjust the sizes of data types to reduce the total size of the tokhash data structure.
2007-08-31phash: don't rely on the build platform Perl version of rand()H. Peter Anvin1-3/+3
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-31tokhash.pl: formatting changes for readabilityH. Peter Anvin1-44/+41
No functional change
2007-08-31tokhash: Speed up the rejection of unhashed valuesH. Peter Anvin1-2/+9
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-31tokhash.pl: "ix" should have the same width as the "hash" arraysH. Peter Anvin1-1/+3
For correctness in case of a very "linear" graph, "ix" needs to have the same width as the "hash" arrays.
2007-08-31Add "do not edit" comment to tokhash.cH. Peter Anvin1-1/+6
2007-08-31Make the token hash a bit smaller by using 16-bit hash tablesH. Peter Anvin1-2/+2
2007-08-30Finishing touches on perfect hash tokenizer; actually turn the thing onH. Peter Anvin1-5/+15
Finish the perfect hash tokenizer, and actually enable it. Move stdscan() et al to a separate file, since it's not needed in any of the clients of nasmlib other than nasm itself. Run make alldeps.
2007-08-30Generate a perfect hash for the token parserH. Peter Anvin1-0/+184