VTILVTIL

Bitwise Operations

Bitwise instructions operate on individual bits of register values.

AND

InstructionOperand 1Operand 2Operation
ANDRegReg/ImmOP1 &= OP2

OR

InstructionOperand 1Operand 2Operation
ORRegReg/ImmOP1 |= OP2

XOR

InstructionOperand 1Operand 2Operation
XORRegReg/ImmOP1 ^= OP2

NOT

InstructionOperand 1Operation
NOTRegOP1 = ~OP1

SHL

InstructionOperand 1Operand 2Operation
SHLRegReg/ImmOP1 <<= OP2

SHR

InstructionOperand 1Operand 2Operation
SHRRegReg/ImmOP1 >>= OP2

ROL

Rotate left - bits shifted out from the left wrap around to the right.

InstructionOperand 1Operand 2Operation
ROLRegReg/ImmOP1 = (OP1 << OP2) | (OP1 >> (N-OP2))

ROR

Rotate right - bits shifted out from the right wrap around to the left.

InstructionOperand 1Operand 2Operation
RORRegReg/ImmOP1 = (OP1 >> OP2) | (OP1 << (N-OP2))

POPCNT

Counts the number of set bits (1s) in a register and stores the result back.

InstructionOperand 1Operation
POPCNTRegOP1 = popcnt(OP1)

BSF

Bit scan forward - returns the index of the lowest set bit plus one, or zero if the operand is zero.

InstructionOperand 1Operation
BSFRegOP1 = OP1 ? BitScanForward(OP1) + 1 : 0

BSR

Bit scan reverse - returns the index of the highest set bit plus one, or zero if the operand is zero.

InstructionOperand 1Operation
BSRRegOP1 = OP1 ? BitScanReverse(OP1) + 1 : 0