From patchwork Thu Aug 9 04:21: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: 143668 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1608229ljj; Wed, 8 Aug 2018 21:31:19 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx/HXmSidIRmS4nqx/evzta+szOUUVTcdSwrjQVCQ8L7IwPBGu0iPWHnWpp7TidIoN2MWT3 X-Received: by 2002:a37:3106:: with SMTP id x6-v6mr444535qkx.366.1533789079495; Wed, 08 Aug 2018 21:31:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533789079; cv=none; d=google.com; s=arc-20160816; b=JyAxOy0v4YnwO8mAUm7wPoajUtxX37As7BnVCVNPED49OtQ3TG8Af4hwERjzQIs9ln 0GcaIoX5a9IsTbNdHJMdJIpakgXM2Q5P+nQBarjVb3vRjJbGJU1YWQfIOP2tPYVEpeWQ zXDnRlm/Nv3T3vD7j7m8SrnGRJ1al8js94lVNTLP0AF3O+/Wo0Y8B89c9c6fBZBd/701 +frFpa0PNg6cg7tGxgN4SKr583sUa6lUhRn2csBvftMyOGaBnnf8ZMT+QzqsWi+e23IG m+RXu3lpHtD25JW8vAcOrsdiwwGc/zZgP0RgqLHxakupZOHPmX+jmYmfpN7xW4NSRUxL W7Nw== 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=Ze8ZdJDqn6zsWMoBANBrHY4udg1WT+Qa4bIr6PsHaec=; b=iMHgrlT5aMzLoeUyfvmE7DuEVG8eazd12aApCVxRoTaGxPxZMOFpogh1ho310BFEos SisQP/OrBpnH1vFzMktOzLZswquIt+qTV+0Oba3MgS4lYfrQ4mYwIohzGlthvKUd1Ysu BWMJ8y2TYkmY3tlSkUwI5HrhE4NWIr9M6eYKb7i6XJ7dV2FoQX2WzsYxyKUCa8SgHKwS n7+WsboxRj5sSZqsbhKhni5ex1vsnGnnYJ653vDJ9zMsorAGFhl6JwI5bE+3pTzXdy8p LDV78uCASVCPTROTKajxsVeY6wulV5PasIWnACqbn1+aKRmF8EPLcXsmUuCjmWM+8Ggv +tbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="e/qei9Cv"; 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 z2-v6si1975527qvi.288.2018.08.08.21.31.19 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 08 Aug 2018 21:31:19 -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="e/qei9Cv"; 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]:47273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fncbW-0000zX-Un for patch@linaro.org; Thu, 09 Aug 2018 00:31:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fncSw-0000sl-GW for qemu-devel@nongnu.org; Thu, 09 Aug 2018 00:22:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fncSv-0007Kh-KA for qemu-devel@nongnu.org; Thu, 09 Aug 2018 00:22:26 -0400 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]:41706) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fncSv-0007K5-DF for qemu-devel@nongnu.org; Thu, 09 Aug 2018 00:22:25 -0400 Received: by mail-pg1-x52d.google.com with SMTP id z8-v6so2107869pgu.8 for ; Wed, 08 Aug 2018 21:22:25 -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=Ze8ZdJDqn6zsWMoBANBrHY4udg1WT+Qa4bIr6PsHaec=; b=e/qei9CvSkQMXtMVhwDal6FZ1VIphr0EApU1biWvNhpHqkEkZyyRT1iHuuRWhzFbXT TzX49Hxg/x46ngiKk7wIfSecasLKnfmP73iZ7YTYJNCmkurTSF/7s1FdeRwsN0Ns4Qhy 5Xfg9+8pcLKXpkZIE+EdJCA+oiiBtq6XhhpwE= 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=Ze8ZdJDqn6zsWMoBANBrHY4udg1WT+Qa4bIr6PsHaec=; b=cKvUm1vhxfACQ6M9ls42JQ+TiRLowZYUV428i0FkouIaR5zDfLs6deo+FMlJbx19Gu uXIN2pUgkZoLU5hl673vYe8Q8HI7PZHoEUK5t/sfqUmB9fD91MQhiTWwi+Cfw2h5Az1w IFmh5DJDoe/+b8SQvoyt9cJ/yR9km16nwhkDKh8Un8GOq1amQ5ow6xW5vIlFbB6L4Yoc Qab7K8994NOy4qtyVEEua/20GDTHqU0s7Y3phMSQn0J0HIs/aGwSgYQ21GrcOZqeWtIp k0rWBBjWr9m3TC2Q7UPFTBL50aiIu3VKLhFc70aTuYZ4kengbK5MsbT2ihLMrXew39Sm QP0g== X-Gm-Message-State: AOUpUlEMOb/rlOKJUfRujOYP0Gs6CBbBpe9es2PXi5+y2ibMXSeT2O6v YIF5LB4vrLgF6T1auui/lv8SohlD/E4= X-Received: by 2002:a63:5055:: with SMTP id q21-v6mr466933pgl.397.1533788544191; Wed, 08 Aug 2018 21:22:24 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-8-179.tukw.qwest.net. [97.113.8.179]) by smtp.gmail.com with ESMTPSA id m30-v6sm7355799pff.121.2018.08.08.21.22.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Aug 2018 21:22:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 8 Aug 2018 21:21:57 -0700 Message-Id: <20180809042206.15726-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180809042206.15726-1-richard.henderson@linaro.org> References: <20180809042206.15726-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::52d Subject: [Qemu-devel] [PATCH 11/20] 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: laurent.desnogues@gmail.com, peter.maydell@linaro.org, alex.bennee@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. Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) -- 2.17.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index d27bc8c946..bef6b8242d 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);