regs.pl: add comments to regflags.c and regvals.c

Add comments to regflags.c and regvals.c, to make it easier to spot
errors.
This commit is contained in:
H. Peter Anvin 2008-05-26 19:32:52 -07:00
parent 4c2529dd77
commit bb4aad4a1f

15
regs.pl
View File

@ -116,21 +116,24 @@ if ( $fmt eq 'h' ) {
print "#include \"tables.h\"\n";
print "#include \"nasm.h\"\n\n";
print "const int32_t nasm_reg_flags[] = {\n";
print " 0"; # Dummy entry for 0
printf " 0,\n"; # Dummy entry for 0
foreach $reg ( sort(keys(%regs)) ) {
print ",\n ", $regs{$reg}; # Print the class of the register
# Print the class of the register
printf " %-15s /* %-5s */\n",
$regs{$reg}.',', $reg;
}
print "\n};\n";
print "};\n";
} elsif ( $fmt eq 'vc' ) {
# Output regvals.c
print "/* automatically generated from $file - do not edit */\n\n";
print "#include \"tables.h\"\n\n";
print "const int nasm_regvals[] = {\n";
print " -1"; # Dummy entry for 0
print " -1,\n"; # Dummy entry for 0
foreach $reg ( sort(keys(%regs)) ) {
printf ",\n %2d", $regvals{$reg}; # Print the regval of the register
# Print the x86 value of the register
printf " %2d, /* %-5s */\n", $regvals{$reg}, $reg;
}
print "\n};\n";
print "};\n";
} elsif ( $fmt eq 'dc' ) {
# Output regdis.c
print "/* automatically generated from $file - do not edit */\n\n";