From patchwork Wed Sep 5 01:43:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10588165 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B3522174C for ; Wed, 5 Sep 2018 01:49:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5D0229939 for ; Wed, 5 Sep 2018 01:49:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A15D29D31; Wed, 5 Sep 2018 01:49:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4BC9129939 for ; Wed, 5 Sep 2018 01:49:06 +0000 (UTC) Received: from localhost ([::1]:53392 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxMwL-0000wD-GL for patchwork-qemu-devel@patchwork.kernel.org; Tue, 04 Sep 2018 21:49:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxMs2-0005y9-AT for qemu-devel@nongnu.org; Tue, 04 Sep 2018 21:44:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxMs1-0006rm-Br for qemu-devel@nongnu.org; Tue, 04 Sep 2018 21:44:38 -0400 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]:42109) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fxMs0-0006oj-Vj for qemu-devel@nongnu.org; Tue, 04 Sep 2018 21:44:37 -0400 Received: by mail-lj1-x235.google.com with SMTP id f1-v6so4785597ljc.9 for ; Tue, 04 Sep 2018 18:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FtF/r6M6nB76WAm/tAVT4+AozRwuIIKQsEUa1nT4e1E=; b=ayOHfQ2uq3Yyf5CotoKn8R/8BM3nmnIDHrvH7Cwl3TkCr5msJ57ch7EtzibZdsWD3o qY09zJvBuYre5xtznGp3mPO7ADmNRoskEAsWlOgEsOoDiBdC7M7sbY+08aZ8I3AONRIG ktqxjMrBPTKaRg3m67c01T8ObhjNjwhe62ZqLk9uU7bI1hj+YWJHdSFzwcs6+t9dh5Oi PvrEDyt3TZQ2gwbH0qXEFB7I0v8xQEEWz1inSbye+kNaZnMfhqXNC4dkkxVlXQpyX8Zc VdhaloGaOrhybZOY1XaZyYYc6J3jsa7DwC+1kiEjpPI8JZtPAE+FWlyCoi9jSsUexc7+ pqGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FtF/r6M6nB76WAm/tAVT4+AozRwuIIKQsEUa1nT4e1E=; b=cCTHTpsVlRn9gyxLMAUxJZNjebW+q19GsNaiylg+stJhylIYRE1oBTWQEMNq9kyV+l fBADg9wQjnEp7W1Arjvh9fm7+oOjfHac8pzx8zsd3NKnGZ8bDwPGGASyaYSJGC1f8NqN qQG7SUZkUKLcHPkYCkgbH1HQrmTo6jtaa97u68PlX/IgumRWbKf/cyEnwzs1i2Tr/cJA dtMHQRkTUQkOWuwuspNsQ/C2sqIrL6MynuEd8glmfu+0IeVpAc6Kg5EfFL6es43y3DEp JAC6cl8Mo3vVRPfpFemta5nyFAYWTKkblQEDAESBiaskmCvK6W+7wdJqgR4nvOJPWyyt npNQ== X-Gm-Message-State: APzg51C0WDkjdFnDAJuVQIkaP0lO8mqrj8k95FjxfeMHQHeb4igXURMb tqkuw3MEp/KBZJPpnP3akzUqzN5ro9A= X-Google-Smtp-Source: ANB0VdY45dCkR6M6BouwxaPW/SB2r2K2Dn9i4RligHQh0xHF79jLIk0jfmxe9Lh9l2m55T1D5f58Rw== X-Received: by 2002:a2e:9655:: with SMTP id z21-v6mr8991834ljh.130.1536111875408; Tue, 04 Sep 2018 18:44:35 -0700 (PDT) Received: from octofox.cadence.com (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id g10-v6sm59337lfl.11.2018.09.04.18.44.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Sep 2018 18:44:34 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Date: Tue, 4 Sep 2018 18:43:44 -0700 Message-Id: <20180905014352.970-8-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180905014352.970-1-jcmvbkbc@gmail.com> References: <20180905014352.970-1-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::235 Subject: [Qemu-devel] [PATCH 07/15] target/xtensa: extract test for alloca exception 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: Max Filippov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP - mark movsp instruction; - put test for alloca exception right after the test for window underflow; Signed-off-by: Max Filippov --- target/xtensa/translate.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index deedd4c973ef..9b59f35a1de7 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -1078,6 +1078,13 @@ static void disas_xtensa_insn(CPUXtensaState *env, DisasContext *dc) tcg_temp_free(tmp); } + if (op_flags & XTENSA_OP_ALLOCA) { + TCGv_i32 tmp = tcg_const_i32(dc->pc); + + gen_helper_movsp(cpu_env, tmp); + tcg_temp_free(tmp); + } + for (slot = 0; slot < slots; ++slot) { XtensaOpcodeOps *ops = slot_prop[slot].ops; @@ -1918,10 +1925,7 @@ static void translate_movp(DisasContext *dc, const uint32_t arg[], static void translate_movsp(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - TCGv_i32 pc = tcg_const_i32(dc->pc); - gen_helper_movsp(cpu_env, pc); tcg_gen_mov_i32(cpu_R[arg[0]], cpu_R[arg[1]]); - tcg_temp_free(pc); } static void translate_mul16(DisasContext *dc, const uint32_t arg[], @@ -3062,6 +3066,7 @@ static const XtensaOpcodeOps core_ops[] = { .name = "movsp", .translate = translate_movsp, .windowed_register_op = 0x3, + .op_flags = XTENSA_OP_ALLOCA, }, { .name = "movt", .translate = translate_movp,