added english language description for lwzsx instruction
[openpower-isa.git] / openpower / isa / svfixedarith.mdwn
index 0de85f2783351f6bb6e46a007c5caba77d665727..6ce79fb69925bef2faef666c0a251e860ec3e3b0 100644 (file)
@@ -1,4 +1,4 @@
-# [DRAFT] Multiply and Add Extended Doubleword
+# [DRAFT] Multiply and Add Extended Doubleword Unsigned
 
 VA-Form
 
@@ -9,10 +9,36 @@ Pseudo-code:
     <!-- SVP64: RA,RB,RC,RT have EXTRA2, RS as below
     <!-- bit 8 of EXTRA is set  : RS.[s|v]=RT.[s|v]+MAXVL
     <!-- bit 8 of EXTRA is clear: RS.[s|v]=RC.[s|v]
-    prod[0:127] <- (RA) * (RB)
-    sum[0:127] <- ([0] * 64 || (RC)) + prod
-    RT <- sum[64:127]
-    RS <- sum[0:63]
+    prod[0:2*XLEN-1] <- (RA) * (RB)
+    sum[0:2*XLEN-1] <- ([0] * XLEN || (RC)) + prod
+    RT <- sum[XLEN:2*XLEN-1]
+    RS <- sum[0:XLEN-1]
+
+Special Registers Altered:
+
+    None
+
+# [DRAFT] Multiply and Add Extended Doubleword Unsigned Signed
+
+VA-Form
+
+* maddedus RT,RA,RB,RC
+
+Pseudo-code:
+
+    <!-- SVP64: RA,RB,RC,RT have EXTRA2, RS as below
+    <!-- bit 8 of EXTRA is set  : RS.[s|v]=RT.[s|v]+MAXVL
+    <!-- bit 8 of EXTRA is clear: RS.[s|v]=RC.[s|v]
+    <!-- no MULUS, so do it manually -->
+    prod[0:XLEN*2-1] <- [0] * (XLEN * 2)
+    if (RB)[0] != 0 then
+        prod[0:XLEN*2-1] <- -((RA) * -(RB))
+    else
+        prod[0:XLEN*2-1] <- (RA) * (RB)
+    <!-- no EXTS2XL, so do it manually -->
+    sum[0:XLEN*2-1] <- prod + (EXTSXL((RC)[0], 1) || (RC))
+    RT <- sum[XLEN:2*XLEN-1]
+    RS <- sum[0:XLEN-1]
 
 Special Registers Altered:
 
@@ -44,7 +70,7 @@ Pseudo-code:
 
 Special Registers Altered:
 
-    None
+    XER.OV
 
 # [DRAFT] Double-width Shift Left Doubleword
 
@@ -57,9 +83,12 @@ Pseudo-code:
 
     n <- (RB)[58:63]
     v <- ROTL64((RA), n)
-    mask <- MASK(64, 63-n)
+    mask <- MASK(0, 63-n)
     RT <- (v[0:63] & mask) | ((RC) & ¬mask)
     RS <- v[0:63] & ¬mask
+    overflow <- 0             # relevant only when Rc=1
+    if RS != [0]*64 then
+        overflow <- 1         # relevant only when Rc=1
 
 Special Registers Altered:
 
@@ -75,10 +104,13 @@ VA2-Form
 Pseudo-code:
 
     n <- (RB)[58:63]
-    v <- ROTL128((RA) || [0]*64, 128-n)
-    mask <- ¬MASK(n, 63)
-    RT <- v[0:63] | ((RC) & mask)
-    RS <- v[64:127]
+    v <- ROTL64((RA), 64-n)
+    mask <- MASK(n, 63)
+    RT <- (v[0:63] & mask) | ((RC) & ¬mask)
+    RS <- v[0:63] & ¬mask
+    overflow <- 0             # relevant only when Rc=1
+    if RS != [0]*64 then
+        overflow <- 1         # relevant only when Rc=1
 
 Special Registers Altered: