aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2018-06-22 15:11:54 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-07-02 13:08:21 +0100
commitdf7d096af7108df4d81199c14cfdd403cbd7d3f2 (patch)
tree24fa335c2d4101b98adcf0e26f958194a2545ae9
parent14055ad0e5908cd4aec1e745c92b916afd0f08d3 (diff)
risugen: add dtype_msz address helper
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 20180622141205.16306-12-alex.bennee@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--risugen_arm.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/risugen_arm.pm b/risugen_arm.pm
index 696bf5f..8d423b1 100644
--- a/risugen_arm.pm
+++ b/risugen_arm.pm
@@ -765,6 +765,15 @@ sub write_get_offset()
write_risuop($OP_GETMEMBLOCK);
}
+# Return the log2 of the memory size of an operation described by dtype.
+sub dtype_msz($)
+{
+ my ($dtype) = @_;
+ my $dth = $dtype >> 2;
+ my $dtl = $dtype & 3;
+ return $dtl >= $dth ? $dth : 3 - $dth;
+}
+
sub reg($@)
{
my ($base, @trashed) = @_;