target/arm: migrate wfx syndromes to registerfields
This will help later when we expand the fields we report. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 20260422125250.1303100-13-alex.bennee@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Alex Bennée committed
Apr 22, 2026 at 13:52 UTC
9a90209cb089f0894fb65dbfe781760f49253ee4
1 file changed
+17
-3
target/arm/syndrome.h
+17
-3
@@ -655,11 +655,25 @@ static inline uint32_t syn_breakpoint(int same_el)
655
return res;
656
}
657
658
+/*
659
+ * ISS encoding for an exception from a WF* instruction
660
+ */
661
+FIELD(WFX_ISS, TI, 0, 2)
662
+FIELD(WFX_ISS, RV, 2, 1)
663
+FIELD(WFX_ISS, RN, 5, 5)
664
+FIELD(WFX_ISS, COND, 20, 4)
665
+FIELD(WFX_ISS, CV, 24, 1)
666
+
667
static inline uint32_t syn_wfx(int cv, int cond, int ti, bool is_16bit)
668
{
660
- return (EC_WFX_TRAP << ARM_EL_EC_SHIFT) |
661
- (is_16bit ? 0 : (1 << ARM_EL_IL_SHIFT)) |
662
- (cv << 24) | (cond << 20) | ti;
669
+ uint32_t res = syn_set_ec(0, EC_WFX_TRAP);
670
+ res = FIELD_DP32(res, SYNDROME, IL, !is_16bit);
671
+
672
+ res = FIELD_DP32(res, WFX_ISS, CV, cv);
673
+ res = FIELD_DP32(res, WFX_ISS, COND, cond);
674
+ res = FIELD_DP32(res, WFX_ISS, TI, ti);
675
+
676
+ return res;
677
}
678
679
static inline uint32_t syn_illegalstate(void)