(no commit message)
[libreriscv.git] / 3d_gpu / architecture / dynamic_simd / assign.mdwn
index df5b08c0c759106c271372e293a31fad82e85419..a8c43e4505370e51e70e2fafd539be8c69e149e3 100644 (file)
@@ -74,3 +74,30 @@ the whole of the target are copied.  In this example, B is 8 bits so only
 When the partitions are all closed (4x SIMD) each partition of B is
 2 bits wide, therefore only the *first two* bits of A are copied into
 *each* of the four 2-bit partitions in B.
+
+For the case where A is shorter than B output, sign or zero
+extension is required. Here we assume A is 8 bits, B is 16.
+This is similar to the parallel case except A is repeated
+(broadcast) across all of B.
+
+
+| partition | o3         | o2         | o1         | o0         |
+| --------- | --         | --         | --         | --         |
+| 000       | [A7A7A7A7] | [A7A7A7A7] | A7A6A5A4   | A3A2A1A0   |
+| 001       | [A7A7A7A7] | A7A6A5A4   | A3A2A1A0   | A3A2A1A0   |
+| 010       | A7A6A5A4   | A3A2A1A0   | A7A6A5A4   | A3A2A1A0   |
+| 011       | A7A6A5A4   | A3A2A1A0   | A3A2A1A0   | A3A2A1A0   |
+| 100       | A3A2A1A0   | [A7A7A7A7] | A7A6A5A4   | A3A2A1A0   |
+| 101       | A3A2A1A0   | A7A6A5A4   | A3A2A1A0   | A3A2A1A0   |
+| 110       | A3A2A1A0   | A3A2A1A0   | A7A6A5A4   | A3A2A1A0   |
+| 111       | A3A2A1A0   | A3A2A1A0   | A3A2A1A0v  | A3A2A1A0   |
+
+Note how when the entire partition set is open (1x 16-bit output)
+that all of A is copied out, and either zero or sign extended
+in the top half of the output.  At the other extreme is the
+4x 4-bit output partitions, which have four copies of A, truncated
+from the first 4 bits of A.
+
+Unlike the parallel case, A is not itself partitioned, so is copied
+over as much as is possible.  In some cases such as `1x 4-bit, 1x 12-bit`
+(partition mask = `0b100`, above) the 8-bit scalar source will need sign or zero extending.