From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbUCD-0004kv-VF for qemu-devel@nongnu.org; Mon, 14 Sep 2015 09:53:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbUCC-0000FG-IG for qemu-devel@nongnu.org; Mon, 14 Sep 2015 09:53:25 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:35073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbUCC-00005c-C0 for qemu-devel@nongnu.org; Mon, 14 Sep 2015 09:53:24 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1ZbUBz-0007sq-Fl for qemu-devel@nongnu.org; Mon, 14 Sep 2015 14:53:11 +0100 From: Peter Maydell Date: Mon, 14 Sep 2015 14:52:52 +0100 Message-Id: <1442238791-30255-6-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1442238791-30255-1-git-send-email-peter.maydell@linaro.org> References: <1442238791-30255-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 05/24] target-arm: Handle always condition codes within arm_test_cc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Richard Henderson Handling this with TCG_COND_ALWAYS will allow these unlikely cases to be handled without special cases in the rest of the translator. The TCG optimizer ought to be able to reduce these ALWAYS conditions completely. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 1441909103-24666-4-git-send-email-rth@twiddle.net Signed-off-by: Peter Maydell --- target-arm/translate.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/target-arm/translate.c b/target-arm/translate.c index 7d2e984..84a21ac 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -804,6 +804,14 @@ void arm_test_cc(DisasCompare *cmp, int cc) tcg_gen_andc_i32(value, cpu_ZF, value); break; + case 14: /* always */ + case 15: /* always */ + /* Use the ALWAYS condition, which will fold early. + * It doesn't matter what we use for the value. */ + cond = TCG_COND_ALWAYS; + value = cpu_ZF; + goto no_invert; + default: fprintf(stderr, "Bad condition code 0x%x\n", cc); abort(); @@ -813,6 +821,7 @@ void arm_test_cc(DisasCompare *cmp, int cc) cond = tcg_invert_cond(cond); } + no_invert: cmp->cond = cond; cmp->value = value; cmp->value_global = global; -- 1.9.1