movn

Move Not

MOVN <Wd>, #<imm16> {, lsl #<shift>}

Moves inverted 16-bit immediate to register.

Details

Moves the bitwise NOT of a 16-bit immediate into Wd (at the position specified by shift), zeroing other 16-bit half-words. No condition flags are affected. This is an AArch64-only instruction useful for loading negative or inverted constants into registers.

Pseudocode Operation

shift_amount ← hw × 16
mask ← 0xFFFF ≪ shift_amount
Wd ← (Wd ∧ ¬mask) ∨ ((¬imm16) ≪ shift_amount)

Example

MOVN w0, #16

Encoding

Binary Layout
0
00
100101
hw
imm16
Rd
 
Format Data Processing
Opcode 0x12800000
Extension Base

Operands

  • Wd
    Destination 32-bit integer register
  • imm16
    Imm
  • shift
    Shift amount

Reference (Arm A64 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0x12800000 MOVN <Wd>, #<imm>{, LSL #<shift>} A64 0 | 00 | 100101 | hw | imm16 | Rd
0x92800000 MOVN <Xd>, #<imm>{, LSL #<shift>} A64 1 | 00 | 100101 | hw | imm16 | Rd

Description

Move wide with NOT moves the inverse of an optionally-shifted 16-bit immediate value to a register.

Operation

bits(datasize) result;

result = Zeros(datasize);

result<pos+15:pos> = imm16;
result = NOT(result);
X[d, datasize] = result;