bic

SVE Bitwise Bit Clear (Predicated)

BIC <Zdn>.<T>, <Pg>/M, <Zdn>.<T>, <Zm>.<T>

Bitwise AND NOT of two vectors under predicate.

Details

Performs element-wise bitwise AND with inverted second operand (AND NOT) between two SVE vector registers under predicate control. Only elements where the corresponding predicate bit is 1 are updated; others are left unchanged. No condition flags are affected. This is an AArch64-only SVE instruction requiring SVE support.

Pseudocode Operation

for i = 0 to VL/esize-1 do
  if Pg[i] then
    Zdn[i*esize +: esize] ← Zdn[i*esize +: esize] AND NOT Zm[i*esize +: esize]
  else
    // element unchanged
endfor

Example

BIC z0.s.T, p0/m/M, z0.s.T, z2.s.T

Encoding

Binary Layout
00000100
size
011
01
1
000
Pg
Zm
Zdn
 
Format SVE Logic
Opcode 0x041B0000
Extension SVE

Operands

  • Zdn
    Combined destination/source scalable vector register (SVE)
  • Pg
    Mask
  • Zm
    Second source scalable vector register (SVE)

Reference (Arm A64 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0x2F009400 BIC <Vd>.<T>, #<imm8>{, LSL #<amount>} A64 0 | Q | 1 | 0111100000 | a | b | c | cmode | 0 | 1 | d | e | f | g | h | Rd
0x2F001400 BIC <Vd>.<T>, #<imm8>{, LSL #<amount>} A64 0 | Q | 1 | 0111100000 | a | b | c | cmode | 0 | 1 | d | e | f | g | h | Rd
0x0E601C00 BIC <Vd>.<T>, <Vn>.<T>, <Vm>.<T> A64 0 | Q | 0 | 01110 | 01 | 1 | Rm | 00011 | 1 | Rn | Rd
0x05800000 BIC <Zdn>.<T>, <Zdn>.<T>, #<const> A64 00000101 | 1 | 0 | 0000 | imm13 | Zdn
0x0A200000 BIC <Wd>, <Wn>, <Wm>{, <shift> #<amount>} A64 0 | 00 | 01010 | shift | 1 | Rm | imm6 | Rn | Rd
0x8A200000 BIC <Xd>, <Xn>, <Xm>{, <shift> #<amount>} A64 1 | 00 | 01010 | shift | 1 | Rm | imm6 | Rn | Rd
0x25004010 BIC <Pd>.B, <Pg>/Z, <Pn>.B, <Pm>.B A64 00100101 | 0 | 0 | 00 | Pm | 01 | Pg | 0 | Pn | 1 | Pd
0x041B0000 BIC <Zdn>.<T>, <Pg>/M, <Zdn>.<T>, <Zm>.<T> A64 00000100 | size | 011 | 01 | 1 | 000 | Pg | Zm | Zdn
0x04E03000 BIC <Zd>.D, <Zn>.D, <Zm>.D A64 00000100 | 1 | 1 | 1 | Zm | 001100 | Zn | Zd

Description

Bitwise AND inverted active elements of the second source vector with corresponding elements of the first source vector and destructively place the results in the corresponding elements of the first source vector. Inactive elements in the destination vector register remain unmodified.

Operation

CheckSVEEnabled();
constant integer VL = CurrentVL;
constant integer PL = VL DIV 8;
constant integer elements = VL DIV esize;
bits(PL) mask = P[g, PL];
bits(VL) operand1 = Z[dn, VL];
bits(VL) operand2 = if AnyActiveElement(mask, esize) then Z[m, VL] else Zeros(VL);
bits(VL) result;

for e = 0 to elements-1
    bits(esize) element1 = Elem[operand1, e, esize];
    bits(esize) element2 = Elem[operand2, e, esize];
    if ActivePredicateElement(mask, e, esize) then
        Elem[result, e, esize] = element1 AND (NOT element2);
    else
        Elem[result, e, esize] = Elem[operand1, e, esize];

Z[dn, VL] = result;