make scalar EXTRA2 encoding match between tables and algorithms
[libreriscv.git] / openpower / sv / svp64.mdwn
index c623c123a6b544bf01c863d822d36e0bd1c3fc63..227abd8ce2abcc64368aca70f1fb25a8c98748c8 100644 (file)
@@ -1195,8 +1195,10 @@ A pseudocode algorithm explains the relationship, for INT/FP (see
 ```
     if extra3_mode:
         spec = EXTRA3
-    else:
-        spec = EXTRA2 << 1 # same as EXTRA3, shifted
+    elif EXTRA2[0]:  # vector mode, can express even registers in r0-126
+        spec = EXTRA2 << 1  # same as EXTRA3, shifted
+    else:            # scalar mode, can express registers in r0-63
+        spec = (EXTRA2[0] << 2) | EXTRA2[1]
     if spec[0]: # vector
          return (RA << 2) | spec[1:2]
     else:         # scalar