From patchwork Sat Nov 4 03:45:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10041439 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 4D2BD6032A for ; Sat, 4 Nov 2017 03:58:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F0F129A09 for ; Sat, 4 Nov 2017 03:58:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31B0E29A97; Sat, 4 Nov 2017 03:58:31 +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, HK_RANDOM_FROM, 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 E046329A09 for ; Sat, 4 Nov 2017 03:58:30 +0000 (UTC) Received: from localhost ([::1]:39251 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eApbK-0007AT-6w for patchwork-qemu-devel@patchwork.kernel.org; Fri, 03 Nov 2017 23:58:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eApPg-0006FQ-Ou for qemu-devel@nongnu.org; Fri, 03 Nov 2017 23:46:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eApPe-00012T-MZ for qemu-devel@nongnu.org; Fri, 03 Nov 2017 23:46:28 -0400 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:56641) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eApPe-00011k-Ej for qemu-devel@nongnu.org; Fri, 03 Nov 2017 23:46:26 -0400 Received: by mail-lf0-x244.google.com with SMTP id 90so5134921lfs.13 for ; Fri, 03 Nov 2017 20:46:26 -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=3xzO04GUrjljP5pWBwq0VqTFgObZm80F7E4uVCkEPVk=; b=ajBHHMfRi1GhcDJMJXe/PEhwAOIh5JyBz2LFztKiow22U74cs3ne7N1TAJ1MQx6b4a GO/xz3XMf47L4FCxQoosvY4fkOE+h90K71ObrQv4s65AWuWcgGr5kTCVEZKVXcwCnOye y4CptPfgRlCZ0KzunN4BHarmhirawVsBa2lojMS65qe0ObrzK26iiw+IT2zUvCHQU+E+ 7I3DHTlXMZXwksG/Ov6eHXqj9LjbUV8pmWzdnDupD76HFnE0mYfkvdDwQgsrkd0MlY0u jE72wt4yuM5ZzYHB44aKg/NuYLwdh6MGaDB3WY447th4r3600CUIOh8QfEpEgtdbxWGg dg9Q== 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=IXz+wBo9c6kJ56cUR9Qkyyr6WmMIjnP3U9ZrbN2Jq45ce7qaUIahMu2Jlq9GoSbOis 07qPbr9cZkVWWI+7QakUu5fMCFzUjgWPMu6t4yOQhSb4k8uLpe0oy1VlTSfN0cs1z4hF 36c14V4vnfaOOhGvAvP7IY1KFaIGvUP2km+kTPBF9SGVcUer8c5UTBtDUl9iPildaA43 +ALrgObQUTzXpUZG1f0idcrq+EVj4nX1FQYTjgxbCYWCtwMEqtNDcxQkNTTC+qX9Mu3G AwOKdXhdrZgi0gOTZnWoIg/2BHVf2JXaSKwjBmMNbnIj7plCS9Q17lbBXO7XaZ8kOMyy lmmA== X-Gm-Message-State: AJaThX7yvhq0HSIXN9fbX8w+ML52xHGcRjaqK7gbb3DMBIHc4IdLA02C bnnPwiQtXQGBbbe948Owv/u4MQ== X-Google-Smtp-Source: ABhQp+Q1bSH5A8bPON/MXg/2TVRMM3CvmCnaJJWqgSio+AAq/VGhTKorW3qTguFBWezfy/0c2MhGMA== X-Received: by 10.25.72.200 with SMTP id v191mr3107489lfa.113.1509767184969; Fri, 03 Nov 2017 20:46:24 -0700 (PDT) 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 h3sm1258383lfj.26.2017.11.03.20.46.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Nov 2017 20:46:24 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Date: Fri, 3 Nov 2017 20:45:18 -0700 Message-Id: <1509767121-26925-14-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1509767121-26925-1-git-send-email-jcmvbkbc@gmail.com> References: <1509767121-26925-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:4010:c07::244 Subject: [Qemu-devel] [PATCH 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, }, {