From patchwork Thu Jun 21 01:53:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 139407 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1471999lji; Wed, 20 Jun 2018 19:00:19 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIXfsCij695VfyHGhBH539i+J/nClMaBQ7Tyw1O/97CWHLdAmYjwJNYp23hGi5O3GquSTdM X-Received: by 2002:ac8:2f99:: with SMTP id l25-v6mr20402808qta.166.1529546419006; Wed, 20 Jun 2018 19:00:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529546419; cv=none; d=google.com; s=arc-20160816; b=Nu1rtgBldX05TWQimWzNFurdpZ51WBujn8Ezn7n7K2cafXLpq+7mknTrH2XcXXOJsl +nLLLvb9vV2nLCFD0dKHR5GoS1LPMdmPmfeDAsoqDbs679yyDhIk/nMX+R1dAWAcqG9O qrw6w+GvNB9oeGc7+nqOZx1z/aZM0WCcH4N1I8s2piuC8rtNnFVVlDCIuLKFnym9syof Oleds/9MaiFxIgI4F3H5AUbHPMTTs//pKk2FqbgYBNX1bfqlandMguFKvQH09jnFtzEQ okG0K/8AgCMl+j2YG/jSNfGWqcXUAtJWxDBfjq3jCzhMQZZgrgbyvFE739+VB3G08F3i IueA== 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=MIKKw3KUuErnHai2QdqLnnCjJ3TTAEPOo7LFHNMeMjQ=; b=j/3cIYf8JRWmetp9Vk2FYSi7B8YZt141ChiU884d3H+sy0h7mhuh2CujQjrakiCJZn J7h5SQhFOyqeaaQetJIMEbMZ2VTQ31GJzkCv7yN+vs4hbx0l+aUnLNiR4fheOj0DkKhi Gstcm9cPOBF4mnBAXZ/7xseL23BpZjNNBk9640DWbiRJgfiD6e5Srj6jrOrbLth4BwOW 3GQkFLXdKN5x4pUtB5xe/hvUKzjpNTRGYqSJomBV6feBydI6mFHNXXyBAEPxPh6HBAWI IVupI+xJKCgrJmcocU30B/7dGJAbyzpcLxkiZkpo8V5CxNGK6XSY1FI+JcpgqbXYWp+G BwhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Exx/AZ1e"; 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 o19-v6si3145354qtb.380.2018.06.20.19.00.18 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 20 Jun 2018 19:00:18 -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="Exx/AZ1e"; 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]:52506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVotW-0000UX-Ee for patch@linaro.org; Wed, 20 Jun 2018 22:00:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVonf-0003zF-GI for qemu-devel@nongnu.org; Wed, 20 Jun 2018 21:54:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVone-0002yc-JI for qemu-devel@nongnu.org; Wed, 20 Jun 2018 21:54:15 -0400 Received: from mail-pf0-x234.google.com ([2607:f8b0:400e:c00::234]:41725) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fVone-0002xp-DW for qemu-devel@nongnu.org; Wed, 20 Jun 2018 21:54:14 -0400 Received: by mail-pf0-x234.google.com with SMTP id a11-v6so683565pff.8 for ; Wed, 20 Jun 2018 18:54:14 -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=MIKKw3KUuErnHai2QdqLnnCjJ3TTAEPOo7LFHNMeMjQ=; b=Exx/AZ1ezbHNXloM/rQKKAhGXVwwQbf8w2RLsNmYkRhuRm8qZqCGQoMUAf79ON8ENG bGLPAU/03nPbDkNRZV36TiFuMDMPdbn+WCrpFT5ws3+K/dczqnCtikNctVftzc9EWEa7 rZVxD7oe1Y8Nce56ZGSO76UM+iSTiDYQB+MDM= 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=MIKKw3KUuErnHai2QdqLnnCjJ3TTAEPOo7LFHNMeMjQ=; b=oz+8SNvtaV4nTqMaWDYjgAx4jFkkVatTbzhr/ikEMTLhXTGf6oc0+ew0X1eV76WgbN GPd/QN3VB+lQNsvSDLanJCC1fgppqUtHRKxQrX2Yay4ICmb+OUTdnr0vxh2KKwW/gSeb lEHvYjItiGRZiTAslrV90Rar3plbHe8ZNYFx7GBaxVrvQHwMLu4wfsa4d9z2c91Z9cvG TcQ4Mk2sPtGjLHqDTdqTNLtHP2ZC0degpYQoE6CjZxqPSpmEWrk4KK7f33dotbuaFrDu U21Q2AOEtBj4ZlEGtpxbqiReGzypmH/jdo7molBq6SjluV9Ka7EOlrJL722kEMoI6h2J lbZA== X-Gm-Message-State: APt69E35P5dg4tm3OQGIrJbXgPeVbfATKpT6ovjlhY3F2rqlYzM7FopB 1f5uMCalljPe+JEDzVbk/H/keIc4ZUc= X-Received: by 2002:a62:4556:: with SMTP id s83-v6mr25352737pfa.73.1529546053055; Wed, 20 Jun 2018 18:54:13 -0700 (PDT) Received: from cloudburst.twiddle.net (mta-98-147-121-51.hawaii.rr.com. [98.147.121.51]) by smtp.gmail.com with ESMTPSA id a27-v6sm6187946pfc.18.2018.06.20.18.54.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Jun 2018 18:54:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 20 Jun 2018 15:53:28 -1000 Message-Id: <20180621015359.12018-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180621015359.12018-1-richard.henderson@linaro.org> References: <20180621015359.12018-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::234 Subject: [Qemu-devel] [PATCH v5 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 52 ++++++++++++++++++++++++++++++++++++++ target/arm/sve.decode | 9 +++++++ 2 files changed, 61 insertions(+) -- 2.17.1 Reviewed-by: Peter Maydell Reviewed-by: Alex Bennée 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)