Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
target/arm/syndrome.h | 33 +++++++++++++++++++++++++++++----
1 file changed, 29 insertions(+), 4 deletions(-)
diff --git a/target/arm/syndrome.h b/target/arm/syndrome.h
index 76f66b3beef..2e3121aec9c 100644
--- a/target/arm/syndrome.h
+++ b/target/arm/syndrome.h
@@ -743,14 +743,39 @@ static inline uint32_t syn_serror(uint32_t extra)
return res;
}
+/*
+ * ISS encoding for an exception from the Memory Copy and Memory Set
+ * instructions.
+ */
+FIELD(MOP_ISS, SIZEREG, 0, 5)
+FIELD(MOP_ISS, SRCREG, 5, 5)
+FIELD(MOP_ISS, DESTREG, 10, 5)
+FIELD(MOP_ISS, FORMATOPT, 16, 2)
+FIELD(MOP_ISS, OPT_A, 16, 1)
+FIELD(MOP_ISS, WRONG_OPT, 17, 1)
+FIELD(MOP_ISS, EPILOGUE, 18, 1)
+FIELD(MOP_ISS, OPTIONS, 19, 4)
+FIELD(MOP_ISS, IS_SETG, 23, 1)
+FIELD(MOP_ISS, MEMINST, 24, 1)
+
static inline uint32_t syn_mop(bool is_set, bool is_setg, int options,
bool epilogue, bool wrong_option, bool option_a,
int destreg, int srcreg, int sizereg)
{
- return (EC_MOP << ARM_EL_EC_SHIFT) | ARM_EL_IL |
- (is_set << 24) | (is_setg << 23) | (options << 19) |
- (epilogue << 18) | (wrong_option << 17) | (option_a << 16) |
- (destreg << 10) | (srcreg << 5) | sizereg;
+ uint32_t res = syn_set_ec(0, EC_MOP);
+ res = FIELD_DP32(res, SYNDROME, IL, 1);
+
+ res = FIELD_DP32(res, MOP_ISS, MEMINST, is_set);
+ res = FIELD_DP32(res, MOP_ISS, IS_SETG, is_setg);
+ res = FIELD_DP32(res, MOP_ISS, OPTIONS, options);
+ res = FIELD_DP32(res, MOP_ISS, EPILOGUE, epilogue);
+ res = FIELD_DP32(res, MOP_ISS, WRONG_OPT, wrong_option);
+ res = FIELD_DP32(res, MOP_ISS, OPT_A, option_a);
+ res = FIELD_DP32(res, MOP_ISS, DESTREG, destreg);
+ res = FIELD_DP32(res, MOP_ISS, SRCREG, srcreg);
+ res = FIELD_DP32(res, MOP_ISS, SIZEREG, sizereg);
+
+ return res;
}
--
2.47.3