mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-27 08:10:07 +08:00
a59795c986
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.
35 lines
622 B
Perl
Executable File
35 lines
622 B
Perl
Executable File
#!/usr/bin/perl
|
|
#
|
|
# Generate a list of rotation vectors so we always use the same set.
|
|
# This needs to be run on a platform with /dev/urandom.
|
|
#
|
|
|
|
($n) = @ARGV;
|
|
|
|
sysopen(UR, '/dev/urandom', O_RDONLY) or die;
|
|
|
|
$maxlen = 78;
|
|
|
|
print "\@random_sv_vectors = (\n";
|
|
$outl = ' ';
|
|
|
|
for ($i = 0; $i < $n; $i++) {
|
|
|
|
die if (sysread(UR, $x8, 8) != 8);
|
|
@n = unpack("V*", $x8);
|
|
|
|
$xl = sprintf(" [0x%08x, 0x%08x]%s",
|
|
$n[0], $n[1],
|
|
($i == $n-1) ? '' : ',');
|
|
if (length($outl.$xl) > $maxlen) {
|
|
print $outl, "\n";
|
|
$outl = ' ';
|
|
}
|
|
$outl .= $xl;
|
|
}
|
|
close(UR);
|
|
|
|
print $outl, "\n";
|
|
print ");\n";
|
|
print "1;\n";
|