summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2016-01-29 12:05:27 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2016-01-29 12:05:27 -0800
commit5a8c424d0c4b63d14eb1120475ebc3dee38bac8c (patch)
tree6757ab08e84c82fecc93c80f8431be4c546ceaf5
parent02237cbfe8056e48355f97f847ab4b063ffe0b7f (diff)
downloadnasm-5a8c424d0c4b63d14eb1120475ebc3dee38bac8c.tar.gz
Use a more optimal value for the UNUSED slot
Instead of ~1/4 the range we can use ~1/3 the range for better distance. It is possible that using ~1/2 - 1 might be even better, but this is a trivial tweak. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rwxr-xr-xdirectiv.pl2
-rwxr-xr-xmacros.pl2
-rwxr-xr-xpptok.pl2
-rwxr-xr-xtokhash.pl2
4 files changed, 4 insertions, 4 deletions
diff --git a/directiv.pl b/directiv.pl
index 51d0ec38..b567aff9 100755
--- a/directiv.pl
+++ b/directiv.pl
@@ -143,7 +143,7 @@ if ($output eq 'h') {
# Put a large value in unused slots. This makes it extremely unlikely
# that any combination that involves unused slot will pass the range test.
# This speeds up rejection of unrecognized tokens, i.e. identifiers.
- print C "#define UNUSED 16383\n";
+ print C "#define UNUSED (65535/3)\n";
print C " static const int16_t hash1[$n] = {\n";
for ($i = 0; $i < $n; $i++) {
diff --git a/macros.pl b/macros.pl
index e64fead9..67aa08cb 100755
--- a/macros.pl
+++ b/macros.pl
@@ -225,7 +225,7 @@ print OUT " };\n";
# Put a large value in unused slots. This makes it extremely unlikely
# that any combination that involves unused slot will pass the range test.
# This speeds up rejection of unrecognized tokens, i.e. identifiers.
-print OUT "#define UNUSED 16383\n";
+print OUT "#define UNUSED (65535/3)\n";
print OUT " static const int16_t hash1[$n] = {\n";
for ($i = 0; $i < $n; $i++) {
diff --git a/pptok.pl b/pptok.pl
index 1ea2e7e5..2dbf0fe6 100755
--- a/pptok.pl
+++ b/pptok.pl
@@ -207,7 +207,7 @@ if ($what eq 'c') {
# Put a large value in unused slots. This makes it extremely unlikely
# that any combination that involves unused slot will pass the range test.
# This speeds up rejection of unrecognized tokens, i.e. identifiers.
- print OUT "#define UNUSED 16383\n";
+ print OUT "#define UNUSED (65535/3)\n";
print OUT " static const int16_t hash1[$n] = {\n";
for ($i = 0; $i < $n; $i++) {
diff --git a/tokhash.pl b/tokhash.pl
index 509520bb..07bc6abe 100755
--- a/tokhash.pl
+++ b/tokhash.pl
@@ -232,7 +232,7 @@ if ($output eq 'h') {
# Put a large value in unused slots. This makes it extremely unlikely
# that any combination that involves unused slot will pass the range test.
# This speeds up rejection of unrecognized tokens, i.e. identifiers.
- print "#define UNUSED 16383\n";
+ print "#define UNUSED (65535/3)\n";
print " static const int16_t hash1[$n] = {\n";
for ($i = 0; $i < $n; $i++) {