From patchwork Mon Jan 11 19:00:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 360549 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3139512jai; Mon, 11 Jan 2021 11:20:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwvPftveJDH13e7G7TlJT4nGJi2aGeuRgFVWu7M01AJvJlRAf9Fs3oF9i6B3Rvyq9rJGvM+ X-Received: by 2002:a25:d60a:: with SMTP id n10mr1894753ybg.457.1610392806362; Mon, 11 Jan 2021 11:20:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610392806; cv=none; d=google.com; s=arc-20160816; b=vri8K70HfpJyajd5TCXbVHxWWBgKHe8sqB82q2RkGI/9lZbg8pZx0M0zCxpRNv8VJ0 FR4UftU0EcIIO2cAEPiKQ/ErNEZMVatUsyUbPk3cNdhDSzRPBx0ZZH7lHO95NPv47L8e 1Vc8WHBI7GQjT0k9EQylrfdCU8JFzQcqf0/oiMUTGC5zoCVzeUtny1WjXsR45V66Bffj QdYsYv28TEt1Vw9JgTCaAnRlHRbOHJ8Fq4AoKMMrfLjdyAJzhOhZ7+OaC4DwMji27/P+ JMZtg2/poODxVtqqpxfnFz/HRMvXvwYrCDT/8gpS8cKkq5SwyfypoUsOgleZ7QzDWMfi ltqA== 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=er0y9ezqqbyOJmWiO77UDuXh1LDwUXfxwiIw3fI/ARQ=; b=s5DYaETPqiyawyXde4zwbbipGOvwDNYmlwkzlrW4HNi4ph8AkzkT38VXpnSe/2xLz4 VexKpbigDW7aQlABwvRjkxKxKNlzOOyd21zdjDE2fAzIXb5U3AQ6tgVDNPrtA6cgroXD 7xihYxIZYyHFL4pFjvwke7rlA/dHJzUhAMTWwNL+lVnbbMa9W158veEa7rK6NFvu1j87 nibRdQb8j09V27jsLHf5MNlEdCSanJUoDkDVNYJsmfPnwd/IqQwOFaRZ/EEUiT8/4su3 eJolA0MrCldloww62AavT3iFvKjFWLT3H7BZ6SB/9u5CRdAf6+8m3mv2DP44RybHXmws YfGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="KgM/Euv+"; 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 i15si555543ybk.325.2021.01.11.11.20.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Jan 2021 11:20:06 -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="KgM/Euv+"; 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]:55880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kz2jR-0004ir-HM for patch@linaro.org; Mon, 11 Jan 2021 14:20:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kz2Ru-00066g-Nx for qemu-devel@nongnu.org; Mon, 11 Jan 2021 14:01:56 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:32852) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kz2Rh-0006SB-BL for qemu-devel@nongnu.org; Mon, 11 Jan 2021 14:01:52 -0500 Received: by mail-pl1-x631.google.com with SMTP id b8so1571plx.0 for ; Mon, 11 Jan 2021 11:01:40 -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=er0y9ezqqbyOJmWiO77UDuXh1LDwUXfxwiIw3fI/ARQ=; b=KgM/Euv+WgmtG8KQcHjicOnLhSYY2oZEQ651khGcrNz8NLkDmcEOkIaKAhnpY0xmh8 s1g8lg99YD4cAJxvzVhQqPbIAKmsVtxlBAwYWNgaYBvDRff1FwQEKkyVxuxIn8rn/gBG Kbl989BzuHJcRd5ZmKjNsKw+DRObGiLie+N0b4FOM1Z/8d5lfqQzE7fS4a7PJau8NgbJ LM5i/sw4Xa83h5Amx1VbsmGJR0cyAx5RssUX1r73MjLPtd7nnIFr8fnuJWAPrdZ5ijtk IIfQFkVnuymPMhGPSuDiJTY8ZbxiBhrWsPDhrrZlrBGDXFMXzZb/q7fZTlkqpihBPMoM sHlw== 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=er0y9ezqqbyOJmWiO77UDuXh1LDwUXfxwiIw3fI/ARQ=; b=M3tpkCQxH9OlM8DHw4+b+/N86M0tsrtrkqtxYpltrUpE1IbuSkH+JHCOBbCaWMv6jT EMicw2oKteNmAoOx+xEGpH5Rbl5K4GALLNwCsRcKDVkTe//a3Q0teV3+/Wm/CAeF8hS9 CfjJjSsmwLnnEEmMxQ8GvV6XoI9/YKDhetsdD0qA0c4MZ7daWLF6ye/ibZh+ZEpRVbq0 Bi55T5PRBGwqmS1VGTnNFlFHvJ3QHawTaRPw9pQytjiZwPMsvZUdSGuY3m9zNybZRLuY ts0eCeK8QAW87NZ6tzTy0iXXIP/H3qOMHMINPUM85PYQst8VkrN/3GZwxVU9YC2K3luD ZAbw== X-Gm-Message-State: AOAM532YtjQsB0zwOr3vcGlturi+fn16UfmHEryA2A4hU8+p3ZM3PDHb lr2Xjg4Qr2raQXrxWtcLgcSdFJAjbJZfVA== X-Received: by 2002:a17:90a:a10e:: with SMTP id s14mr261105pjp.133.1610391699224; Mon, 11 Jan 2021 11:01:39 -0800 (PST) Received: from localhost.localdomain (rrcs-173-197-107-21.west.biz.rr.com. [173.197.107.21]) by smtp.gmail.com with ESMTPSA id n195sm350395pfd.169.2021.01.11.11.01.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 11:01:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 13/30] target/arm: Adjust gen_aa32_{ld, st}_i64 for align+endianness Date: Mon, 11 Jan 2021 09:00:56 -1000 Message-Id: <20210111190113.303726-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210111190113.303726-1-richard.henderson@linaro.org> References: <20210111190113.303726-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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=unavailable 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" Adjust the interface to match what has been done to the TCGv_i32 load/store functions. This is less obvious, because at present the only user of these functions, trans_VLDST_multiple, also wants to manipulate the endianness to speed up loading multiple bytes. Thus we retain an "internal" interface which is identical to the current gen_aa32_{ld,st}_i64 interface. The "new" interface will gain users as we remove the legacy interfaces, gen_aa32_ld64 and gen_aa32_st64. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate.c | 78 +++++++++++++++++++-------------- target/arm/translate-neon.c.inc | 6 ++- 2 files changed, 49 insertions(+), 35 deletions(-) -- 2.25.1 diff --git a/target/arm/translate.c b/target/arm/translate.c index bf1c0f7279..f75987dac4 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -949,6 +949,37 @@ static void gen_aa32_st_internal_i32(DisasContext *s, TCGv_i32 val, tcg_temp_free(addr); } +static void gen_aa32_ld_internal_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); + + /* Not needed for user-mode BE32, where we use MO_BE instead. */ + if (!IS_USER_ONLY && s->sctlr_b && (opc & MO_SIZE) == MO_64) { + tcg_gen_rotri_i64(val, val, 32); + } + tcg_temp_free(addr); +} + +static void gen_aa32_st_internal_i64(DisasContext *s, TCGv_i64 val, + TCGv_i32 a32, int index, MemOp opc) +{ + TCGv addr = gen_aa32_addr(s, a32, opc); + + /* Not needed for user-mode BE32, where we use MO_BE instead. */ + if (!IS_USER_ONLY && s->sctlr_b && (opc & MO_SIZE) == MO_64) { + TCGv_i64 tmp = tcg_temp_new_i64(); + tcg_gen_rotri_i64(tmp, val, 32); + tcg_gen_qemu_st_i64(tmp, addr, index, opc); + tcg_temp_free_i64(tmp); + } else { + tcg_gen_qemu_st_i64(val, addr, index, opc); + } + tcg_temp_free(addr); +} + static void gen_aa32_ld_i32(DisasContext *s, TCGv_i32 val, TCGv_i32 a32, int index, MemOp opc) { @@ -961,6 +992,18 @@ static void gen_aa32_st_i32(DisasContext *s, TCGv_i32 val, TCGv_i32 a32, gen_aa32_st_internal_i32(s, val, a32, index, finalize_memop(s, opc)); } +static void gen_aa32_ld_i64(DisasContext *s, TCGv_i64 val, TCGv_i32 a32, + int index, MemOp opc) +{ + gen_aa32_ld_internal_i64(s, val, a32, index, finalize_memop(s, opc)); +} + +static void gen_aa32_st_i64(DisasContext *s, TCGv_i64 val, TCGv_i32 a32, + int index, MemOp opc) +{ + gen_aa32_st_internal_i64(s, val, a32, index, finalize_memop(s, opc)); +} + #define DO_GEN_LD(SUFF, OPC) \ static inline void gen_aa32_ld##SUFF(DisasContext *s, TCGv_i32 val, \ TCGv_i32 a32, int index) \ @@ -975,47 +1018,16 @@ static void gen_aa32_st_i32(DisasContext *s, TCGv_i32 val, TCGv_i32 a32, gen_aa32_st_i32(s, val, a32, index, OPC); \ } -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); - - /* Not needed for user-mode BE32, where we use MO_BE instead. */ - if (!IS_USER_ONLY && s->sctlr_b && (opc & MO_SIZE) == MO_64) { - tcg_gen_rotri_i64(val, val, 32); - } - - tcg_temp_free(addr); -} - static inline void gen_aa32_ld64(DisasContext *s, TCGv_i64 val, TCGv_i32 a32, int index) { - gen_aa32_ld_i64(s, val, a32, index, MO_Q | s->be_data); -} - -static void gen_aa32_st_i64(DisasContext *s, TCGv_i64 val, TCGv_i32 a32, - int index, MemOp opc) -{ - TCGv addr = gen_aa32_addr(s, a32, opc); - - /* Not needed for user-mode BE32, where we use MO_BE instead. */ - if (!IS_USER_ONLY && s->sctlr_b && (opc & MO_SIZE) == MO_64) { - TCGv_i64 tmp = tcg_temp_new_i64(); - tcg_gen_rotri_i64(tmp, val, 32); - tcg_gen_qemu_st_i64(tmp, addr, index, opc); - tcg_temp_free_i64(tmp); - } else { - tcg_gen_qemu_st_i64(val, addr, index, opc); - } - tcg_temp_free(addr); + gen_aa32_ld_i64(s, val, a32, index, MO_Q); } static inline void gen_aa32_st64(DisasContext *s, TCGv_i64 val, TCGv_i32 a32, int index) { - gen_aa32_st_i64(s, val, a32, index, MO_Q | s->be_data); + gen_aa32_st_i64(s, val, a32, index, MO_Q); } DO_GEN_LD(8u, MO_UB) diff --git a/target/arm/translate-neon.c.inc b/target/arm/translate-neon.c.inc index c82aa1412e..18d9042130 100644 --- a/target/arm/translate-neon.c.inc +++ b/target/arm/translate-neon.c.inc @@ -494,11 +494,13 @@ static bool trans_VLDST_multiple(DisasContext *s, arg_VLDST_multiple *a) int tt = a->vd + reg + spacing * xs; if (a->l) { - gen_aa32_ld_i64(s, tmp64, addr, mmu_idx, endian | size); + gen_aa32_ld_internal_i64(s, tmp64, addr, mmu_idx, + endian | size); neon_store_element64(tt, n, size, tmp64); } else { neon_load_element64(tmp64, tt, n, size); - gen_aa32_st_i64(s, tmp64, addr, mmu_idx, endian | size); + gen_aa32_st_internal_i64(s, tmp64, addr, mmu_idx, + endian | size); } tcg_gen_add_i32(addr, addr, tmp); }