setf16

Set Flags 16-bit

SETF16 <Wn>

Sets PSTATE flags based on 16-bit operand.

Pseudocode Operation

val16 ← Wn<15:0>; N ← val16<15>; Z ← (val16 == 0); C ← 0; V ← 0;

Example

SETF16 w1

Encoding

Binary Layout
0
31
0
30
1
29
11010000
28:21
000000
20:15
1
14
0010
13:10
Rn
9:5
0
4
1101
3:0
 
Format System
Opcode 0x3A00480D
Extension FEAT_FlagM

Operands

  • Wn
    First source / base 32-bit integer register

Related

More in FEAT_FlagM

Reference

Instruction Forms

Encoding Instruction ISA Bit pattern
0x3A00480D SETF16 <Wn> A64 0 | 0 | 1 | 11010000 | 000000 | 1 | 0010 | Rn | 0 | 1101

Description

Set the PSTATE.NZV flags based on the value in the specified general-purpose register. SETF8 treats the value as an 8 bit value, and SETF16 treats the value as an 16 bit value. The PSTATE.C flag is not affected by these instructions.

Operation

bits(32) tmpreg = X[n, 32];
PSTATE.N = tmpreg<msb>;
PSTATE.Z = if (tmpreg<msb:0> == Zeros(msb + 1)) then '1' else '0';
PSTATE.V = tmpreg<msb+1> EOR tmpreg<msb>;
//PSTATE.C unchanged;