aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Ricardo Ziviani <joserz@linux.vnet.ibm.com>2017-05-25 16:10:22 -0300
committerPeter Maydell <peter.maydell@linaro.org>2017-05-30 15:13:20 +0100
commitea41c01ae60024a2065cd7efea81069ad0abd46f (patch)
treec4b947b9c2ee99adfc4021f7cbbd8e1ad4f503b9
parent24051817438f52ba085a2ba6d8d3d176189f6213 (diff)
downloadrisu-ea41c01ae60024a2065cd7efea81069ad0abd46f.tar.gz
risugen, risugen_ppc64.pm: Add support ppc64 (big-endian)
This commit adds an option to risugen in order to give the opportunity to generated big-endian instructions. By passing --be, users force risugen to generated big-endian instructions for ppc64. ./risugen --be --numinsns 1000 --pattern "ADD" ppc64.risu test.bin ./risugen --numinsns 1000 --pattern "ADD" ppc64.risu test.bin Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com> Message-id: 1495739423-32326-4-git-send-email-joserz@linux.vnet.ibm.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rwxr-xr-xrisugen6
-rw-r--r--risugen_ppc64.pm4
2 files changed, 9 insertions, 1 deletions
diff --git a/risugen b/risugen
index 6aad626..8b20425 100755
--- a/risugen
+++ b/risugen
@@ -264,6 +264,7 @@ Valid options:
a general set you have excluded.
--no-fp : disable floating point: no fp init, randomization etc.
Useful to test before support for FP is available.
+ --be : generate instructions in Big-Endian byte order (ppc64 only).
--help : print this message
EOT
}
@@ -274,6 +275,7 @@ sub main()
my $condprob = 0;
my $fpscr = 0;
my $fp_enabled = 1;
+ my $big_endian = 0;
my ($infile, $outfile);
GetOptions( "help" => sub { usage(); exit(0); },
@@ -287,6 +289,7 @@ sub main()
die "Value \"$condprob\" invalid for option condprob (must be between 0 and 1)\n";
}
},
+ "be" => sub { $big_endian = 1; },
"no-fp" => sub { $fp_enabled = 0; },
) or return 1;
# allow "--pattern re,re" and "--pattern re --pattern re"
@@ -317,7 +320,8 @@ sub main()
'not_pattern_re' => \@not_pattern_re,
'details' => \%insn_details,
'arch' => $full_arch[0],
- 'subarch' => $full_arch[1] || ''
+ 'subarch' => $full_arch[1] || '',
+ 'bigendian' => $big_endian
);
write_test_code(\%params);
diff --git a/risugen_ppc64.pm b/risugen_ppc64.pm
index 1a3cd59..c0e71cf 100644
--- a/risugen_ppc64.pm
+++ b/risugen_ppc64.pm
@@ -375,6 +375,10 @@ sub write_test_code($)
my @not_pattern_re = @{ $params->{ 'not_pattern_re' } };
my %insn_details = %{ $params->{ 'details' } };
+ if ($params->{ 'bigendian' } eq 1) {
+ set_endian(1);
+ }
+
open_bin($outfile);
# convert from probability that insn will be conditional to