From patchwork Tue Dec 19 05:38:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10122501 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4510260390 for ; Tue, 19 Dec 2017 05:47:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 373672904E for ; Tue, 19 Dec 2017 05:47:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C1C42905A; Tue, 19 Dec 2017 05:47:41 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, 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 C83592904E for ; Tue, 19 Dec 2017 05:47:40 +0000 (UTC) Received: from localhost ([::1]:50660 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRAkd-0007gy-Pb for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Dec 2017 00:47:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRAdI-00018K-BQ for qemu-devel@nongnu.org; Tue, 19 Dec 2017 00:40:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRAdH-00023C-M8 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 00:40:04 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:40356) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRAdH-00022o-G3 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 00:40:03 -0500 Received: by mail-wr0-x242.google.com with SMTP id q9so16996508wre.7 for ; Mon, 18 Dec 2017 21:40:03 -0800 (PST) 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=3xzO04GUrjljP5pWBwq0VqTFgObZm80F7E4uVCkEPVk=; b=B98MwsP26m4lwnSspVzP+ECcn8O45/kQRzhrQrczl4hcqLQAM2FfMpRtrz7q0kuXgr uB92Je+VyHYQ7+Ao18zQtoxe6KeOV3cBq69ld2gIYIenzspQ8H2eimCZXrTB/mU2aQGj dz6vgfnccgN6GquZtFJVwFRMzz2EXge6owftweWyU62eT8snhuj6GOcRZArx6WP2BMkm a1+Ha7ndqhhwwS5j/Vy7cgXBRI8Xe6V4hI+qkuZvXhTVeaG/MjVyHwMa7sGa7XdoAGr0 EFnftzqKIlCr3qCgZwkPq5eW5TjEXTptBXRnss1IUgtZ4hFBWfvCb76WGl2Fb/UJX019 dZrA== 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=3xzO04GUrjljP5pWBwq0VqTFgObZm80F7E4uVCkEPVk=; b=oQ3xJu6A3X60rFZmRXQRUQMQnYOl7IXwW++ZyZyF4y2un6ZZ7fmpccEnQzg35eborz 5Az/ExvyPcU3otZOJPaei9OfuaAagwP7lkWTf1kdm4dfvygc6tEWnBtd6rgwQ5dq/Lxo ZJ74/sx1YxSJ6ocxh/BDODh9KdbqWWmronfn593topAAowoBUzEH6OFv5YXJvCBX2MI8 Ni91VQ4lEF9p5rIkb4mtrdsTZO6rktxqKQHhZ6lJXnrEkXBPKdzXru4qQLA+d7pN1Sdx KWtr+vQKIbDG0HHMdMdLn7pmsXWsIu3DnM8d56OVd/Fd6P+WGvBl0cmkCQCj7v+i7cVi E68g== X-Gm-Message-State: AKGB3mKjHPsDXwQkywRFz32OWwQe+ktLLph9kTYZ0Re5iuOZUXPgmKus OealAO4nVd7TE/wIZwngW/HgJw== X-Google-Smtp-Source: ACJfBovXFOnF0emL5ZO6gGi3E7IEIdfzYL2eoXZu+Clotuo/W4lT4x+zUG4oR+IzKBf6PUxRipZJ2Q== X-Received: by 10.25.215.139 with SMTP id q11mr1262637lfi.98.1513662002303; Mon, 18 Dec 2017 21:40:02 -0800 (PST) Received: from octofox.net (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id f67sm673187lfb.83.2017.12.18.21.40.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Dec 2017 21:40:01 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Mon, 18 Dec 2017 21:38:49 -0800 Message-Id: <1513661932-6849-14-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1513661932-6849-1-git-send-email-jcmvbkbc@gmail.com> References: <1513661932-6849-1-git-send-email-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PATCH v2 13/16] target/xtensa: implement salt/saltu 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 , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP SALT/SALTU are recent additions to the core Xtensa ISA that do signed/unsigned setcond. Signed-off-by: Max Filippov --- target/xtensa/translate.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index f644d9fed22a..da1f712badc7 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -2199,6 +2199,16 @@ static void translate_s32e(DisasContext *dc, const uint32_t arg[], } } +static void translate_salt(DisasContext *dc, const uint32_t arg[], + const uint32_t par[]) +{ + if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { + tcg_gen_setcond_i32(par[0], + cpu_R[arg[0]], + cpu_R[arg[1]], cpu_R[arg[2]]); + } +} + static void translate_sext(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { @@ -3667,6 +3677,14 @@ static const XtensaOpcodeOps core_ops[] = { .translate = translate_ldst, .par = (const uint32_t[]){MO_UB, false, true}, }, { + .name = "salt", + .translate = translate_salt, + .par = (const uint32_t[]){TCG_COND_LT}, + }, { + .name = "saltu", + .translate = translate_salt, + .par = (const uint32_t[]){TCG_COND_LTU}, + }, { .name = "sext", .translate = translate_sext, }, {