From patchwork Wed Jun 27 04:32:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 140091 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp385159ljj; Tue, 26 Jun 2018 21:37:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcZvvkPCLUKIw9n5KGHFFqd7QiR1P5gASiNjYFKKqYffAIZIqTVQ0eBcb5rGECF3Et/ZzNZ X-Received: by 2002:a0c:98d1:: with SMTP id g17-v6mr4027005qvd.27.1530074235979; Tue, 26 Jun 2018 21:37:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530074235; cv=none; d=google.com; s=arc-20160816; b=nlQO7pE5BKvaZ6gBZ5fZdCkBE+uvxHeB/7gXvEGlCHSBEsjyr6ByLSRUcuGzW/yU5i U8QQ9biHJxGErkJjwIFqN60zTOZNR6gXZD5TDey0Dj0/Fn709F2op8SKNbiHqyOEOS7C vvYbn6cXUkCJ9j4kkZheh2h0jTWrVGzS0RZbHyv8/4VgmCqg69JCw7q51ApdAUnGcVI5 5U+vWsbk+1MWHTvdJF9NBsJwRMpv1/236U1szEoDlRi/wRf4EOofz2hQy6I8y8SMEnsI SHqCUB5+2QAo2qqPQ+WsgA9n8LCLIacxIvMxbtOh/WKIJE5Wz8gHfQ7/q9yFqr06Gbb3 O5iQ== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=h035EMECAETS5Qbemtcsd16Nx9M5+Aleay4ARYrkoMU=; b=sXZMGN+bYSHqqTSJsaZrJwj2cMpGNNCX0dLgS52Aa3CCVjspdVDer/m0cSeZY1bHTl ZNtTLDJqZjoRBWfnrb85PGvIcJsQQhuaTzouM+a4Ro6fi32oi3e53jBQbW5jvYbA697d AJIWqSVHpXm66gBQiSVn41df4uG0OAnk2pqzCstg/MQWrdzwqWDza3ByBNcveuHWwTz2 tx7ZiyxvxAQ9+bUWzoaMbVu6Shex/egF9SmsQPvuxo6+2b0JlPbPT679gYPG/P9L95mX TbJ5zmhsm3907oJ5jRmN8BY7BAg64LFfHT0Y8hRZZ5kU8YiOHMjrR0l/obO1Tkc28uRv u2XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=dwhYF9Be; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id y3-v6si512761qkc.401.2018.06.26.21.37.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 26 Jun 2018 21:37:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=dwhYF9Be; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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]:56490 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fY2Ch-0006oL-Cn for patch@linaro.org; Wed, 27 Jun 2018 00:37:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fY29D-00043Y-Ve for qemu-devel@nongnu.org; Wed, 27 Jun 2018 00:33:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fY29C-000065-Aw for qemu-devel@nongnu.org; Wed, 27 Jun 2018 00:33:39 -0400 Received: from mail-pf0-x229.google.com ([2607:f8b0:400e:c00::229]:33701) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fY29C-0008WR-4G for qemu-devel@nongnu.org; Wed, 27 Jun 2018 00:33:38 -0400 Received: by mail-pf0-x229.google.com with SMTP id b17-v6so391105pfi.0 for ; Tue, 26 Jun 2018 21:33:38 -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; bh=h035EMECAETS5Qbemtcsd16Nx9M5+Aleay4ARYrkoMU=; b=dwhYF9Be/IrvgBbsEyF7HHE9Egfxd6iRYwvv/w+k820hGF/IQLKW5X5LWEXVb1uGV1 fUgaDFxMpZw0OE2sRkF0ei6eWKfGTilkU0Ft62bFyE9t1GyIWV2rDHMG1+ez7v79GsCE DLGqgJzNVs3odU2klwtgqZGRHRUKlgIt8JVeg= 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; bh=h035EMECAETS5Qbemtcsd16Nx9M5+Aleay4ARYrkoMU=; b=Yu1hrnH+Qy/z5Zskznf6ORQiKERdMO9XTuk7mHGZ/pUZJmuubj5uKqGiOcWoPnTLdj Kts7PhvQfGGpCmlgKyJpNXwcqmflnSu1haajduhiYP+2wYZEsc0gqm5pf8LS8mevYC0M 9zT/pDPDe2qOejpuNFHTwuzfPoZqjkZqL3jvYVy8W/cZ6DBh9tSkVD3BBlOzdbOt66Ho tK9J0xjY5IbhwnrYx4B8m++rMcVVYyyssgUCq2MeeBsTPZYq5UuIUJWggauGWbRK1Z7u ilP9CqBMEkIQ6OyUyUTYzZs7RQFxh9+cgohkn3tcM8ELgfLMgaxwbAtSXHP1WBHC2/Vp l6gA== X-Gm-Message-State: APt69E2WagPAayo7edmD6OhlVmSUw9i5qP0nwhwKIx1SqXny6DXmnE9X 5cM129s337s/UDrW0XmrRjROVWWyx3U= X-Received: by 2002:a63:b047:: with SMTP id z7-v6mr3399792pgo.335.1530074016943; Tue, 26 Jun 2018 21:33:36 -0700 (PDT) Received: from cloudburst.twiddle.net (97-126-112-211.tukw.qwest.net. [97.126.112.211]) by smtp.gmail.com with ESMTPSA id p20-v6sm4577638pff.90.2018.06.26.21.33.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Jun 2018 21:33:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 26 Jun 2018 21:32:57 -0700 Message-Id: <20180627043328.11531-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180627043328.11531-1-richard.henderson@linaro.org> References: <20180627043328.11531-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::229 Subject: [Qemu-devel] [PATCH v6 04/35] target/arm: Implement SVE load and broadcast quadword X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 52 ++++++++++++++++++++++++++++++++++++++ target/arm/sve.decode | 9 +++++++ 2 files changed, 61 insertions(+) -- 2.17.1 diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index b25fe96b77..83de87ee0e 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -3717,6 +3717,58 @@ static bool trans_LDNF1_zpri(DisasContext *s, arg_rpri_load *a, uint32_t insn) return true; } +static void do_ldrq(DisasContext *s, int zt, int pg, TCGv_i64 addr, int msz) +{ + static gen_helper_gvec_mem * const fns[4] = { + gen_helper_sve_ld1bb_r, gen_helper_sve_ld1hh_r, + gen_helper_sve_ld1ss_r, gen_helper_sve_ld1dd_r, + }; + unsigned vsz = vec_full_reg_size(s); + TCGv_ptr t_pg; + TCGv_i32 desc; + + /* Load the first quadword using the normal predicated load helpers. */ + desc = tcg_const_i32(simd_desc(16, 16, zt)); + t_pg = tcg_temp_new_ptr(); + + tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg)); + fns[msz](cpu_env, t_pg, addr, desc); + + tcg_temp_free_ptr(t_pg); + tcg_temp_free_i32(desc); + + /* Replicate that first quadword. */ + if (vsz > 16) { + unsigned dofs = vec_full_reg_offset(s, zt); + tcg_gen_gvec_dup_mem(4, dofs + 16, dofs, vsz - 16, vsz - 16); + } +} + +static bool trans_LD1RQ_zprr(DisasContext *s, arg_rprr_load *a, uint32_t insn) +{ + if (a->rm == 31) { + return false; + } + if (sve_access_check(s)) { + int msz = dtype_msz(a->dtype); + TCGv_i64 addr = new_tmp_a64(s); + tcg_gen_shli_i64(addr, cpu_reg(s, a->rm), msz); + tcg_gen_add_i64(addr, addr, cpu_reg_sp(s, a->rn)); + do_ldrq(s, a->rd, a->pg, addr, msz); + } + return true; +} + +static bool trans_LD1RQ_zpri(DisasContext *s, arg_rpri_load *a, uint32_t insn) +{ + if (sve_access_check(s)) { + TCGv_i64 addr = new_tmp_a64(s); + tcg_gen_addi_i64(addr, cpu_reg_sp(s, a->rn), a->imm * 16); + do_ldrq(s, a->rd, a->pg, addr, dtype_msz(a->dtype)); + } + return true; +} + static void do_st_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr, int msz, int esz, int nreg) { diff --git a/target/arm/sve.decode b/target/arm/sve.decode index 6e159faaec..606c4f623c 100644 --- a/target/arm/sve.decode +++ b/target/arm/sve.decode @@ -715,6 +715,15 @@ LD_zprr 1010010 .. nreg:2 ..... 110 ... ..... ..... @rprr_load_msz # LD2B, LD2H, LD2W, LD2D; etc. LD_zpri 1010010 .. nreg:2 0.... 111 ... ..... ..... @rpri_load_msz +# SVE load and broadcast quadword (scalar plus scalar) +LD1RQ_zprr 1010010 .. 00 ..... 000 ... ..... ..... \ + @rprr_load_msz nreg=0 + +# SVE load and broadcast quadword (scalar plus immediate) +# LD1RQB, LD1RQH, LD1RQS, LD1RQD +LD1RQ_zpri 1010010 .. 00 0.... 001 ... ..... ..... \ + @rpri_load_msz nreg=0 + ### SVE Memory Store Group # SVE contiguous store (scalar plus immediate)