diff options
author | Keith Kanios <spook@dynatos.net> | 2007-04-12 02:40:54 +0000 |
---|---|---|
committer | Keith Kanios <spook@dynatos.net> | 2007-04-12 02:40:54 +0000 |
commit | b7a89544d09455d7b2f4621c80b21ca457563f4a (patch) | |
tree | 6c89a3318c19c2bf364cbd95859e78fbc2d4e306 /regs.pl | |
parent | aa348dec7d6c5366efd10513ae4ff6fa2bbbd6ed (diff) | |
download | nasm-b7a89544d09455d7b2f4621c80b21ca457563f4a.tar.gz nasm-b7a89544d09455d7b2f4621c80b21ca457563f4a.tar.bz2 nasm-b7a89544d09455d7b2f4621c80b21ca457563f4a.zip |
General push for x86-64 support, dubbed 0.99.00.
Diffstat (limited to 'regs.pl')
-rwxr-xr-x | regs.pl | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -10,7 +10,7 @@ sub process_line($) { my($line) = @_; my @v; - if ( $line !~ /^\s*(\S+)\s*(\S+)\s*(\S+)\s*([0-7])\s*$/ ) { + if ( $line !~ /^\s*(\S+)\s*(\S+)\s*(\S+)\s*([0-9]+)\s*$/ ) { die "regs.dat:$nline: invalid input\n"; } $reg = $1; @@ -63,11 +63,15 @@ if ( $fmt eq 'h' ) { $attach = ''; $ch = ','; } print " REG_ENUM_LIMIT\n"; - print "};\n"; + print "};\n\n"; + foreach $reg ( sort(keys(%regs)) ) { + print "#define REG_NUM_\U${reg} $regvals{$reg}\n"; + } + print "\n"; } elsif ( $fmt eq 'c' ) { # Output regs.c print "/* automatically generated from $file - do not edit */\n"; - print "static const char *reg_names[] = "; $ch = '{'; + print "static const int8_t *reg_names[] = "; $ch = '{'; # This one has no dummy entry for 0 foreach $reg ( sort(keys(%regs)) ) { print "$ch\n \"${reg}\""; @@ -77,7 +81,7 @@ if ( $fmt eq 'h' ) { } elsif ( $fmt eq 'fc' ) { # Output regflags.c print "/* automatically generated from $file - do not edit */\n"; - print "static const long reg_flags[] = {\n"; + print "static const int32_t reg_flags[] = {\n"; print " 0"; # Dummy entry for 0 foreach $reg ( sort(keys(%regs)) ) { print ",\n ", $regs{$reg}; # Print the class of the register |