From patchwork Thu Sep 8 22:32:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Rolnik X-Patchwork-Id: 667838 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sVbXm33mjz9s3s for ; Fri, 9 Sep 2016 09:05:44 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=f770E3I+; dkim-atps=neutral Received: from localhost ([::1]:54597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi8O5-0006sF-7K for incoming@patchwork.ozlabs.org; Thu, 08 Sep 2016 19:05:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi7sd-0003V6-Qk for qemu-devel@nongnu.org; Thu, 08 Sep 2016 18:33:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bi7sc-0000pL-QK for qemu-devel@nongnu.org; Thu, 08 Sep 2016 18:33:11 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:32948) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi7sc-0000pB-Jy for qemu-devel@nongnu.org; Thu, 08 Sep 2016 18:33:10 -0400 Received: by mail-wm0-x241.google.com with SMTP id b187so209921wme.0 for ; Thu, 08 Sep 2016 15:33:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jAijZGUXG9tZL225KCDJzVN6c8QJKq/PJrKsXlP/5bM=; b=f770E3I+yH6pCOkavE9X4dp+uSqpyF8Isw6H6JgikmYgmMICLAEGOIDmars8912AUt B9l5zXWKWvJ239YLoiJidbEhHbZGXR/qA7Y3rfp/CKhGtq/p3mXQykPAMIDxB0ylpkzh UYl0ydRt73hl5FaLaTziJVfaFW2QjZV2ySqyDcO0LPsL1w1w+uISyNFKP4iNsSeQo5/P kdDkMnrmr3g4YdgQgpYzA6t9zotpRFDdhZtJpYnbnvDHs1q4eOCMCnwPzwFyypvCzZIg C8x/PgRCL6fVEyalTxq2P0QfK2jmyihi/F0cUwzslmhMJrr/CcruskW6izK9bcJ8D5wK 9n/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jAijZGUXG9tZL225KCDJzVN6c8QJKq/PJrKsXlP/5bM=; b=S3ebWNpGhBBmXKgh5Kk5rXhnqbd5U0yZuuMSZB8b/iI/0D3DzQaidb6yFrq24rtOX9 AtIjcdrPOhT7SOC06VKmU6OejcZtFfP8Eq1LhzpVlqTUWcX2Bx3zScxWGs9ZdZz68LY+ 0GWqQjrgea96tziA2dP61M+2kCsjTy7aDRqQaa6w3NpWFedVhJgHxDJyaeOVpwmN1w8q njxLU6rIAW6GsfTOefHpDzQkSb5mw+ZJTxxForT4x9sHNbouJYB9nHduOvWhQ1Aji72z iXjyD0kv0w/xPIS/ngwRX+qQrBleTY6KNROxujIA0Bjq94sJZAtMfFWsITKe5dN5D0mg mzmA== X-Gm-Message-State: AE9vXwMgMiVzfYFv5Hw1jXFo5rYkQZCuWyO8qSYbVBEhRaqaz/LDNbL6aLxUWSHX7F16bA== X-Received: by 10.28.141.6 with SMTP id p6mr632087wmd.110.1473373989879; Thu, 08 Sep 2016 15:33:09 -0700 (PDT) Received: from a0999b0126e1.ant.amazon.com ([94.230.86.12]) by smtp.gmail.com with ESMTPSA id d8sm276298wmi.0.2016.09.08.15.33.08 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 08 Sep 2016 15:33:08 -0700 (PDT) From: Michael Rolnik To: qemu-devel@nongnu.org Date: Fri, 9 Sep 2016 01:32:07 +0300 Message-Id: <1473373930-31547-27-git-send-email-mrolnik@gmail.com> X-Mailer: git-send-email 2.4.9 (Apple Git-60) In-Reply-To: <1473373930-31547-1-git-send-email-mrolnik@gmail.com> References: <1473373930-31547-1-git-send-email-mrolnik@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PATCH RFC v1 26/29] target-arc: RTIE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Rolnik Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Michael Rolnik --- target-arc/helper.h | 1 + target-arc/op_helper.c | 21 +++++++++++++++++++++ target-arc/translate-inst.c | 10 ++++++++++ target-arc/translate-inst.h | 2 ++ 4 files changed, 34 insertions(+) diff --git a/target-arc/helper.h b/target-arc/helper.h index 14769b1..abfd0d2 100644 --- a/target-arc/helper.h +++ b/target-arc/helper.h @@ -24,4 +24,5 @@ DEF_HELPER_2(normw, i32, env, i32) DEF_HELPER_2(lr, tl, env, i32) DEF_HELPER_2(sr, void, i32, i32) DEF_HELPER_1(halt, void, env) +DEF_HELPER_1(rtie, void, env) diff --git a/target-arc/op_helper.c b/target-arc/op_helper.c index b07939c..a3f6a46 100644 --- a/target-arc/op_helper.c +++ b/target-arc/op_helper.c @@ -416,4 +416,25 @@ void helper_halt(CPUARCState *env) /* TODO: implement */ } +void helper_rtie(CPUARCState *env) +{ + if (env->stat.AEf) { + CPU_PCL(env) = env->eret; + env->stat = env->stat_er; + env->bta = env->erbta; + } else if (env->stat.A2f) { + CPU_PCL(env) = CPU_ILINK2(env); + env->stat = env->stat_l2; + env->bta = env->bta_l2; + } else if (env->stat.A1f) { + CPU_PCL(env) = CPU_ILINK1(env); + env->stat = env->stat_l1; + env->bta = env->bta_l1; + } else { + CPU_PCL(env) = env->eret; + env->stat = env->stat_er; + env->bta = env->stat.AEf; + } +} + diff --git a/target-arc/translate-inst.c b/target-arc/translate-inst.c index 87a00ca..743f2be 100644 --- a/target-arc/translate-inst.c +++ b/target-arc/translate-inst.c @@ -2803,3 +2803,13 @@ int arc_gen_SWI(DisasCtxt *ctx) return BS_EXCP; } +/* + RTIE +*/ +int arc_gen_RTIE(DisasCtxt *ctx) +{ + gen_helper_rtie(cpu_env); + + return BS_BRANCH; +} + diff --git a/target-arc/translate-inst.h b/target-arc/translate-inst.h index f7f988b..8bbac4f 100644 --- a/target-arc/translate-inst.h +++ b/target-arc/translate-inst.h @@ -169,3 +169,5 @@ int arc_gen_UNIMP(DisasCtxt *c); int arc_gen_SWI(DisasCtxt *c); int arc_gen_TRAP(DisasCtxt *c, TCGv src1); +int arc_gen_RTIE(DisasCtxt *c); +