swizzle = get_swizzle_immed() # 12 bits
for (s = 0; s < SUBVL; s++)
remap = (swizzle >> 3*s) & 0b111
- if remap < 4:
- sm = id*SUBVL + remap
+ if remap == 0b000: continue # skip
+ if remap == 0b001: break # end marker
+ if remap == 0b010: ireg[rd+s] <= 0.0 # constant 0
+ elif remap == 0b011: ireg[rd+s] <= 1.0 # constant 1
+ else: # XYZW
+ sm = id*SUBVL + (remap-4)
ireg[rd+s] <= ireg[RA+sm]
- elif remap == 4:
- ireg[rd+s] <= 0.0
- elif remap == 5:
- ireg[rd+s] <= 1.0
Note that a value of 6 (and 7) will leave the target subvector element
untouched. This is equivalent to a predicate mask which is built-in,