target/arm: Make Thumb store insns UNDEF for Rn==1111
PATCH 1/1 target/arm: Make Thumb store insns UNDEF for Rn==1111
The Arm ARM specifies that for Thumb encodings of the various plain store insns, if the Rn field is 1111 then we must UNDEF. This is different from the Arm encodings, where this case is either UNPREDICTABLE or has well-defined behaviour. The exclusive stores, store-release and STRD do not have this UNDEF case for any encoding.
Enforce the UNDEF for this case in the Thumb plain store insns.
--- target/arm/translate.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
target/arm/translate.c +16 -0
@@ -6476,6 +6476,14 @@ static bool op_store_rr(DisasContext *s, arg_ldst_rr *a,ISSInfo issinfo =make_issinfo (s, a->rt, a->p, a->w) | ISSIsWrite;TCGv_i32 addr, tmp; +/* +* In Thumb encodings of stores Rn=1111 is UNDEF; for Arm it +* is either UNPREDICTABLE or has defined behaviour +*/ +if (s->thumb && a->rn ==15 ) { +return false; + } + addr =op_addr_rr_pre (s, a); tmp =load_reg (s, a->rt);
@@ -6620,6 +6628,14 @@ static bool op_store_ri(DisasContext *s, arg_ldst_ri *a,ISSInfo issinfo =make_issinfo (s, a->rt, a->p, a->w) | ISSIsWrite;TCGv_i32 addr, tmp; +/* +* In Thumb encodings of stores Rn=1111 is UNDEF; for Arm it +* is either UNPREDICTABLE or has defined behaviour +*/ +if (s->thumb && a->rn ==15 ) { +return false; + } + addr =op_addr_ri_pre (s, a); tmp =load_reg (s, a->rt);
Signature · 1 line
2.20.1
Quoted 6 lines · Peter Maydell
The Arm ARM specifies that for Thumb encodings of the various plain store insns, if the Rn field is 1111 then we must UNDEF. This is different from the Arm encodings, where this case is either UNPREDICTABLE or has well-defined behaviour. The exclusive stores, store-release and STRD do not have this UNDEF case for any encoding.
Quoted 7 lines
Enforce the UNDEF for this case in the Thumb plain store insns.
Signed-off-by Peter Maydell<[email protected]>--- target/arm/translate.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
r~