From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [Qemu-devel] [PATCH v3 06/15] target/arm: Clear unused predicate bits for LD1RQ
Date: Fri, 5 Oct 2018 12:53:41 -0500 [thread overview]
Message-ID: <20181005175350.30752-7-richard.henderson@linaro.org> (raw)
In-Reply-To: <20181005175350.30752-1-richard.henderson@linaro.org>
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 <laurent.desnogues@gmail.com>
Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/translate-sve.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
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);
--
2.17.1
next prev parent reply other threads:[~2018-10-05 17:54 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-05 17:53 [Qemu-devel] [PATCH v3 00/15] target/arm: sve system mode patches Richard Henderson
2018-10-05 17:53 ` [Qemu-devel] [PATCH v3 01/15] target/arm: Define ID_AA64ZFR0_EL1 Richard Henderson
2018-10-05 17:53 ` [Qemu-devel] [PATCH v3 02/15] target/arm: Adjust sve_exception_el Richard Henderson
2018-10-05 17:53 ` [Qemu-devel] [PATCH v3 03/15] target/arm: Pass in current_el to fp and sve_exception_el Richard Henderson
2018-10-05 17:53 ` [Qemu-devel] [PATCH v3 04/15] target/arm: Handle SVE vector length changes in system mode Richard Henderson
2018-10-05 17:53 ` [Qemu-devel] [PATCH v3 05/15] target/arm: Adjust aarch64_cpu_dump_state for system mode SVE Richard Henderson
2018-10-05 17:53 ` Richard Henderson [this message]
2018-10-05 17:53 ` [Qemu-devel] [PATCH v3 07/15] target/arm: Rewrite helper_sve_ld1*_r using pages Richard Henderson
2018-10-05 17:53 ` [Qemu-devel] [PATCH v3 08/15] target/arm: Rewrite helper_sve_ld[234]*_r Richard Henderson
2018-10-05 17:53 ` [Qemu-devel] [PATCH v3 09/15] target/arm: Rewrite helper_sve_st[1234]*_r Richard Henderson
2018-10-05 17:53 ` [Qemu-devel] [PATCH v3 10/15] target/arm: Split contiguous loads for endianness Richard Henderson
2018-10-05 17:53 ` [Qemu-devel] [PATCH v3 11/15] target/arm: Split contiguous stores " Richard Henderson
2018-10-05 17:53 ` [Qemu-devel] [PATCH v3 12/15] target/arm: Rewrite vector gather loads Richard Henderson
2018-10-05 17:53 ` [Qemu-devel] [PATCH v3 13/15] target/arm: Rewrite vector gather stores Richard Henderson
2018-10-05 17:53 ` [Qemu-devel] [PATCH v3 14/15] target/arm: Rewrite vector gather first-fault loads Richard Henderson
2018-10-05 17:53 ` [Qemu-devel] [PATCH v3 15/15] target/arm: Pass TCGMemOpIdx to sve memory helpers Richard Henderson
2018-10-08 10:14 ` [Qemu-devel] [PATCH v3 00/15] target/arm: sve system mode patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181005175350.30752-7-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).