From patchwork Thu Sep 1 20:45:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 113017 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0319CB6F71 for ; Fri, 2 Sep 2011 08:23:16 +1000 (EST) Received: from localhost ([::1]:55447 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzEA8-00010Z-56 for incoming@patchwork.ozlabs.org; Thu, 01 Sep 2011 16:47:00 -0400 Received: from eggs.gnu.org ([140.186.70.92]:50414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzE9T-0007Os-5Z for qemu-devel@nongnu.org; Thu, 01 Sep 2011 16:46:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzE9R-00039t-OL for qemu-devel@nongnu.org; Thu, 01 Sep 2011 16:46:18 -0400 Received: from [188.134.19.124] (port=36858 helo=octofox.metropolis) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzE9R-00039D-Az for qemu-devel@nongnu.org; Thu, 01 Sep 2011 16:46:17 -0400 Received: from octofox.metropolis (localhost [127.0.0.1]) by octofox.metropolis (8.14.5/8.14.5) with ESMTP id p81KkMFq031810; Fri, 2 Sep 2011 00:46:22 +0400 Received: (from jcmvbkbc@localhost) by octofox.metropolis (8.14.5/8.14.5/Submit) id p81KkMjB031809; Fri, 2 Sep 2011 00:46:22 +0400 From: Max Filippov To: qemu-devel@nongnu.org Date: Fri, 2 Sep 2011 00:45:36 +0400 Message-Id: <1314909960-31738-9-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1314909960-31738-1-git-send-email-jcmvbkbc@gmail.com> References: <1314909960-31738-1-git-send-email-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 188.134.19.124 Cc: jcmvbkbc@gmail.com Subject: [Qemu-devel] [PATCH v4 08/32] target-xtensa: implement JX/RET0/CALLX X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Group SNM0 (indirect jumps and calls). Signed-off-by: Max Filippov --- target-xtensa/translate.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index 433e1ba..26cce83 100644 --- a/target-xtensa/translate.c +++ b/target-xtensa/translate.c @@ -248,6 +248,49 @@ static void disas_xtensa_insn(DisasContext *dc) switch (RRR_R) { case 0: /*SNM0*/ + switch (CALLX_M) { + case 0: /*ILL*/ + break; + + case 1: /*reserved*/ + break; + + case 2: /*JR*/ + switch (CALLX_N) { + case 0: /*RET*/ + case 2: /*JX*/ + gen_jump(dc, cpu_R[CALLX_S]); + break; + + case 1: /*RETWw*/ + HAS_OPTION(XTENSA_OPTION_WINDOWED_REGISTER); + break; + + case 3: /*reserved*/ + break; + } + break; + + case 3: /*CALLX*/ + switch (CALLX_N) { + case 0: /*CALLX0*/ + { + TCGv_i32 tmp = tcg_temp_new_i32(); + tcg_gen_mov_i32(tmp, cpu_R[CALLX_S]); + tcg_gen_movi_i32(cpu_R[0], dc->next_pc); + gen_jump(dc, tmp); + tcg_temp_free(tmp); + } + break; + + case 1: /*CALLX4w*/ + case 2: /*CALLX8w*/ + case 3: /*CALLX12w*/ + HAS_OPTION(XTENSA_OPTION_WINDOWED_REGISTER); + break; + } + break; + } break; case 1: /*MOVSPw*/