|
From: <sv...@va...> - 2012-12-07 04:38:05
|
florian 2012-12-07 04:37:53 +0000 (Fri, 07 Dec 2012)
New Revision: 13168
Log:
Identify opcodes that are not handled by the decoder in
guest_s390_toIR.c
Identify a few more duplicate mnemonics to avoid false messages
from the checker.
Modified files:
trunk/auxprogs/s390-check-opcodes.pl
Modified: trunk/auxprogs/s390-check-opcodes.pl (+77 -0)
===================================================================
--- trunk/auxprogs/s390-check-opcodes.pl 2012-12-06 23:11:19 +00:00 (rev 13167)
+++ trunk/auxprogs/s390-check-opcodes.pl 2012-12-07 04:37:53 +00:00 (rev 13168)
@@ -26,6 +26,7 @@
my %csv_desc = ();
my %csv_implemented = ();
my %toir_implemented = ();
+my %toir_decoded = ();
#----------------------------------------------------
@@ -60,6 +61,33 @@
next if ($mnemonic eq "cuutf"); # alternate mnemonic for cu21
next if ($mnemonic eq "cutfu"); # alternate mnemonic for cu12
+ next if ($mnemonic eq "cfdbra"); # indistinguishable from cfdbr
+ next if ($mnemonic eq "cfebra"); # indistinguishable from cfebr
+ next if ($mnemonic eq "cfxbra"); # indistinguishable from cfxbr
+ next if ($mnemonic eq "cgdbra"); # indistinguishable from cgdbr
+ next if ($mnemonic eq "cgebra"); # indistinguishable from cgebr
+ next if ($mnemonic eq "cgxbra"); # indistinguishable from cgxbr
+ next if ($mnemonic eq "cdfbra"); # indistinguishable from cdfbr
+ next if ($mnemonic eq "cefbra"); # indistinguishable from cefbr
+ next if ($mnemonic eq "cxfbra"); # indistinguishable from cxfbr
+ next if ($mnemonic eq "cdgbra"); # indistinguishable from cdgbr
+ next if ($mnemonic eq "cegbra"); # indistinguishable from cegbr
+ next if ($mnemonic eq "cxgbra"); # indistinguishable from cxgbr
+ next if ($mnemonic eq "ldxbra"); # indistinguishable from ldxbr
+ next if ($mnemonic eq "lexbra"); # indistinguishable from lexbr
+ next if ($mnemonic eq "ledbra"); # indistinguishable from ledbr
+ next if ($mnemonic eq "cdgtra"); # indistinguishable from cdgtr
+ next if ($mnemonic eq "cxgtra"); # indistinguishable from cxgtr
+ next if ($mnemonic eq "cgdtra"); # indistinguishable from cgdtr
+ next if ($mnemonic eq "cgxtra"); # indistinguishable from cgxtr
+ next if ($mnemonic eq "fidbra"); # indistinguishable from fidbr
+ next if ($mnemonic eq "fiebra"); # indistinguishable from fiebr
+ next if ($mnemonic eq "fixbra"); # indistinguishable from fixbr
+ next if ($mnemonic eq "adtr"); # indistinguishable from adtra
+ next if ($mnemonic eq "sdtr"); # indistinguishable from sdtra
+ next if ($mnemonic eq "ddtr"); # indistinguishable from ddtra
+ next if ($mnemonic eq "mdtr"); # indistinguishable from mdtra
+
$description =~ s/^[\s]+//g; # remove leading blanks
$description =~ s/[\s]+$//g; # remove trailing blanks
$description =~ s/[ ][ ]+/ /g; # replace multiple blanks with a single one
@@ -95,6 +123,34 @@
$mnemonic =~ s/"//g;
$description =~ s/"//g;
+ next if ($mnemonic eq "cfdbra"); # indistinguishable from cfdbr
+ next if ($mnemonic eq "cfebra"); # indistinguishable from cfebr
+ next if ($mnemonic eq "cfxbra"); # indistinguishable from cfxbr
+ next if ($mnemonic eq "cgdbra"); # indistinguishable from cgdbr
+ next if ($mnemonic eq "cgebra"); # indistinguishable from cgebr
+ next if ($mnemonic eq "cgxbra"); # indistinguishable from cgxbr
+ next if ($mnemonic eq "cdfbra"); # indistinguishable from cdfbr
+ next if ($mnemonic eq "cefbra"); # indistinguishable from cefbr
+ next if ($mnemonic eq "cxfbra"); # indistinguishable from cxfbr
+ next if ($mnemonic eq "cegbra"); # indistinguishable from cegbr
+ next if ($mnemonic eq "cdgbra"); # indistinguishable from cdgbr
+ next if ($mnemonic eq "cegbra"); # indistinguishable from cegbr
+ next if ($mnemonic eq "cxgbra"); # indistinguishable from cxgbr
+ next if ($mnemonic eq "ldxbra"); # indistinguishable from ldxbr
+ next if ($mnemonic eq "lexbra"); # indistinguishable from lexbr
+ next if ($mnemonic eq "ledbra"); # indistinguishable from ledbr
+ next if ($mnemonic eq "cdgtra"); # indistinguishable from cdgtr
+ next if ($mnemonic eq "cxgtra"); # indistinguishable from cxgtr
+ next if ($mnemonic eq "cgdtra"); # indistinguishable from cgdtr
+ next if ($mnemonic eq "cgxtra"); # indistinguishable from cgxtr
+ next if ($mnemonic eq "fidbra"); # indistinguishable from fidbr
+ next if ($mnemonic eq "fiebra"); # indistinguishable from fiebr
+ next if ($mnemonic eq "fixbra"); # indistinguishable from fixbr
+ next if ($mnemonic eq "adtr"); # indistinguishable from adtra
+ next if ($mnemonic eq "sdtr"); # indistinguishable from sdtra
+ next if ($mnemonic eq "ddtr"); # indistinguishable from ddtra
+ next if ($mnemonic eq "mdtr"); # indistinguishable from mdtra
+
# Complain about duplicate entries. We don't want them.
if ($csv_desc{$mnemonic}) {
print "$mnemonic: duplicate entry\n";
@@ -119,6 +175,15 @@
open(TOIR, "$toir_file") || die "cannot open $toir_file\n";
while (my $line = <TOIR>) {
chomp $line;
+ if ($line =~ /goto\s+unimplemented/) {
+ # Assume this is in the decoder
+ if ($line =~ /\/\*\s([A-Z][A-Z0-9]+)\s\*\//) {
+ my $mnemonic = $1;
+ $mnemonic =~ tr/A-Z/a-z/;
+ $toir_decoded{$mnemonic} = 1;
+# print "DECODED: $mnemonic\n";
+ }
+ }
next if (! ($line =~ /^s390_irgen_[A-Z]/));
$line =~ /^s390_irgen_([A-Z][A-Z0-9]*)/;
my $op = $1;
@@ -169,5 +234,17 @@
}
}
+#----------------------------------------------------
+# 4) Make sure all opcodes are handled by the decoder
+#----------------------------------------------------
+
+# We only have to check those for which we don't generate IR.
+
+foreach my $opc (keys %opc_desc) {
+ if (! $toir_implemented{$opc} && ! $toir_decoded{$opc}) {
+ print "*** opcode $opc is not handled by the decoder\n";
+ }
+}
+
print "there are " . int(keys %toir_implemented) . " implemented opcodes\n";
exit 0
|