From patchwork Tue Dec 8 18:00:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 339770 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3914090jai; Tue, 8 Dec 2020 10:11:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxpMXzO55b19Ct56E5ouTBOea+B64REWK30m9b7qlFoDf73stm4zO0eSgC9O8gA+YjniOC3 X-Received: by 2002:a25:d1ce:: with SMTP id i197mr29507752ybg.209.1607451084734; Tue, 08 Dec 2020 10:11:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607451084; cv=none; d=google.com; s=arc-20160816; b=gdAHJgXxFXXkBC6q80LwpxItoRYULWsNQBN96PA2bpQC54XA0FUpig5KgtMw6BuQH+ gYmxc7msnk4eMVt028XJQ2WlIX/cqeG0I7qqrlNtJ5mvHTJPNyQBNk3I9rQ1fKkA19CP cFGTrksct+xGBQSzxb1nNhNCjfjrpKbuy06mE/ZByp9dm65I2eDzjs0uwSuhiA0jS2NW SS7pcwkPSaUNVXv9W+B5svVmHSvL96p4UGiZlRCM78r+ynQ6yxTusSbpF26CFlR9KsIp OpJGbULalRQzsnmAhLEj3IV3wuY8eO1n+Ys0Tiu/WdDDqHZSz6fhD5csGG2cnVOS4Wyo QGqg== 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=BbcpleEZKyhprJSQbmMTNOGh64QQmS1NjHgoZYuCqSw=; b=vWfyavAo6kBa2cR7OMaRrtGkN9N/AKEoDYkxLdyY8gf1N/teIOKeQKgUSZkl8DPf1S zplKEFzZrEiIxHcATeARTBbrEp7BcN9owgcz/LvqCeA4sJ5hZ3mM4XggXnouG+UDfLIN AR8pqJ6utOozHBVRwQk7+Nb9fB8Z/aaHc+mZ1/rlYl9ONVVNvUznA6tTBkPvVMVgDTcw dDA6HXieao7Xo5z8aBZmA45oIAf933Nz93AxdfgAwESfkH2sxk1PabMcQTYIASKR3CHK uRB7oA2+n3PMOPwd6Q5pfdbqHjv9X3k2yiRC+vvGEZvpByXNxHpMlGM59Bfu5Pw6DmrC TmtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NRrPdEVV; 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 m184si21789968ybf.207.2020.12.08.10.11.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Dec 2020 10:11:24 -0800 (PST) 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=NRrPdEVV; 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]:48838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kmhSO-0007Qp-41 for patch@linaro.org; Tue, 08 Dec 2020 13:11:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56760) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmhIr-0007U5-9F for qemu-devel@nongnu.org; Tue, 08 Dec 2020 13:01:33 -0500 Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]:35494) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kmhIm-0006L2-U7 for qemu-devel@nongnu.org; Tue, 08 Dec 2020 13:01:32 -0500 Received: by mail-oi1-x241.google.com with SMTP id s2so10841377oij.2 for ; Tue, 08 Dec 2020 10:01:28 -0800 (PST) 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=BbcpleEZKyhprJSQbmMTNOGh64QQmS1NjHgoZYuCqSw=; b=NRrPdEVVkQlX9xp4tMaisqz23qIimHNK4rKLvD9M03ojTP6jJY6YiqRkgTWCVZIi3W SZc922+gvlV+VWKTDA3Ny6jHvjahSWq9icDP2T8YrzcjW1IzLLkh7AYIr+7GJoxhLP3y HVZgO+XeVI2Bj2ZpSkyWahoXm+jlbg96OlVYlL9WDLF0XF59RRa9qRP6EmcK+nlmqkX1 fIrBKQ+m9SWcVuUJmg5b3javhQtDCelCDAr/oWjXgzOchYFMI9FckEzBV/zJfe7LD8Z5 vj//7PQp0YCHtxwJJLwali2tD1uFAjsHNLzPt4tH5okvM2Br0xXbsTuv18rrXDVz1bvd 3xcQ== 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=BbcpleEZKyhprJSQbmMTNOGh64QQmS1NjHgoZYuCqSw=; b=SQ7IYXzMbMCzv37EfijjBd1eRjCaVrQPS5dloBx1hnQ6auw7z8wiMV1HhpyYEwH+ck rjCCzXRHS6NSr3v2c8kvETfZeKe7RhctSSaQ1j90ulR34gTD4AaLORrNzuGu1gmUVArA fNMf+Vy0mLKwQmB4Yyzy+LJ7Nxdigm3AOJihfqkLqfwwTyfhUsEl1mCauVOzwyZyEqMR terNdEkuH9nGNLb40wYq8vFxpwYueGsZChelbrg04cjfUieA4Em6KOz2j+vFdt9Pm9ld tnmU+/PnRjBVv3xVmwC2Rc955G5ps7ibQQkqjraAKKvMQkDSYsWAYpL/C1tnKVR8ARSx gCPQ== X-Gm-Message-State: AOAM530VZiOcioHD5YmSZry4djs9xZE8BIBMJngxQ+tJV3owsdFt3QWw zOiclKlUUlGdIrEwRw6zuzujLEDr3O3gFjAQ X-Received: by 2002:a05:6808:a1a:: with SMTP id n26mr3636377oij.94.1607450486901; Tue, 08 Dec 2020 10:01:26 -0800 (PST) Received: from localhost.localdomain (fixed-187-189-51-144.totalplay.net. [187.189.51.144]) by smtp.gmail.com with ESMTPSA id k20sm3886805oig.35.2020.12.08.10.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Dec 2020 10:01:25 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 04/24] target/arm: Merge gen_aa32_frob64 into gen_aa32_ld_i64 Date: Tue, 8 Dec 2020 12:00:58 -0600 Message-Id: <20201208180118.157911-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201208180118.157911-1-richard.henderson@linaro.org> References: <20201208180118.157911-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::241; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x241.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: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is the only caller. Adjust some commentary to talk about SCTLR_B instead of the vanishing function. Signed-off-by: Richard Henderson --- target/arm/translate.c | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate.c b/target/arm/translate.c index 7b3ebf44ae..f35d376341 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -942,20 +942,17 @@ static void gen_aa32_st_i32(DisasContext *s, TCGv_i32 val, TCGv_i32 a32, gen_aa32_st_i32(s, val, a32, index, OPC); \ } -static inline void gen_aa32_frob64(DisasContext *s, TCGv_i64 val) -{ - /* Not needed for user-mode BE32, where we use MO_BE instead. */ - if (!IS_USER_ONLY && s->sctlr_b) { - tcg_gen_rotri_i64(val, val, 32); - } -} - static void gen_aa32_ld_i64(DisasContext *s, TCGv_i64 val, TCGv_i32 a32, int index, MemOp opc) { TCGv addr = gen_aa32_addr(s, a32, opc); tcg_gen_qemu_ld_i64(val, addr, index, opc); - gen_aa32_frob64(s, val); + + /* Not needed for user-mode BE32, where we use MO_BE instead. */ + if (!IS_USER_ONLY && s->sctlr_b) { + tcg_gen_rotri_i64(val, val, 32); + } + tcg_temp_free(addr); } @@ -4921,16 +4918,13 @@ static void gen_load_exclusive(DisasContext *s, int rt, int rt2, TCGv_i32 tmp2 = tcg_temp_new_i32(); TCGv_i64 t64 = tcg_temp_new_i64(); - /* For AArch32, architecturally the 32-bit word at the lowest + /* + * For AArch32, architecturally the 32-bit word at the lowest * address is always Rt and the one at addr+4 is Rt2, even if * the CPU is big-endian. That means we don't want to do a - * gen_aa32_ld_i64(), which invokes gen_aa32_frob64() as if - * for an architecturally 64-bit access, but instead do a - * 64-bit access using MO_BE if appropriate and then split - * the two halves. - * This only makes a difference for BE32 user-mode, where - * frob64() must not flip the two halves of the 64-bit data - * but this code must treat BE32 user-mode like BE32 system. + * gen_aa32_ld_i64(), which checks SCTLR_B as if for an + * architecturally 64-bit access, but instead do a 64-bit access + * using MO_BE if appropriate and then split the two halves. */ TCGv taddr = gen_aa32_addr(s, addr, opc); @@ -4990,14 +4984,15 @@ static void gen_store_exclusive(DisasContext *s, int rd, int rt, int rt2, TCGv_i64 n64 = tcg_temp_new_i64(); t2 = load_reg(s, rt2); - /* For AArch32, architecturally the 32-bit word at the lowest + + /* + * For AArch32, architecturally the 32-bit word at the lowest * address is always Rt and the one at addr+4 is Rt2, even if * the CPU is big-endian. Since we're going to treat this as a * single 64-bit BE store, we need to put the two halves in the * opposite order for BE to LE, so that they end up in the right - * places. - * We don't want gen_aa32_frob64() because that does the wrong - * thing for BE32 usermode. + * places. We don't want gen_aa32_st_i64, because that checks + * SCTLR_B as if for an architectural 64-bit access. */ if (s->be_data == MO_BE) { tcg_gen_concat_i32_i64(n64, t2, t1);