nasm/misc/fmtinsns.pl
H. Peter Anvin 1e5203872d insns.dat: make even wider to make space for AVX
The AVX instructions take more space, so add a few tab stops across
the entire file.
2008-05-20 11:04:26 -07:00

32 lines
569 B
Perl
Executable File

#!/usr/bin/perl
#
# Re-align the columns in insns.dat
#
@cols = (0, 16, 48, 96);
while ($line = <STDIN>) {
chomp $line;
if ($line !~ /^\s*(\;.*|)$/) {
($ln = $line) =~ s/\s+$//;
@fields = split(/\s+/, $line);
if (scalar(@fields) == 4) {
$c = 0;
$line = '';
for ($i = 0; $i < scalar(@fields); $i++) {
if ($i > 0 && $c >= $cols[$i]) {
$line .= ' ';
$c++;
}
while ($c < $cols[$i]) {
$line .= "\t";
$c = ($c+8) & ~7;
}
$line .= $fields[$i];
$c += length($fields[$i]);
}
}
}
print $line, "\n";
}