qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: agraf@suse.de
Subject: [Qemu-devel] [PATCH 4/5] target-s390: Simplify op_icm, op_stcm
Date: Wed, 11 Dec 2013 11:30:46 -0800	[thread overview]
Message-ID: <1386790247-14267-5-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1386790247-14267-1-git-send-email-rth@twiddle.net>

Loads and stores can now be shared, along with the surrounding code.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target-s390x/translate.c | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/target-s390x/translate.c b/target-s390x/translate.c
index 3e88c23..aa7d351 100644
--- a/target-s390x/translate.c
+++ b/target-s390x/translate.c
@@ -2085,12 +2085,13 @@ static ExitStatus op_icm(DisasContext *s, DisasOps *o)
     int m3 = get_field(s->fields, m3);
     int pos, len, base = s->insn->data;
     TCGv_i64 tmp = tcg_temp_new_i64();
+    TCGMemOp mop;
     uint64_t ccm;
 
     switch (m3) {
     case 0xf:
         /* Effectively a 32-bit load.  */
-        tcg_gen_qemu_ld_i64(tmp, o->in2, get_mem_index(s), MO_BEUL);
+        mop = MO_BEUL;
         len = 32;
         goto one_insert;
 
@@ -2098,7 +2099,7 @@ static ExitStatus op_icm(DisasContext *s, DisasOps *o)
     case 0x6:
     case 0x3:
         /* Effectively a 16-bit load.  */
-        tcg_gen_qemu_ld_i64(tmp, o->in2, get_mem_index(s), MO_BEUW);
+        mop = MO_BEUW;
         len = 16;
         goto one_insert;
 
@@ -2107,11 +2108,12 @@ static ExitStatus op_icm(DisasContext *s, DisasOps *o)
     case 0x2:
     case 0x1:
         /* Effectively an 8-bit load.  */
-        tcg_gen_qemu_ld_i64(tmp, o->in2, get_mem_index(s), MO_UB);
+        mop = MO_UB;
         len = 8;
         goto one_insert;
 
     one_insert:
+        tcg_gen_qemu_ld_i64(tmp, o->in2, get_mem_index(s), mop);
         pos = base + ctz32(m3) * 8;
         tcg_gen_deposit_i64(o->out, o->out, tmp, pos, len);
         ccm = ((1ull << len) - 1) << pos;
@@ -3327,30 +3329,33 @@ static ExitStatus op_stcm(DisasContext *s, DisasOps *o)
     int m3 = get_field(s->fields, m3);
     int pos, base = s->insn->data;
     TCGv_i64 tmp = tcg_temp_new_i64();
+    TCGMemOp mop;
 
-    pos = base + ctz32(m3) * 8;
     switch (m3) {
     case 0xf:
         /* Effectively a 32-bit store.  */
-        tcg_gen_shri_i64(tmp, o->in1, pos);
-        tcg_gen_qemu_st_i64(tmp, o->in2, get_mem_index(s), MO_BEUL);
-        break;
+        mop = MO_BEUL;
+        goto one_store;
 
     case 0xc:
     case 0x6:
     case 0x3:
         /* Effectively a 16-bit store.  */
-        tcg_gen_shri_i64(tmp, o->in1, pos);
-        tcg_gen_qemu_st_i64(tmp, o->in2, get_mem_index(s), MO_BEUW);
-        break;
+        mop = MO_BEUW;
+        goto one_store;
 
     case 0x8:
     case 0x4:
     case 0x2:
     case 0x1:
         /* Effectively an 8-bit store.  */
+        mop = MO_UB;
+        goto one_store;
+
+    one_store:
+        pos = base + ctz32(m3) * 8;
         tcg_gen_shri_i64(tmp, o->in1, pos);
-        tcg_gen_qemu_st_i64(tmp, o->in2, get_mem_index(s), MO_UB);
+        tcg_gen_qemu_st_i64(tmp, o->in2, get_mem_index(s), mop);
         break;
 
     default:
-- 
1.8.3.1

  parent reply	other threads:[~2013-12-11 19:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 19:30 [Qemu-devel] [PATCH 0/5] target-s390: Use the new qemu_ld/st opcodes Richard Henderson
2013-12-11 19:30 ` [Qemu-devel] [PATCH 1/5] target-s390: Convert to " Richard Henderson
2013-12-11 19:30 ` [Qemu-devel] [PATCH 2/5] target-s390: Simplify op_clc Richard Henderson
2013-12-11 19:30 ` [Qemu-devel] [PATCH 3/5] target-s390: Simplify op_cs, op_soc, op_stm Richard Henderson
2013-12-11 19:30 ` Richard Henderson [this message]
2013-12-11 19:30 ` [Qemu-devel] [PATCH 5/5] target-s390: Use little-endian ops for LOAD/STORE REVERSED Richard Henderson
2013-12-12  9:43 ` [Qemu-devel] [PATCH 0/5] target-s390: Use the new qemu_ld/st opcodes Alexander Graf

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=1386790247-14267-5-git-send-email-rth@twiddle.net \
    --to=rth@twiddle.net \
    --cc=agraf@suse.de \
    --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).