From patchwork Tue Dec 8 18:01:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 339767 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3912191jai; Tue, 8 Dec 2020 10:09:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIU7+HvElh1zSVj8Y9UOdQgiqTx5ov0GKKZxbc1Xt32uhgWVgef7HVT3ydfSqToKQvG+Oo X-Received: by 2002:a05:6902:210:: with SMTP id j16mr15404294ybs.122.1607450943387; Tue, 08 Dec 2020 10:09:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607450943; cv=none; d=google.com; s=arc-20160816; b=DmZKlhuncae5KJkaANAKA0h5PAdF/tN2P5YbzWJYeZoREAqv57VOp4hd7/zf5Fczh2 qzgk6VMx4ymOK/OCcLE/SJ/CDqzSe+D+rlXoBpNwDr2/JrzK07RZmv4ymF+wpsJtlGFO 5QcMOyWT3865KjxW7gq2aiBmhg3/mgr15TMzGIh+v0rUk+b+kE7tRyJwYe/bpQ80WLlx E/BSdWXLtHULZGV/Z8l+FJXZSmqTiPEQaeokNuBWjgh9dXQf8LXYi6a9Gf9wb7FBFMWE z1gYRQXaP6JcPbwejplCiA7wablRS2a+qGRzSkm/W6TUOtYBazGuij8YgyWwa5iS6sY0 6Eug== 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=wXxlIHEHV0RVDyckAtbEiZsJCIXIPBDl5ZKGc44kZZY=; b=dLGtnesTnbRuM1ZBrP1wqFuTnNq32/Fge5N3EJKRr+64W6FJa48y/FtSZJXRMEwWDd j32UM9lpYbm1Q6c0aTMv42uLamfN6Lpf/XzJjEs2BdVO8vumq9RFMIswA+JbNTj9TsEo lUP1UooTY7dTofCSK4iKLszBmzdeyIpmze8k812hr99xasQxiG1ui/ZmjnPTZcsLCh28 o6NNTEIs2WyKpLeiGcLTGM6Ll3O0G6nPVKhjTystwzQll7GUJmBO6nBukB1d3Jx8NY19 GhoCgSauJQmJTB0tr0eJVipkZtU4oAvZPgyDylRh/yPnH9wToR2H5GjWeHVCgNdLrzd7 t+CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HLjHtvA0; 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 w138si2748145ybg.321.2020.12.08.10.09.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Dec 2020 10:09:03 -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=HLjHtvA0; 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]:41790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kmhQ6-0004V7-K3 for patch@linaro.org; Tue, 08 Dec 2020 13:09:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmhIv-0007Xg-MP for qemu-devel@nongnu.org; Tue, 08 Dec 2020 13:01:37 -0500 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]:34569) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kmhIq-0006LZ-Uj for qemu-devel@nongnu.org; Tue, 08 Dec 2020 13:01:37 -0500 Received: by mail-oi1-x22b.google.com with SMTP id s75so17233527oih.1 for ; Tue, 08 Dec 2020 10:01:31 -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=wXxlIHEHV0RVDyckAtbEiZsJCIXIPBDl5ZKGc44kZZY=; b=HLjHtvA0lWB8x7nePXTlbZplRmtil20swZHbwsJjXiZBDzVJjtx7j4FF/9VViwRd/Q Pvk6c4hbY+ozKQ2FcNkg1H8s+/9LOTB+d+RXw1QUdfR2VeB0Ltx02UWxbJ2EjSfFQERE uG609SXQg36wYiRUFE4q1Skt4AKKTrB1JLtIscMGOFurQ6m1O1r60pOXRU3snqqUcVNc IqmX74DA2niLK6cJn4t71DT22W/DM1KDHZqoCl8jGCtIngGEMQ3vppiWl6KDcAzC4GVe voaaDauT6ntGVRyFbQTwnd6uLZ3sWUP7Wy+Ggk3Lra8my/MYT8vhuuUqrs/TKI763r7B SrCA== 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=wXxlIHEHV0RVDyckAtbEiZsJCIXIPBDl5ZKGc44kZZY=; b=GAV3HDCTdNlLNc2adAOT4pV3+SlXayKaFZ9SQ0YGq1bS8axgV3K2lEv6eiJkJ2C7bP wNhRyh+OgHkxTcCtaQ3de2S8O5ZwbYK8DaVyR0YWLaCetYYXCu37B0Z5DvNWgxvlrN+P xJFf9REH5/X3LDO22V7cdJZCbrYHUnxqJ41s2829xM5aqV0Cf1J1g1P0uWckucWnVtTZ XEH/mksUpTzuYr+mZCnO5tXXrOAcebTH2ScscZa7oXghnPIbizTObXgewGjo5uDQG5Cq 9AqS29Cn74SLJVduPjNjckwMMi8/qXYsbz1EBWLj+xzIuwSWJ8jj7JBhiAMQGjMbgqCs DiVg== X-Gm-Message-State: AOAM533SmM07r+RdqWQEae+AYH/bauzNjQLvzjOwRIO9kO3OWd6Qqzle 8I72/6gQyV4eGanyfuMFGa1WUcHcxZYlGQNj X-Received: by 2002:aca:bb0b:: with SMTP id l11mr3630747oif.16.1607450489984; Tue, 08 Dec 2020 10:01:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Dec 2020 10:01:29 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 06/24] target/arm: Adjust gen_aa32_{ld, st}_i64 for align+endianness Date: Tue, 8 Dec 2020 12:01:00 -0600 Message-Id: <20201208180118.157911-7-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::22b; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22b.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. 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 Reviewed-by: Peter Maydell diff --git a/target/arm/translate.c b/target/arm/translate.c index ef9192cf6b..f6007c23a6 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -916,6 +916,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) { @@ -928,6 +959,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) \ @@ -942,47 +985,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); }