From patchwork Fri Oct 5 17:53:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 148276 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp750303lji; Fri, 5 Oct 2018 10:59:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV6164CjqCIjpb4EsyVhvhPtzQ8sIeLE35OCbTf/CcMZcSG73wj0aymPuZaC8D+rpR/GtGvHz X-Received: by 2002:ac8:19ea:: with SMTP id s39-v6mr10504868qtk.215.1538762394162; Fri, 05 Oct 2018 10:59:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538762394; cv=none; d=google.com; s=arc-20160816; b=Kg0cX9TvgTPM+nKDU3AlYqr0WDdNJsyvPXSEElM+CuTb2BWW32geDnET0stN3hsnuU e56/xzkQrq/v+xiTYch1tjSynySBbNqN+cPYOVoGqU4f0oQyij75dJLkY9tPBnbKQYXr XVHyLvtf17nQuJg2kN6XnyWgrb2eQwF/ZcQ7Zm3cmOscBVvk9eDg26qtxkZC7dfx10Lp QGeuNfAtfMfLKADvqxz8Nl4J1tlnSUpxUdCdwfLS5+QG1I8fYAipUmUJ2G4H3OEXb/D4 iSYuo46vRPKGsiq1UVqcOFJIGenmZycKi0EE16ZbOMF5Pt5LPgbwXqdPdPprHufZu8Wh bjcQ== 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; bh=Wa0S3nmn1HaVu2lW4OElBa7HOa0h0GV4mFJ6npvD1JM=; b=bHDOpamkPITMsNZpBl+DhWH82/Gve06omfT+53Q49MDuHpMJYQhBqSBQHnMIT5JJHw EpIWcdiyfQpdtjVd21lI1WnrXBqneJt4DOkY2+h9OzlPtaT2OBE7BrORnplGO2tz68hz EN+7KZd1+mnKeN6IjofIH5zTEx7bximTp+lMPOmiKJFiKwA4WpnLeQCgOjV3mwiclk7A zj79TFp8DLtvK1gaDg/pUbR48Ed9tBuy2RhMkYnVrCv3XHcPmtIZPyhjl91462xecmVY FDrxb77S3VcDeBF7hTW9HDNztenxqKljuDAbvQpABBwXp7opcvhIyju9diGc65U7gV1g jS/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Z3Pw3+8d; 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 q45-v6si18331qtb.265.2018.10.05.10.59.53 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 05 Oct 2018 10:59:54 -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=Z3Pw3+8d; 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]:36356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8UOH-0006hr-IR for patch@linaro.org; Fri, 05 Oct 2018 13:59:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8UIk-00016O-02 for qemu-devel@nongnu.org; Fri, 05 Oct 2018 13:54:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8UIg-0003JQ-Qx for qemu-devel@nongnu.org; Fri, 05 Oct 2018 13:54:09 -0400 Received: from mail-ot1-x334.google.com ([2607:f8b0:4864:20::334]:45487) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g8UIg-0003J4-JU for qemu-devel@nongnu.org; Fri, 05 Oct 2018 13:54:06 -0400 Received: by mail-ot1-x334.google.com with SMTP id u22so13485048ota.12 for ; Fri, 05 Oct 2018 10:54:06 -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=Wa0S3nmn1HaVu2lW4OElBa7HOa0h0GV4mFJ6npvD1JM=; b=Z3Pw3+8dSrnVYzyLc09U7NRJzJ+t66juIZNS880sAcZ6Fr6kr3vxX7NSK44b0tTDKS gk47zVUvczWhXUgQGSyHa/d2JGkf2GA0mxMNAbk2c7zYo2Yl8us72KMLDpMUmmnC5haN 2mjaRQOVjd3Zl5+11QIMmh1GUoB8xelkVKu18= 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=Wa0S3nmn1HaVu2lW4OElBa7HOa0h0GV4mFJ6npvD1JM=; b=h00hPZ1zik0fO8+GSR3MnNcVzzZRu7+cdr+axKU8FtXFZm5DMMIWN1RwwkyXhsvxBz +C9537VWkC0/cZgMa31xiMJnNzyHcYJgxU0GpsXtcWnetFbZ8LBiyn8vf4nS9ZsaaqlH 3X7I0ylJzmRy0sH52onm00QAGB4Wlg1qM/E255SWCT6Qk7NJWGN9YI1I976EeMSZoQfG DXhzeIpf0zlGEN6G9iIYEoHiScRcBg4Fnl8HrqfPtJ+TS5FD1RIdZXr3WK+pBgPqqRI1 6muvr6Wyrga6Do189sasjCboSWLh1Aq3FDYH1kqJOtJ5i4+rp+etuqcJE31HEgbcZdFY f17A== X-Gm-Message-State: ABuFfohk/x4OMfLB/s6uSGGcj0FOvu5K6pNp+pmdK6Os6CK6sBx6NGq2 rwo4GZ4TjFEZCfQ+KABetW53EF6UZzMVsg== X-Received: by 2002:a9d:569c:: with SMTP id o28mr7314665oth.332.1538762045457; Fri, 05 Oct 2018 10:54:05 -0700 (PDT) Received: from cloudburst.twiddle.net ([187.217.230.84]) by smtp.gmail.com with ESMTPSA id q10-v6sm2672278otg.31.2018.10.05.10.54.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Oct 2018 10:54:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 5 Oct 2018 12:53:41 -0500 Message-Id: <20181005175350.30752-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181005175350.30752-1-richard.henderson@linaro.org> References: <20181005175350.30752-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::334 Subject: [Qemu-devel] [PATCH v3 06/15] target/arm: Clear unused predicate bits for LD1RQ 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" The 16-byte load only uses 16 predicate bits. But while reusing the other load infrastructure, we find other bits that are set and trigger an assert. To avoid this and retain the assert, zero-extend the predicate that we pass to the LD1 helper. Tested-by: Laurent Desnogues Reported-by: Laurent Desnogues Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 667879564f..4ee3bbca29 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -4765,12 +4765,33 @@ static void do_ldrq(DisasContext *s, int zt, int pg, TCGv_i64 addr, int msz) unsigned vsz = vec_full_reg_size(s); TCGv_ptr t_pg; TCGv_i32 desc; + int poff; /* 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)); + poff = pred_full_reg_offset(s, pg); + if (vsz > 16) { + /* + * Zero-extend the first 16 bits of the predicate into a temporary. + * This avoids triggering an assert making sure we don't have bits + * set within a predicate beyond VQ, but we have lowered VQ to 1 + * for this load operation. + */ + TCGv_i64 tmp = tcg_temp_new_i64(); +#ifdef HOST_WORDS_BIGENDIAN + poff += 6; +#endif + tcg_gen_ld16u_i64(tmp, cpu_env, poff); + + poff = offsetof(CPUARMState, vfp.preg_tmp); + tcg_gen_st_i64(tmp, cpu_env, poff); + tcg_temp_free_i64(tmp); + } + + t_pg = tcg_temp_new_ptr(); + tcg_gen_addi_ptr(t_pg, cpu_env, poff); + fns[msz](cpu_env, t_pg, addr, desc); tcg_temp_free_ptr(t_pg);