clarify bitwidth
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 17 Oct 2018 12:10:39 +0000 (13:10 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 17 Oct 2018 12:10:39 +0000 (13:10 +0100)
simple_v_extension/specification.mdwn

index ec17b082a2b29161d105b31e732c81d6454b0ee9..fa8eb6b8580dd5483070ce5c6a4b2464d3ad5c21 100644 (file)
@@ -1243,9 +1243,19 @@ rd bitwidths).  The pseudo-code is therefore as follows:
         uint64_t l;
     } el_reg_t;
 
+    bw(elwidth):
+        if elwidth == 0:
+            return xlen
+        if elwidth == 1:
+            return xlen / 2
+        if elwidth == 2:
+            return xlen * 2
+        // elwidth == 3:
+        return 8
+
     get_max_elwidth(rs1, rs2):
-        return max(int_csr[rs1].elwidth, # default (XLEN) if not set
-                   int_csr[rs2].elwidth) # again XLEN if no entry
+        return max(bw(int_csr[rs1].elwidth), # default (XLEN) if not set
+                   bw(int_csr[rs2].elwidth)) # again XLEN if no entry
 
     get_polymorphed_reg(reg, bitwidth, offset):
         el_reg_t res;