bdep

Bit Deposit (SVE2)

BDEP <Zd>.<T>, <Zn>.<T>, <Zm>.<T>

Deposits bits from source to destination based on a mask (Scatter bits).

Pseudocode Operation

No pseudocode available.

Encoding

Binary Layout
01000101
31:24
size
23:22
0
21
Zm
20:16
1011
15:12
0
11
1
10
Zn
9:5
Zd
4:0
 
Format SVE2 Bitwise
Opcode 0x4500B400
Extension SVE2

Related

More in SVE2

Reference

Instruction Forms

Encoding Instruction ISA Bit pattern
0x4500B400 BDEP <Zd>.<T>, <Zn>.<T>, <Zm>.<T> A64 01000101 | size | 0 | Zm | 1011 | 0 | 1 | Zn | Zd

Description

This instruction scatters the lowest-numbered contiguous bits within each element of the first source vector to the bit positions indicated by non-zero bits in the corresponding mask element of the second source vector, preserving their order, and set the bits corresponding to a zero mask bit to zero. This instruction is unpredicated. ID_AA64ZFR0_EL1.BitPerm indicates whether this instruction is implemented. This instruction is illegal when executed in Streaming SVE mode, unless FEAT_SME_FA64 is implemented and enabled.

Operation

CheckNonStreamingSVEEnabled();
constant integer VL = CurrentVL;
constant integer elements = VL DIV esize;
bits(VL) data = Z[n, VL];
bits(VL) mask = Z[m, VL];
bits(VL) result;

for e = 0 to elements - 1
    Elem[result, e, esize] = BitDeposit(Elem[data, e, esize], Elem[mask, e, esize]);

Z[d, VL] = result;