vbpermq
Vector Bit Permute Quadword
vbpermq VRT,VRA,VRB
Performs a bit permutation on two vector registers and stores the result in another vector register.
Details
The vbpermq instruction permutes bits from two source vector registers (VRA and VRB) based on the index values provided in VRB and stores the result in VRT. If an index value is less than 128, it selects the corresponding bit from VRA; otherwise, it sets the bit to 0.
Pseudocode Operation
Programming Note
The fact that the permuted bit is 0 if the corresponding index value exceeds 127 permits the permuted bits to be selected from a 256-bit quantity, using a single index register.
Example
vbpermq v1, v2, v3
Encoding
Binary Layout
1001
0
VRT
6
VRA
11
VRB
16
10000000000000000000000000000000
21
Operands
-
VRT
Target Vector Register -
VRA
Source Vector Register -
VRB
Index Source Vector Register