From patchwork Tue Aug 17 21:17:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 498135 Delivered-To: patch@linaro.org Received: by 2002:a17:907:2648:0:0:0:0 with SMTP id ar8csp3530964ejc; Tue, 17 Aug 2021 14:26:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKUHAWdfQOOE5S0sg6JpV6wGy5TJc6634XikZ4bbTNVhPgIBfNE6bB+PMbDdRKh9uk83ib X-Received: by 2002:a05:6e02:10c2:: with SMTP id s2mr3786571ilj.148.1629235582557; Tue, 17 Aug 2021 14:26:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629235582; cv=none; d=google.com; s=arc-20160816; b=crw6F+yJXZRDsqx7JJfvOOXV10GCjzYNrqn1ehMZ9vveYOus+hQa8IDLC3H+xDCf3Z zHseLxS1hLXOURj49JsT4M/ewr9ok0sIDvkWaV7px+rWFkSbT9ZpYwhUqby8hgU3Lp3Y HyqulP2xx7BoBzBh9q3eqOq44cXO89ZIQqkDv836UtB2B6nh0hKK+NabCZqr9bepL9om Shr/cCHoYq86LTpJl3Dxz+nkDzFt/MlHHjxmePvyKj0gFmgqRysXJJkIbu7j0lBohSdX u2ToTHgg8beXioKLbO01D3abDrdbyXkpQYs0zdAmel/prUzoonSY/jkNg8g8mLpE8rW0 3WMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=gHsQub6dgXk5izfZm4KxXE3aZtQVWz9lmDcpviRGa+c=; b=VHzgeZRtrChrI6t/a7diw25pipF91VfQRpnjoWjWZxzOqGArYaWG8/k4HrSvxixmqV 71bZlzxUFLyireAJZe8jwDSJ40PbC/VZnFKapjiP5R8Hf8D2UiQdlRDDE7sMnqTgKZrq zFm5oSViwVNWwyjQL1i0QDwXPEosa0mRkZYiheeOZ3r1IhqcWxv6fD54tgCOf6aItCzX yzAG6VAOa/raDx3sPz7zIwEFybt3yoxk+lD2a0FEVnPv6GNF0dzD35FmjhLsIFHdKxNT UToaQ/9MMdImCagPvssOVYsy5M85MT68sI8QaG4BhkGUCFkQuhFr3GXGo+ieSCICtb1+ TQbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WTKNHeht; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w12si3702656jal.15.2021.08.17.14.26.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Aug 2021 14:26:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WTKNHeht; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:37572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mG6bF-0001Rk-Cd for patch@linaro.org; Tue, 17 Aug 2021 17:26:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mG6Tc-0001YP-3Q for qemu-devel@nongnu.org; Tue, 17 Aug 2021 17:18:28 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:35831) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mG6Ta-0001Cr-KF for qemu-devel@nongnu.org; Tue, 17 Aug 2021 17:18:27 -0400 Received: by mail-pf1-x434.google.com with SMTP id x16so6129pfh.2 for ; Tue, 17 Aug 2021 14:18:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gHsQub6dgXk5izfZm4KxXE3aZtQVWz9lmDcpviRGa+c=; b=WTKNHehtXWye8wZYoe1zfvBy2g+o9glNjJb2iPCwjdQr7Rs7h1ITxTO8ayA2yTf8p6 vFTmUgthf05znKSnXyFTf1UJCG+BnxgXbV4bLDxpWEwS4KJ+WhFl/z//+3irGQ+DzaT+ /fdC8KShX3b0QEhwaklHfQHnkscgY67baDY+65uUrObl6ocjAnIxvuXvhBtEMVN2iwOF F52/xyVtWeZv84CEvo+AC7PBS373rWfgtYfD/AUSX/lz5S2kq+bSGfdYbUwT9c7gjrmy EyQDtmhAi5UYsl/5wpkRZuOd4aAIjCceLikS8CwRzipYe5BECug9C67HzpRyxQavn7cM EvnQ== 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:mime-version:content-transfer-encoding; bh=gHsQub6dgXk5izfZm4KxXE3aZtQVWz9lmDcpviRGa+c=; b=jnrhc754t6E0h65pNaBqaMUxjePdwPLR9nR92Y7hUqOG0oBaxVwfANWtuCNwkmCFS5 2K0yYqQcSUufaqJ+b27tBj97MoLresMnJ5Z+qR+ADPKSUIE8lTGQ4Wa/0Qxk2DVkXbzT YGmyKRpnOCYBy04oIAruJX5XfL9j8SMgMudtFAwiC0huws3+3yeCjEf6Tr7MnktKslKe e4PXbNK/EsWOG4skHZ+EkRwiKIVnOcbZzWE5yoh6r34UYSQYEWnyh5D2ueJuAE32mzQ1 M6xcryzzErrw4giE9OD+OuDtPxmGoJ5hCqdIfX9aoL89mp72JmlLMGn60V3qCny5Fp2r vLMA== X-Gm-Message-State: AOAM532JTqC+YCtMyLDXG9QeTpskgkvSKNhepXZcPzMIPkHtYwfMP6ZK PWUq759lCRer6lyQBE7nTmg2/mqVdOcpOA== X-Received: by 2002:a63:a511:: with SMTP id n17mr5337135pgf.156.1629235105425; Tue, 17 Aug 2021 14:18:25 -0700 (PDT) Received: from localhost.localdomain ([173.197.107.15]) by smtp.gmail.com with ESMTPSA id q1sm2978637pjl.44.2021.08.17.14.18.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Aug 2021 14:18:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 12/21] target/riscv: Add gen_greviw Date: Tue, 17 Aug 2021 11:17:54 -1000 Message-Id: <20210817211803.283639-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210817211803.283639-1-richard.henderson@linaro.org> References: <20210817211803.283639-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair.Francis@wdc.com, bin.meng@windriver.com, qemu-riscv@nongnu.org, zhiwei_liu@c-sky.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Replicate the bswap special case from gen_grevi for the word-sized operation. Signed-off-by: Richard Henderson --- target/riscv/insn_trans/trans_rvb.c.inc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/target/riscv/insn_trans/trans_rvb.c.inc b/target/riscv/insn_trans/trans_rvb.c.inc index b97c3ca5da..af7694ed29 100644 --- a/target/riscv/insn_trans/trans_rvb.c.inc +++ b/target/riscv/insn_trans/trans_rvb.c.inc @@ -568,12 +568,24 @@ static bool trans_grevw(DisasContext *ctx, arg_grevw *a) return gen_shift(ctx, a, EXT_ZERO, gen_helper_grev); } +static void gen_greviw(TCGv dest, TCGv src, target_long shamt) +{ +#if TARGET_LONG_BITS == 64 + if (shamt == 32 - 8) { + /* rev4, byte swaps */ + tcg_gen_bswap32_i64(dest, src, TCG_BSWAP_IZ | TCG_BSWAP_OS); + return; + } +#endif + gen_helper_grev(dest, src, tcg_constant_tl(shamt)); +} + static bool trans_greviw(DisasContext *ctx, arg_greviw *a) { REQUIRE_64BIT(ctx); REQUIRE_EXT(ctx, RVB); ctx->w = true; - return gen_shift_imm_tl(ctx, a, EXT_ZERO, gen_helper_grev); + return gen_shift_imm_fn(ctx, a, EXT_ZERO, gen_greviw); } static bool trans_gorcw(DisasContext *ctx, arg_gorcw *a)