[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [Qemu-devel] [PATCH 6/6] target/arm: Execute Thumb instru
From: |
Richard Henderson |
Subject: |
Re: [Qemu-arm] [Qemu-devel] [PATCH 6/6] target/arm: Execute Thumb instructions when their condbits are 0xf |
Date: |
Mon, 17 Jun 2019 13:04:58 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 |
On 6/17/19 10:53 AM, Peter Maydell wrote:
> Thumb instructions in an IT block are set up to be conditionally
> executed depending on a set of condition bits encoded into the IT
> bits of the CPSR/XPSR. The architecture specifies that if the
> condition bits are 0b1111 this means "always execute" (like 0b1110),
> not "never execute"; we were treating it as "never execute". (See
> the ConditionHolds() pseudocode in both the A-profile and M-profile
> Arm ARM.)
>
> This is a bit of an obscure corner case, because the only legal
> way to get to an 0b1111 set of condbits is to do an exception
> return which sets the XPSR/CPSR up that way. An IT instruction
> which encodes a condition sequence that would include an 0b1111 is
> UNPREDICTABLE, and for v8A the CONSTRAINED UNPREDICTABLE choices
> for such an IT insn are to NOP, UNDEF, or treat 0b1111 like 0b1110.
> Add a comment noting that we take the latter option.
>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> target/arm/translate.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
Reviewed-by: Richard Henderson <address@hidden>
r~
- [Qemu-arm] [PATCH 0/6] Six minor M-profile bugfixes, Peter Maydell, 2019/06/17
- [Qemu-arm] [PATCH 2/6] arm v8M: Forcibly clear negative-priority exceptions on deactivate, Peter Maydell, 2019/06/17
- [Qemu-arm] [PATCH 3/6] target/arm: v8M: Check state of exception being returned from, Peter Maydell, 2019/06/17
- [Qemu-arm] [PATCH 6/6] target/arm: Execute Thumb instructions when their condbits are 0xf, Peter Maydell, 2019/06/17
- Re: [Qemu-arm] [Qemu-devel] [PATCH 6/6] target/arm: Execute Thumb instructions when their condbits are 0xf,
Richard Henderson <=
- [Qemu-arm] [PATCH 4/6] target/arm: Use _ra versions of cpu_stl_data() in v7M helpers, Peter Maydell, 2019/06/17
- [Qemu-arm] [PATCH 5/6] hw/timer/armv7m_systick: Forbid non-privileged accesses, Peter Maydell, 2019/06/17
- [Qemu-arm] [PATCH 1/6] target/arm: NS BusFault on vector table fetch escalates to NS HardFault, Peter Maydell, 2019/06/17