From: David Hildenbrand <david@redhat.com>
To: David Miller <dmiller423@gmail.com>,
qemu-s390x@nongnu.org, qemu-devel@nongnu.org,
richard.henderson@linaro.org
Cc: pasic@linux.ibm.com, borntraeger@linux.ibm.com, thuth@redhat.com,
cohuck@redhat.com, farman@linux.ibm.com
Subject: Re: [PATCH v3 1/3] s390x/tcg: Implement Miscellaneous-Instruction-Extensions Facility 3 for the s390x
Date: Wed, 16 Feb 2022 11:31:09 +0100 [thread overview]
Message-ID: <753e5e7f-e9b9-d35f-2a7b-edbbe512edad@redhat.com> (raw)
In-Reply-To: <25fcb9f9-4314-faca-a7e3-99fbbe0541d2@gmail.com>
> +static DisasJumpType op_sel(DisasContext *s, DisasOps *o)
> +{
> + DisasCompare c;
> + disas_jcc(s, &c, get_field(s, m4));
> + tcg_gen_movcond_i64(c.cond, o->out, c.u.s64.a, c.u.s64.b,
> + o->in1, o->in2);
> + free_compare(&c);
> + return DISAS_NEXT;
> +}
I realize that SELECT really is mostly identical to LOAD ON CONDITION,
except that we have a second input.
The following on top would unify both
diff --git a/target/s390x/tcg/insn-data.def b/target/s390x/tcg/insn-data.def
index fb482b08b7..493f1d669c 100644
--- a/target/s390x/tcg/insn-data.def
+++ b/target/s390x/tcg/insn-data.def
@@ -781,8 +781,8 @@
/* SEARCH STRING UNICODE */
C(0xb9be, SRSTU, RRE, ETF3, 0, 0, 0, 0, srstu, 0)
/* SELECT */
- C(0xb9f0, SELR, RRF_a, MIE3, r2, r3, new, r1_32, sel, 0)
- C(0xb9e3, SELGR, RRF_a, MIE3, r2, r3, r1, 0, sel, 0)
+ C(0xb9f0, SELR, RRF_a, MIE3, r3, r2, new, r1_32, loc, 0)
+ C(0xb9e3, SELGR, RRF_a, MIE3, r3, r2, r1, 0, loc, 0)
/* SET ACCESS */
C(0xb24e, SAR, RRE, Z, 0, r2_o, 0, 0, sar, 0)
diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c
index d5c536c60a..7805ffe879 100644
--- a/target/s390x/tcg/translate.c
+++ b/target/s390x/tcg/translate.c
@@ -1528,16 +1528,6 @@ static DisasJumpType op_nxor(DisasContext *s, DisasOps *o)
return DISAS_NEXT;
}
-static DisasJumpType op_sel(DisasContext *s, DisasOps *o)
-{
- DisasCompare c;
- disas_jcc(s, &c, get_field(s, m4));
- tcg_gen_movcond_i64(c.cond, o->out, c.u.s64.a, c.u.s64.b,
- o->in1, o->in2);
- free_compare(&c);
- return DISAS_NEXT;
-}
-
static DisasJumpType op_ni(DisasContext *s, DisasOps *o)
{
o->in1 = tcg_temp_new_i64();
@@ -2998,7 +2988,13 @@ static DisasJumpType op_loc(DisasContext *s, DisasOps *o)
{
DisasCompare c;
- disas_jcc(s, &c, get_field(s, m3));
+ if (have_field(s, m3)) {
+ /* LOAD * ON CONDITION */
+ disas_jcc(s, &c, get_field(s, m3));
+ } else {
+ /* SELECT */
+ disas_jcc(s, &c, get_field(s, m4));
+ }
if (c.is_64) {
tcg_gen_movcond_i64(c.cond, o->out, c.u.s64.a, c.u.s64.b,
I can spot some advanced magic in op_loc for "!c.is64".
But even with that change, the SELECT test still crashes for me.
The problematic part is the last selfhrnz() test that makes QEMU crash.
This might be an existing BUG for op_loc already -- or in the TCG backend.
Maybe the disas_jcc/tcg_gen_movcond_i64 generates something unexpected on my machine?
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2022-02-16 10:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-15 20:26 [PATCH v3 1/3] s390x/tcg: Implement Miscellaneous-Instruction-Extensions Facility 3 for the s390x David Miller
2022-02-16 9:08 ` David Hildenbrand
2022-02-16 10:31 ` David Hildenbrand [this message]
2022-02-16 10:59 ` David Hildenbrand
2022-02-16 11:18 ` David Hildenbrand
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=753e5e7f-e9b9-d35f-2a7b-edbbe512edad@redhat.com \
--to=david@redhat.com \
--cc=borntraeger@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=dmiller423@gmail.com \
--cc=farman@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
/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).