From patchwork Wed Aug 31 21:56:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 112711 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 76B43B6F75 for ; Thu, 1 Sep 2011 09:04:39 +1000 (EST) Received: from localhost ([::1]:43106 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QytLq-0001i4-RX for incoming@patchwork.ozlabs.org; Wed, 31 Aug 2011 18:33:42 -0400 Received: from eggs.gnu.org ([140.186.70.92]:57560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QytKw-0007tz-G5 for qemu-devel@nongnu.org; Wed, 31 Aug 2011 18:32:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QytKv-0006lu-Mq for qemu-devel@nongnu.org; Wed, 31 Aug 2011 18:32:46 -0400 Received: from [188.134.19.124] (port=34544 helo=octofox.metropolis) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QytKv-0006fg-4e for qemu-devel@nongnu.org; Wed, 31 Aug 2011 18:32:45 -0400 Received: from octofox.metropolis (localhost [127.0.0.1]) by octofox.metropolis (8.14.5/8.14.5) with ESMTP id p7VLvl0m028614; Thu, 1 Sep 2011 01:57:47 +0400 Received: (from jcmvbkbc@localhost) by octofox.metropolis (8.14.5/8.14.5/Submit) id p7VLvk8t028613; Thu, 1 Sep 2011 01:57:46 +0400 From: Max Filippov To: qemu-devel@nongnu.org Date: Thu, 1 Sep 2011 01:56:59 +0400 Message-Id: <1314827843-28543-9-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1314827843-28543-1-git-send-email-jcmvbkbc@gmail.com> References: <1314827843-28543-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 v3 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 c6ebb3d..400c995 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*/