|
From: | Richard Henderson |
Subject: | Re: [Qemu-arm] [Qemu-devel] [PATCH v11 23/29] target/arm: [tcg] Port to translate_insn |
Date: | Fri, 7 Jul 2017 07:48:37 -1000 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 07/07/2017 07:33 AM, Peter Maydell wrote:
On 7 July 2017 at 16:26, Richard Henderson <address@hidden> wrote:That is the purpose of DISAS_EXC too. We've called a noreturn helper to raise an exception and all following code is unreached. If there *was* any code being emitted afterward, that is arguably a bug.One exception to that is a conditionally executed exception generating exception -- there will in that case be a following label for the condfail case to branch to and the code for the condfail path. The distinction in the case that this code fragment is touching is that the cases handled in current master via 'goto done_generating' and in Lluis' patch as DISAS_SKIP are the "this insn is going to generate an exception without even thinking about conditional exception" (ie breakpoints, singlestep); DISAS_EXC is for "the instruction itself generates an exception, so don't bother with emitting too much unreachable code to update the PC etc, but we still need to handle the usual end-of-insn condfail path".
Ok.LLuis, this implies that the DISAS_NORETURN that I talked about elsewhere should be the thing handled generically, but that target/arm still needs a target-specific define for DISAS_EXC so that the conditional execution handler can make the distinction.
We do a few things in the DISAS_EXC codepath (like calling gen_set_condexec()) which strictly speaking are pointless but which it didn't seem worth trying to avoid just to avoid generating a few extra bytes in the generated code in a not-terribly-likely case.
Yeah. We'd probably be better off just adding dead-code removal to TCG. Something that used to be difficult but would now be trivial to do.
r~
[Prev in Thread] | Current Thread | [Next in Thread] |