From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NgjFv-00086N-7h for qemu-devel@nongnu.org; Sun, 14 Feb 2010 13:31:43 -0500 Received: from [199.232.76.173] (port=43611 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NgjFu-00086A-TP for qemu-devel@nongnu.org; Sun, 14 Feb 2010 13:31:42 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NgjFu-0008WJ-5N for qemu-devel@nongnu.org; Sun, 14 Feb 2010 13:31:42 -0500 Received: from mail-gx0-f223.google.com ([209.85.217.223]:47445) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NgjFt-0008WD-Qg for qemu-devel@nongnu.org; Sun, 14 Feb 2010 13:31:41 -0500 Received: by gxk23 with SMTP id 23so1885766gxk.2 for ; Sun, 14 Feb 2010 10:31:41 -0800 (PST) Sender: Rabin Vincent From: Rabin Vincent Date: Mon, 15 Feb 2010 00:02:35 +0530 Message-Id: <1266172357-9252-3-git-send-email-rabin@rab.in> In-Reply-To: <1266172357-9252-1-git-send-email-rabin@rab.in> References: <1266172357-9252-1-git-send-email-rabin@rab.in> Subject: [Qemu-devel] [PATCH 2/3] target-arm: implement Thumb-2 exception return List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Rabin Vincent Support the "subs pc, lr" Thumb-2 exception return instruction. Signed-off-by: Rabin Vincent --- target-arm/translate.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/target-arm/translate.c b/target-arm/translate.c index 10a516b..f0667e5 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -8001,8 +8001,17 @@ static int disas_thumb2_insn(CPUState *env, DisasContext *s, uint16_t insn_hw1) gen_bx(s, tmp); break; case 5: /* Exception return. */ - /* Unpredictable in user mode. */ - goto illegal_op; + if (IS_USER(s)) { + goto illegal_op; + } + + tmp = load_reg(s, rn); + tmp2 = new_tmp(); + tcg_gen_movi_i32(tmp2, insn & 0xff); + gen_helper_sub_cc(tmp, tmp, tmp2); + gen_exception_return(s, tmp); + dead_tmp(tmp2); + break; case 6: /* mrs cpsr. */ tmp = new_tmp(); if (IS_M(env)) { -- 1.6.6