setf8

Set Flags 8-bit

SETF8 <Wn>

Sets PSTATE flags based on 8-bit operand.

Pseudocode Operation

val8 ← Wn<7:0>; N ← val8<7>; Z ← (val8 == 0); C ← 0; V ← 0;

Example

SETF8 w1

Encoding

Binary Layout
0
31
0
30
1
29
11010000
28:21
000000
20:15
0
14
0010
13:10
Rn
9:5
0
4
1101
3:0
 
Format System
Opcode 0x3A00080D
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
0x3A00080D SETF8 <Wn> A64 0 | 0 | 1 | 11010000 | 000000 | 0 | 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;