the options for each Swizzle are:
* 0b000 to indicate "skip". this is equivalent to predicate masking
-* 0b001 is not needed (reserved)
+* 0b001 subvector length end marker (length=4 if not present)
* 0b010 to indicate "constant 0"
* 0b011 to indicate "constant 1" (or 1.0)
* 0b1NN index 0 thru 3 to copy from subelement in pos XYZW
swiz[0] = imm[0:3] # X
swiz[1] = imm[3:6] # Y
swiz[2] = imm[6:9] # Z
- swiz[3] = imm[9:12] # W, maybe
- # determine Subvector lengths
- subvl = MAX(SRC_SUBVL, SUBVL)
- if subvl == 4:
- src_subvl = 4
- else:
- src_subvl = swiz[3]
- dest_subvl = subvl
+ swiz[3] = imm[9:12] # W
+ # determine implied subvector length from Swizzle
+ dst_subvl = 4
+ for i in range(4):
+ if swiz[i] == 0b001: dst_subvl = i+1
+ # source subvector length is maximum of both RM fields
+ src_subvl = MAX(SRC_SUBVL, SUBVL)
```
What is going on here is that the option is provided to have different
source and destination subvector lengths, by exploiting redundancy in
-the Swizzle Immediate.
+the Swizzle Immediate. With the Swizzles marking what goes into
+each destination position, the marker "0b001" may be used to indicate
+the end. If no marker is present then the destination subvector length
+may be assimed to be 4.
# RM Mode Concept: