X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=opcode.pl;h=22bffb82168aaa3308550df42198c5ae8172cc31;hb=3332b3c19f862e846dac4c8041a3c82ef7dd289e;hp=eb64e8dc14efa8279733a6bebbad8e26494b9a1b;hpb=ee8c7f5465f003860e2347a2946abacac39bd9b9;p=p5sagit%2Fp5-mst-13.2.git diff --git a/opcode.pl b/opcode.pl index eb64e8d..22bffb8 100755 --- a/opcode.pl +++ b/opcode.pl @@ -1,5 +1,6 @@ #!/usr/bin/perl +chmod 0666, "opcode.h", "opnames.h"; unlink "opcode.h", "opnames.h"; open(OC, ">opcode.h") || die "Can't create opcode.h: $!\n"; open(ON, ">opnames.h") || die "Can't create opnames.h: $!\n"; @@ -56,7 +57,9 @@ for (@ops) { } print ON "\t", &tab(3,"OP_max"), "\n"; print ON "} opcode;\n"; -print ON "\n#define MAXO ", scalar @ops, "\n\n"; +print ON "\n#define MAXO ", scalar @ops, "\n"; +print ON "#define OP_phoney_INPUT_ONLY -1\n"; +print ON "#define OP_phoney_OUTPUT_ONLY -2\n\n"; # Emit op names and descriptions. @@ -193,6 +196,9 @@ END '}', 13, # loopexop ); +my %OP_IS_SOCKET; +my %OP_IS_FILETEST; + for (@ops) { $argsum = 0; $flags = $flags{$_}; @@ -210,7 +216,12 @@ for (@ops) { $argsum |= $opclass{$1} << 9; $mul = 0x2000; # 2 ^ OASHIFT for $arg (split(' ',$args{$_})) { + if ($arg =~ /^F/) { + $OP_IS_SOCKET{$_} = 1 if $arg =~ s/s//; + $OP_IS_FILETEST{$_} = 1 if $arg =~ s/-//; + } $argnum = ($arg =~ s/\?//) ? 8 : 0; + die "op = $_, arg = $arg\n" unless length($arg) == 1; $argnum += $argnum{$arg}; warn "# Conflicting bit 32 for '$_'.\n" if $argnum & 8 and $mul == 0x10000000; @@ -228,6 +239,20 @@ print <