# Copyright 2000, 2001, 2003-2005, 2011 Free Software Foundation, Inc. # # This file is part of the GNU MP Library. # # The GNU MP Library is free software; you can redistribute it and/or modify # it under the terms of either: # # * the GNU Lesser General Public License as published by the Free # Software Foundation; either version 3 of the License, or (at your # option) any later version. # # or # # * the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any # later version. # # or both in parallel, as here. # # The GNU MP Library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received copies of the GNU General Public License and the # GNU Lesser General Public License along with the GNU MP Library. If not, # see https://www.gnu.org/licenses/.
# Usage: slot.pl [filename.o]... # # Run "objdump" to produce a disassembly of the given object file(s) and # annotate the output with "U" or "L" slotting which Alpha EV6 will use. # # When an instruction is E (ie. either U or L), an "eU" or "eL" is shown, as # a reminder that it wasn't a fixed requirement that gave the U or L, but # the octaword slotting rules. # # If an instruction is not recognised, that octaword does not get any U/L # shown, only lower-case "u", "l" or "e" for the instructions which are # known. Add any unknown instructions to %optable below.
# Check all combinations of U/L/E are present in %slottable.
sub coverage { foreach my $a ('U', 'L', 'E') { foreach my $b ('U', 'L', 'E') { foreach my $c ('U', 'L', 'E') { foreach my $d ('U', 'L', 'E') {
my $x = $a . $b . $c . $d; if (! defined $slottable{$x}) {
print "slottable missing: $x\n"
}
}
}
}
}
}
# Certain consistency checks for %slottable.
sub check { foreach my $x (keys %slottable) {
my $a = substr($x,0,1);
my $b = substr($x,1,1);
my $c = substr($x,2,1);
my $d = substr($x,3,1);
my $es = ($a eq 'E') + ($b eq 'E') + ($c eq 'E') + ($d eq 'E');
my $ls = ($a eq 'L') + ($b eq 'L') + ($c eq 'L') + ($d eq 'L');
my $us = ($a eq 'U') + ($b eq 'U') + ($c eq 'U') + ($d eq 'U');
my $got = $slottable{$x};
my $want = $x;
if ($es == 0) {
} elsif ($es == 1) { # when only one E, it's mapped to whichever of U or L is otherwise # used the least if ($ls > $us) {
$want =~ s/E/U/;
} else {
$want =~ s/E/L/;
}
} elsif ($es == 2) { # when two E's and two U, then the E's map to L; vice versa for two E # and two L if ($ls == 2) {
$want =~ s/E/U/g;
} elsif ($us == 2) {
$want =~ s/E/L/g;
} else {
next;
}
} elsif ($es == 3) {
next;
} else { # $es == 4
next;
}
if ($want ne $got) {
print "slottable $x want $want got $got\n";
}
}
}
sub disassemble {
my ($file) = @_;
open (IN, "objdump -Srfh $file |") || die "Cannot open pipe from objdump\n";
my (%pre, %post, %type); while (<IN>) {
my $line = $_ . "";
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.