From: "Alex Bennée" <alex.bennee@linaro.org>
To: peter.maydell@linaro.org
Cc: Dave.Martin@arm.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: [Qemu-devel] [RISU PATCH 10/10] risu_reginfo_aarch64: add SVE support to reginfo_dump_mismatch
Date: Tue, 7 Nov 2017 15:05:58 +0000 [thread overview]
Message-ID: <20171107150558.22131-11-alex.bennee@linaro.org> (raw)
In-Reply-To: <20171107150558.22131-1-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
risu_reginfo_aarch64.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/risu_reginfo_aarch64.c b/risu_reginfo_aarch64.c
index 7c97790..8aba192 100644
--- a/risu_reginfo_aarch64.c
+++ b/risu_reginfo_aarch64.c
@@ -141,6 +141,18 @@ int reginfo_is_eq(struct reginfo *r1, struct reginfo *r2)
return memcmp(r1, r2, sizeof(*r1)) == 0;
}
+#ifdef SVE_MAGIC
+static int sve_zreg_is_eq(struct reginfo *r1, struct reginfo *r2, int z)
+{
+ return memcmp(r1->zregs[z], r2->zregs[z], sizeof(*r1->zregs[z])) == 0;
+}
+
+static int sve_preg_is_eq(struct reginfo *r1, struct reginfo *r2, int p)
+{
+ return memcmp(r1->pregs[p], r2->pregs[p], sizeof(*r1->pregs[p])) == 0;
+}
+#endif
+
/* reginfo_dump: print state to a stream, returns nonzero on success */
int reginfo_dump(struct reginfo *ri, FILE * f)
{
@@ -216,5 +228,42 @@ int reginfo_dump_mismatch(struct reginfo *m, struct reginfo *a, FILE * f)
}
}
+#ifdef SVE_MAGIC
+ if (test_sve) {
+ if (m->vl != a->vl) {
+ fprintf(f, " SVE VL : %d vs %d\n", m->vl, a->vl);
+ }
+ for (i = 0; i < SVE_NUM_PREGS; i++) {
+ if (!sve_preg_is_eq(m, a, i)) {
+ int q;
+ fprintf(f, " P%2d : ", i);
+ for (q = 0; q < sve_vq_from_vl(m->vl); q++) {
+ fprintf(f, "%04x", m->pregs[i][q]);
+ }
+ fprintf(f, " vs ");
+ for (q = 0; q < sve_vq_from_vl(m->vl); q++) {
+ fprintf(f, "%04x", a->pregs[i][q]);
+ }
+ fprintf(f, "\n");
+ }
+ }
+ for (i = 0; i < SVE_NUM_ZREGS; i++) {
+ if (!sve_zreg_is_eq(m, a, i)) {
+ int q;
+ char *pad="";
+ fprintf(f, " Z%2d : ", i);
+ for (q = 0; q < sve_vq_from_vl(m->vl); q++) {
+ if (m->zregs[i][q] != a->zregs[i][q]) {
+ fprintf(f, "%sq%02d: %016" PRIx64 "%016" PRIx64 " vs %016" PRIx64 "%016" PRIx64"\n", pad, q,
+ (uint64_t) (m->zregs[i][q] >> 64), (uint64_t) m->zregs[i][q],
+ (uint64_t) (a->zregs[i][q] >> 64), (uint64_t) a->zregs[i][q]);
+ pad = " ";
+ }
+ }
+ }
+ }
+ }
+#endif
+
return !ferror(f);
}
--
2.14.2
next prev parent reply other threads:[~2017-11-07 15:06 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-07 15:05 [Qemu-devel] [RISU PATCH 00/10] Initial support for SVE Alex Bennée
2017-11-07 15:05 ` [Qemu-devel] [RISU PATCH 01/10] build-all-arches: drop -t (for tty) from docker invocation Alex Bennée
2017-11-07 15:05 ` [Qemu-devel] [RISU PATCH 02/10] risu.c: split out setting up options Alex Bennée
2017-11-07 15:05 ` [Qemu-devel] [RISU PATCH 03/10] risu.c: add missing --trace longopt Alex Bennée
2017-11-07 15:05 ` [Qemu-devel] [RISU PATCH 04/10] risu: move optional args to each architecture Alex Bennée
2017-11-09 8:13 ` Richard Henderson
2017-11-07 15:05 ` [Qemu-devel] [RISU PATCH 05/10] configure: allow repeated invocation of configure in build dir Alex Bennée
2017-11-07 15:05 ` [Qemu-devel] [RISU PATCH 06/10] configure: support CPPFLAGS Alex Bennée
2017-11-08 10:34 ` Dave Martin
2017-11-08 11:02 ` Alex Bennée
2017-11-07 15:05 ` [Qemu-devel] [RISU PATCH 07/10] risugen: add --sve support Alex Bennée
2017-11-09 8:18 ` Richard Henderson
2017-11-09 12:21 ` Dave Martin
2017-11-09 14:50 ` Alex Bennée
2017-11-07 15:05 ` [Qemu-devel] [RISU PATCH 08/10] aarch64.risu: initial SVE instruction Alex Bennée
2017-11-07 15:05 ` [Qemu-devel] [RISU PATCH 09/10] risu_reginfo_aarch64: add reginfo_copy_sve Alex Bennée
2017-11-08 10:46 ` Dave Martin
2017-11-07 15:05 ` Alex Bennée [this message]
2017-11-08 10:58 ` [Qemu-devel] [RISU PATCH 10/10] risu_reginfo_aarch64: add SVE support to reginfo_dump_mismatch Dave Martin
2017-11-08 11:41 ` Alex Bennée
2017-11-08 10:36 ` [Qemu-devel] [RISU PATCH 00/10] Initial support for SVE Dave Martin
2017-11-08 11:02 ` Alex Bennée
2017-11-08 11:12 ` Dave Martin
2017-11-21 16:51 ` 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=20171107150558.22131-11-alex.bennee@linaro.org \
--to=alex.bennee@linaro.org \
--cc=Dave.Martin@arm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.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).