From patchwork Tue Jun 28 04:20:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 585474 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp416166mab; Mon, 27 Jun 2022 21:47:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tvB6CiFJpQIqDeVPccvj8LqrSJo10GX+q7t+VzxL7uiH8SwmOp9f8xJbg+nBNK3b2P7emF X-Received: by 2002:a05:6214:d0b:b0:470:48aa:67f8 with SMTP id 11-20020a0562140d0b00b0047048aa67f8mr924078qvh.41.1656391675406; Mon, 27 Jun 2022 21:47:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656391675; cv=none; d=google.com; s=arc-20160816; b=T1UlpwySpt+6hI+bKFpS6rFa9q6uHXUwZqheop/oPgG9AeyEgraZ1/jFqeYeUu+qat nBLsPFNfHEBW9iXMdajrdP07nRZthO7MgmITCYifv6bTOlo31NvLytgzS9DPP2zVrnvJ JV5pd8o0JNvdSu727fJx73LeG3ye71r1uEZEF2vJTHkgl6sF8NSPKoZB3l6RVLcJzX0D rLVe27cfPrwRmRb/eebYfrtN05aElkoWMYnRQ2uW5zked9xIzKYfa6TdqfQdc2Ng46gW i3EwvQmYmkfQJoWkBDpzzbHU2mwNBnjhBWVsD0YQQvin8RClJaCYpt5zeTS65aJGMXqn 2zCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=etMuVHeaAxa7UcmLEv5W86A71baIUw+lp8OsVjYF6WM=; b=aZI9tJElariz5m82uQzGxK98x813kLWlPFDttaBwfwLbM4V78TWaX99a+5Sj3NspUX 7Pyt8tt8Nwkp+AgtT/Tddnx/v87mkxsouVK7tXni4dhn4ga0cTeK0Ms8Mngw32zFecad gg77lr/WwlShZAoQdglBmRI1fW75DA66Xs6ZHeTAwl5pWiGphSJtNUDNsOKeZgrtTQiO C3T3l45ZLx/ldNAvmBqvxQhL4JBl1eBl9u+LaVneTbGwDoSyKdrWw1BfVZi9NrIbmTCD riSnU3B4jJ1+blBGRiPqWmZWju2wOmmgXS8otcuEmd572atwwZId/pYxYs2NErVMFkQB CrWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="puj1I9y/"; 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=pass (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 i13-20020ac85e4d000000b0030455ffcba7si7447537qtx.112.2022.06.27.21.47.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Jun 2022 21:47:55 -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=pass header.i=@linaro.org header.s=google header.b="puj1I9y/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o638l-0003b6-0I for patch@linaro.org; Tue, 28 Jun 2022 00:47:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o62k0-000277-9H for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:22:20 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:39682) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o62jx-0003l2-Ap for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:22:19 -0400 Received: by mail-pg1-x532.google.com with SMTP id q140so11014780pgq.6 for ; Mon, 27 Jun 2022 21:22:15 -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=etMuVHeaAxa7UcmLEv5W86A71baIUw+lp8OsVjYF6WM=; b=puj1I9y/VtHkwVJGHxevoTOBp1e2q2AntNADVlFiTKf2CkV7X5+wD8Kf7Aq+Hji1HS JXWepixmwfbIJsYQUyN/6+2VttmQ2dJtwy9F8Kj4l1h8k0/WrlsGxt0s/8nAvXwXaatJ o3Tu8LOaTqAjCpl3iWFAuKPrCMNK9Lvh4M6cXi8lz/ynUs/25mXJcTITWzEuSaMlHc6p YKP8BYJS3kSW0k1yQ0OGWjF/wmmwTfJRBbCom7SWs4oenBcGm553MVkynQJpaaqJajaL UoEaM4vpgo0jCZSZ4NjH1GfNUZOoxBvYIHlDX2wMZSI0yZVvoLdys6N/aEOY+X/cjhpY +Kdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=etMuVHeaAxa7UcmLEv5W86A71baIUw+lp8OsVjYF6WM=; b=1oWyhaxI0TK/JAAjPdg995BKpm/eZqJoZUSxNc/3j9iHfNSoITlbyhAfgzKwrFeGXy xfzfJHjdSsiOIrGXrSgxABW/HiEun8DdGxUZpjb9XKUKgOJTfiufggDRo55qsBTBRpkX OKSKXRIHBZ6uShvul9VQd8W5Pj0kr/18YrVSDeQqSuDIsMd57NMe713LYmscrCbn2Een 7bazeavb/fqCBTUZ/BkrLQWoTTq8ZYK67b+aSSD7ss3zRmYT2LlTGM/m25cveT5lqtAm j3WnmHPA+n+0znTEDAc0wE0nDHk1pERaO0TVCdwCkeJiKrGocAQbEThm9sKPIfZfd2j2 1sEw== X-Gm-Message-State: AJIora/slua1/J3EoBhGjcXqkJmMVUxKuBB4O2JxJOOJ8utjzyj60wmw W0U4Mwx4GzTsUCG/KHPMBoDozL8ynLKBzQ== X-Received: by 2002:a63:3e47:0:b0:40c:fa04:dd6e with SMTP id l68-20020a633e47000000b0040cfa04dd6emr15900035pga.224.1656390134643; Mon, 27 Jun 2022 21:22:14 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id jg6-20020a17090326c600b0016a087cfad8sm7994929plb.264.2022.06.27.21.22.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 21:22:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v4 22/45] target/arm: Implement SME LDR, STR Date: Tue, 28 Jun 2022 09:50:54 +0530 Message-Id: <20220628042117.368549-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220628042117.368549-1-richard.henderson@linaro.org> References: <20220628042117.368549-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We can reuse the SVE functions for LDR and STR, passing in the base of the ZA vector and a zero offset. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/sme.decode | 7 +++++++ target/arm/translate-sme.c | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/target/arm/sme.decode b/target/arm/sme.decode index 900e3f2a07..f1ebd857a5 100644 --- a/target/arm/sme.decode +++ b/target/arm/sme.decode @@ -46,3 +46,10 @@ LDST1 1110000 0 esz:2 st:1 rm:5 v:1 .. pg:3 rn:5 0 za_imm:4 \ &ldst rs=%mova_rs LDST1 1110000 111 st:1 rm:5 v:1 .. pg:3 rn:5 0 za_imm:4 \ &ldst esz=4 rs=%mova_rs + +&ldstr rv rn imm +@ldstr ....... ... . ...... .. ... rn:5 . imm:4 \ + &ldstr rv=%mova_rs + +LDR 1110000 100 0 000000 .. 000 ..... 0 .... @ldstr +STR 1110000 100 1 000000 .. 000 ..... 0 .... @ldstr diff --git a/target/arm/translate-sme.c b/target/arm/translate-sme.c index f9846f137f..87bbf9ab7f 100644 --- a/target/arm/translate-sme.c +++ b/target/arm/translate-sme.c @@ -246,3 +246,27 @@ static bool trans_LDST1(DisasContext *s, arg_LDST1 *a) tcg_temp_free_i64(addr); return true; } + +typedef void GenLdStR(DisasContext *, TCGv_ptr, int, int, int, int); + +static bool do_ldst_r(DisasContext *s, arg_ldstr *a, GenLdStR *fn) +{ + int svl = streaming_vec_reg_size(s); + int imm = a->imm; + TCGv_ptr base; + + if (!sme_za_enabled_check(s)) { + return true; + } + + /* ZA[n] equates to ZA0H.B[n]. */ + base = get_tile_rowcol(s, MO_8, a->rv, imm, false); + + fn(s, base, 0, svl, a->rn, imm * svl); + + tcg_temp_free_ptr(base); + return true; +} + +TRANS_FEAT(LDR, aa64_sme, do_ldst_r, a, gen_sve_ldr) +TRANS_FEAT(STR, aa64_sme, do_ldst_r, a, gen_sve_str)