(no commit message)
[libreriscv.git] / openpower / sv / mv.swizzle.mdwn
index 1343bc0e6015ef7d10a6c58e87bc47ebdf2c0412..0566c6f2585ce32900eaf0666550110dad5fbd97 100644 (file)
@@ -1,15 +1,26 @@
+[[!tag standards]]
+
 # mv.swizzle
 
-# Format
+Links
 
-| 0..5 |6..10|11..15|16.20|21.....25|26.....30|31|  name   |
-|------|-----|------|-----|---------|---------|--|---------|
-| 19   | RT  | RA   |     | XO[0:4] | XO[5:9] |Rc| XL-Form |
-| 19   | RT  | RA   |imm  | imm     | Nn  NNN |im| mv.swiz |
+* <https://bugs.libre-soc.org/show_bug.cgi?id=139>
 
-also f.mv
+TODO: evaluate whether this will fit with [[mv.vec]]
 
-this gives an 11 bit immediate across bits 16 to 25 and bit 31.  a permutation based encoding should allow the 12 bits to be covered
+the encoding embeds predication into the swizzle as well as constants 1/1.0 and 0/0.0
+
+# Format
+
+| 0.5 |6.10|11.15|16.20|21.....25|26.....30|31|  name        |
+|-----|----|-----|-----|---------|---------|--|--------------|
+| 19  | RT | RA  |     | XO[0:4] | XO[5:9] |Rc| XL-Form      |
+| 19  | RT | RA  |imm  | imm     | 01 M im |0 | mv.vec.swiz  |
+| 19  | RT | RA  |imm  | imm     | 01 M im |1 | fmv.vec.swiz |
+| 19  | RT | RA  |imm  | imm     | 11 0 im |0 | mv.swiz      |
+| 19  | RT | RA  |imm  | imm     | 11 0 im |1 | fmv.swiz     |
+
+this gives a 12 bit immediate across bits 16 to 25 and 29-30.
 
 * 3 bits X
 * 3 bits Y
@@ -18,11 +29,14 @@ this gives an 11 bit immediate across bits 16 to 25 and bit 31.  a permutation b
 
 except that the options are:
 
-* 0b1NN index 0 thru 3 to place subelement in pos XYZW
-* 0b000 to indicate "skip"
-* 0b001 to indicate "constant 0"
-* 0b010 to indicate "constant 1" (or 1.0)
-* 0b011 is not needed.
+* 0b0NN index 0 thru 3 to place subelement in pos XYZW
+* 0b110 to indicate "skip".  this is equivalent to predicate masking
+* 0b100 to indicate "constant 0"
+* 0b101 to indicate "constant 1" (or 1.0)
+* 0b111 is not needed.
+
+Evaluating efforts to encode 12 bit swizzle into less proved unsuccessful: 7^4 comes out to 2,400 which is larger than 11 bits.
 
-this "not needed" means the encoding is actually a lot less.  the sequences involve expressing how many 0s and 1s are embedded in amongst the XYZWs which gets really interesting.
+Note that 7 options are needed (not 6) because the 7th option allows predicate masking to be encoded within the swizzle immediate.
 
+Mode M is described in [[mv.vec]] and allows for merge and split of vectors.