From patchwork Wed Sep 26 19:23:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 147652 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp1116586lji; Wed, 26 Sep 2018 12:32:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV60QAgiVo0Y8sjmQUWcsW/jeWRvbyFcyzuCypfPuNMmDCoJhuR60oNpvZvizVLjlecUAg6s9 X-Received: by 2002:a0c:e94e:: with SMTP id n14-v6mr5441905qvo.187.1537990336885; Wed, 26 Sep 2018 12:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537990336; cv=none; d=google.com; s=arc-20160816; b=hdIGroW0UOXYMRB1WA2CFiHX4KOHezQ1ByxRir65WFN+4ff7cQ78KONioefZNhT4Bh EI88EtsaYUZ5dBTZbhjXKea5CwfWTWKQdf1dj+NFZCKQs8wWJlu6kcuDqVwy3QlNhm4o dFUs5XBL2n0NzLaINqug76280mOkq+CPQOrlBCEIgAV3mv+GiUHuK0OiqCzzy/UWEO09 z5sLX8SLNFiQVmkp18CjTirHWD2wK6QpXOo/0RoRHFvDGZN76OfFuuzuyyt0Pf3UYEAH J6Yt2KlLSB0InQl9JjkixFTeN+PMmncWgaWxBFfhLYMqIjS95fxm3qsMESPM2GZdGhI2 3JOg== 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=xfoN9WKyxxTqWrNRFAkQpLIko5TyTg58dCBg15EKyaU=; b=DI/4WxmE225hrRT++5Z+H2rhScMwowxTt93dB8AKFQvApe9M/ky2ywy7yQ0Qxu4ono iQ+NBbloGxfJ6TDeFsz5ARu28dZX5TO5xJNCHcM2owZCfKKKVc54sFSlY4uED1AbPOmd yr+Um3XG/VE3m44QC5SgQi4SmzBx2Hghb/5Dpym+hPR5JbIFZAi+AgsAu6i5MKVRgNg8 pvpgXOLPJPhjmhqWvbopTdJYvNe5hFkTPpu6YZN1YSk9bfQx1FNprqn8KJI4XeU+Ow5k vQLJNxXy85MqGn+C/YEGKqW0I5g+/lGQqLYHa8+CMVuKDEGgtlSv5DeMEHjXjL79LAJp TfUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="kD/BNVtp"; 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 u32-v6si4964133qth.220.2018.09.26.12.32.16 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 26 Sep 2018 12:32:16 -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="kD/BNVtp"; 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]:60399 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5FXk-0001Ek-6y for patch@linaro.org; Wed, 26 Sep 2018 15:32:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5FPU-0001rS-RP for qemu-devel@nongnu.org; Wed, 26 Sep 2018 15:23:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5FPP-0006p6-1D for qemu-devel@nongnu.org; Wed, 26 Sep 2018 15:23:44 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:33312) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g5FPL-0006nV-6G for qemu-devel@nongnu.org; Wed, 26 Sep 2018 15:23:37 -0400 Received: by mail-pg1-x531.google.com with SMTP id y18-v6so87161pge.0 for ; Wed, 26 Sep 2018 12:23:34 -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=xfoN9WKyxxTqWrNRFAkQpLIko5TyTg58dCBg15EKyaU=; b=kD/BNVtpU+tXG1znDAKjgFaxZdhqZ8HU6BUZjvPh5/AJIsnEjoca2l8XWWb6bLB/Hi 7pa7b3NCsF875J6ocuucuYr8bjlAZEm+XK/pNCw2EXWdfeJ3P8rEz+ePPBnfeusDYUdy SWrPRFYhkX4PcZlHjz0XpBB56Y96g6ofJ6mDk= 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=xfoN9WKyxxTqWrNRFAkQpLIko5TyTg58dCBg15EKyaU=; b=bfedx4iUwePvjwvbOuRHgnk0fyrZADL4emoZRDFv17Pxk//tPAClCAAK9mecxQLYkL gIUdqtdHdib/vzjQc3phoO1SNLSuN9OZ6W+Mbf1KeweYpTM+CjcnOHVvZA/KgYqZfKPT aTvIjw5Gfeikwgqu8Ak/Jyp9A5P2Ghw3ju3HEH3ei1OloJpD/+Gz9JtVPgEguAgvTipN Ba9Xo9GkkYWaEI9YvtRKrVvWA7B1ofkA5qaTyuuHzMiqq0dEkx2E8sfF79Z2qJLMIRoM ci3GH3Zv3roGPv5RvnV29s0c7v/3byO20+eTtiU8XjbuctcsCuGZ7v+BnGXuX4WSRxj3 YTNw== X-Gm-Message-State: ABuFfogvfUnMeetFJkE50hNOoLyah/9dMriSHItwwVGLsr8XXKwPOx4R 0+ygHFSuSM4k5gRFKy8W1wa6bFJ6ME4= X-Received: by 2002:a62:8c8c:: with SMTP id m134-v6mr7722158pfd.130.1537989813642; Wed, 26 Sep 2018 12:23:33 -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 c2-v6sm8493486pfo.107.2018.09.26.12.23.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Sep 2018 12:23:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 26 Sep 2018 12:23:14 -0700 Message-Id: <20180926192323.12659-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180926192323.12659-1-richard.henderson@linaro.org> References: <20180926192323.12659-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::531 Subject: [Qemu-devel] [PATCH v2 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 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 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);