wrffr

WRFFR <Pn>.B

Write First-Fault Register.

Pseudocode Operation

No pseudocode available.

Encoding

Binary Layout
00
31:30
100101
29:24
0
23
0
22
10
21:20
1000100100
19:10
0
9
Pn
8:5
0
4
0
3
0
2
00
1:0
 
Format SVE
Opcode 0x25289000
Extension SVE

Related

More in SVE

Reference

Instruction Forms

Encoding Instruction ISA Bit pattern
0x25289000 WRFFR <Pn>.B A64 00 | 100101 | 0 | 0 | 10 | 1000100100 | 0 | Pn | 0 | 0 | 0 | 00

Description

Read the source predicate register and place in the first-fault register (FFR). This instruction is intended to restore a saved FFR and is not recommended for general use by applications. This instruction requires that the source predicate contains a monotonic predicate value, in which starting from bit 0 there are zero or more 1 bits, followed only by 0 bits in any remaining bit positions. If the source is not a monotonic predicate value, then the resulting value in the FFR will be UNPREDICTABLE. It is not possible to generate a non-monotonic value in FFR when using SETFFR followed by first-fault or non-fault loads. This instruction is illegal when executed in Streaming SVE mode, unless FEAT_SME_FA64 is implemented and enabled.

Operation

CheckNonStreamingSVEEnabled();
constant integer VL = CurrentVL;
constant integer PL = VL DIV 8;
bits(PL) operand = P[n, PL];

constant integer hsb = HighestSetBit(operand);
if hsb < 0 || IsOnes(operand<hsb:0>) then
    FFR[PL] = operand;
else // not a monotonic predicate
    FFR[PL] = bits(PL) UNKNOWN;