Received: from eggs.gnu.org ([2001:4830:134:3::10]:44619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi7sJ-00039c-Kx for qemu-devel@nongnu.org; Thu, 08 Sep 2016 18:32:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bi7sH-0000iX-Oj for qemu-devel@nongnu.org; Thu, 08 Sep 2016 18:32:50 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:33979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi7sH-0000iO-I1 for qemu-devel@nongnu.org; Thu, 08 Sep 2016 18:32:49 -0400 Received: by mail-wm0-x243.google.com with SMTP id w12so203255wmf.1 for ; Thu, 08 Sep 2016 15:32:49 -0700 (PDT) From: Michael Rolnik Date: Fri, 9 Sep 2016 01:31:51 +0300 Message-Id: <1473373930-31547-11-git-send-email-mrolnik@gmail.com> In-Reply-To: <1473373930-31547-1-git-send-email-mrolnik@gmail.com> References: <1473373930-31547-1-git-send-email-mrolnik@gmail.com> Subject: [Qemu-devel] [PATCH RFC v1 10/29] target-arc: POP, PUSH List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Michael Rolnik Signed-off-by: Michael Rolnik --- target-arc/translate-inst.c | 22 ++++++++++++++++++++++ target-arc/translate-inst.h | 3 +++ 2 files changed, 25 insertions(+) diff --git a/target-arc/translate-inst.c b/target-arc/translate-inst.c index 7f7e951..2a579f8 100644 --- a/target-arc/translate-inst.c +++ b/target-arc/translate-inst.c @@ -1147,3 +1147,25 @@ int arc_gen_NOT(DisasCtxt *ctx, TCGv dest, TCGv src1) return BS_NONE; } +/* + POP +*/ +int arc_gen_POP(DisasCtxt *ctx, TCGv src1) +{ + tcg_gen_qemu_ld_tl(src1, cpu_sp, ctx->memidx, MO_UL); + tcg_gen_addi_tl(cpu_sp, cpu_sp, 4); + + return BS_NONE; +} + +/* + PUSH +*/ +int arc_gen_PUSH(DisasCtxt *ctx, TCGv src1) +{ + tcg_gen_subi_tl(cpu_sp, cpu_sp, 4); + tcg_gen_qemu_st_tl(src1, cpu_sp, ctx->memidx, MO_UL); + + return BS_NONE; +} + diff --git a/target-arc/translate-inst.h b/target-arc/translate-inst.h index 36ce19b..d088a43 100644 --- a/target-arc/translate-inst.h +++ b/target-arc/translate-inst.h @@ -75,3 +75,6 @@ int arc_gen_NEG(DisasCtxt *c, TCGv dest, TCGv src1); int arc_gen_ABS(DisasCtxt *c, TCGv dest, TCGv src1); int arc_gen_NOT(DisasCtxt *c, TCGv dest, TCGv src1); +int arc_gen_POP(DisasCtxt *c, TCGv src1); +int arc_gen_PUSH(DisasCtxt *c, TCGv src1); + -- 2.4.9 (Apple Git-60)