[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/6] arm: Force RES0 bits in TST/A1 to be 0
From: |
Kim Kuparinen |
Subject: |
[PATCH 2/6] arm: Force RES0 bits in TST/A1 to be 0 |
Date: |
Sat, 20 Nov 2021 13:13:23 +0200 |
make check failed on quemu-system-arm when not using thumb with
'Illegal instruction'
apparently because bits marked RES0 in the arm spec were being set to random
values.
According to the spec this leads to unpredictable behaviour:
https://developer.arm.com/documentation/ddi0487/gb/
Page 4356 for a description of reserved bits and page 5203 for the TST
instruction.
Signed-off-by: Kim Kuparinen <kimi.h.kuparinen@gmail.com>
---
lib/jit_arm-cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/jit_arm-cpu.c b/lib/jit_arm-cpu.c
index b6ee260..f0f5111 100644
--- a/lib/jit_arm-cpu.c
+++ b/lib/jit_arm-cpu.c
@@ -612,7 +612,7 @@ static void _torl(jit_state_t*,int,int,int) maybe_unused;
# define CMNI(rn,im) CC_CMNI(ARM_CC_AL,rn,im)
# define T2_CMNI(rn,im) torri(THUMB2_CMNI,rn,_R15_REGNO,im)
# define CC_TST(cc,rn,rm) corrr(cc,ARM_TST,rn,r0,rm)
-# define TST(rn,rm) CC_TST(ARM_CC_AL,rn,rm)
+# define TST(rn,rm) corrr(ARM_CC_AL,ARM_TST,rn,0,rm)
# define T1_TST(rn,rm)
is(THUMB_TST|(_u3(rm)<<3)|_u3(rn))
# define T2_TST(rn,rm)
torrr(THUMB2_TST,rn,_R15_REGNO,rm)
# define CC_TSTI(cc,rn,im) corri(cc,ARM_TST|ARM_I,rn,0,im)
--
2.33.0
- [PATCH 0/6] Misc patches to pass the testsuite and remove warnings, Kim Kuparinen, 2021/11/20
- [PATCH 1/6] riscv: Fix movi/relatives loading incorrect value, Kim Kuparinen, 2021/11/20
- [PATCH 2/6] arm: Force RES0 bits in TST/A1 to be 0,
Kim Kuparinen <=
- [PATCH 3/6] mips: Use DEXT when in 64-bit mode instead of EXT, Kim Kuparinen, 2021/11/20
- [PATCH 6/6] Include math.h in check/lightning.c, Kim Kuparinen, 2021/11/20
- [PATCH 5/6] misc: Add bfd_arch to arm/aarch64/mips, Kim Kuparinen, 2021/11/20
- [PATCH 4/6] ppc: Add endianness check to _truncr_d_i, Kim Kuparinen, 2021/11/20
- Re: [PATCH 0/6] Misc patches to pass the testsuite and remove warnings, Kim Kuparinen, 2021/11/20