[RISU,v3,11/22] risugen: add dtype_msz address helper

Message ID 20180613125601.14371-12-alex.bennee@linaro.org
State Superseded
Headers show
Series
  • SVE support and various misc fixes
Related show

Commit Message

Alex Bennée June 13, 2018, 12:55 p.m.
From: Richard Henderson <richard.henderson@linaro.org>


Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
 risugen_arm.pm | 9 +++++++++
 1 file changed, 9 insertions(+)

-- 
2.17.1

Patch

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) = @_;