qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: QEMU-devel Developers <qemu-devel@nongnu.org>
Cc: peter.maydell@linaro.org, Aurelien Jarno <aurelien@aurel32.net>,
	Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH 15/15] tcg: use ext op for deposit
Date: Mon,  4 Apr 2011 16:32:24 +0200	[thread overview]
Message-ID: <1301927544-32767-16-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1301927544-32767-1-git-send-email-agraf@suse.de>

With the s390x target we use the deposit instruction to store 32bit values
into 64bit registers without clobbering the upper 32 bits.

This specific operation can be optimized slightly by using the ext operation
instead of an explicit and in the deposit instruction. This patch adds that
special case to the generic deposit implementation.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 tcg/tcg-op.h |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h
index 207a89f..88575e7 100644
--- a/tcg/tcg-op.h
+++ b/tcg/tcg-op.h
@@ -2124,7 +2124,11 @@ static inline void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1,
   uint64_t mask = (1ull << len) - 1;
   TCGv_i64 t1 = tcg_temp_new_i64 ();
 
-  tcg_gen_andi_i64(t1, arg2, mask);
+  if (len == 32) {
+       tcg_gen_ext32u_i64(t1, arg2);
+  } else {
+      tcg_gen_andi_i64(t1, arg2, mask);
+  }
   tcg_gen_shli_i64(t1, t1, ofs);
   tcg_gen_andi_i64(ret, arg1, ~(mask << ofs));
   tcg_gen_or_i64(ret, ret, t1);
-- 
1.6.0.2

  parent reply	other threads:[~2011-04-04 14:32 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-04 14:32 [Qemu-devel] [PATCH 00/15] s390x emulation support v3 Alexander Graf
2011-04-04 14:32 ` [Qemu-devel] [PATCH 01/15] s390x: fix virtio feature bitmap Alexander Graf
2011-04-10 19:25   ` Aurelien Jarno
2011-04-10 19:26     ` Alexander Graf
2011-04-10 20:06       ` Aurelien Jarno
2011-04-10 20:11         ` Alexander Graf
2011-04-10 20:26           ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 02/15] s390x: set alignment for long to 8 Alexander Graf
2011-04-10 19:25   ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 03/15] s390x: s390x-linux-user support Alexander Graf
2011-04-10 20:16   ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 04/15] linux-user: define a couple of syscalls for non-uid16 targets Alexander Graf
2011-04-10 20:25   ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 05/15] s390x: Enable s390x-softmmu target Alexander Graf
2011-04-10 20:34   ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 06/15] s390x: Dispatch interrupts to KVM or the real CPU Alexander Graf
2011-04-10 20:37   ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 07/15] s390x: Adjust GDB stub Alexander Graf
2011-04-10 20:39   ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 08/15] s390x: virtio machine storage keys Alexander Graf
2011-04-10 20:41   ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 09/15] s390x: Prepare cpu.h for emulation Alexander Graf
2011-04-12 21:32   ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 10/15] s390x: helper functions for system emulation Alexander Graf
2011-04-12 21:32   ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 11/15] s390x: Implement opcode helpers Alexander Graf
2011-04-12 21:32   ` Aurelien Jarno
2011-04-13  5:20     ` Alexander Graf
2011-04-04 14:32 ` [Qemu-devel] [PATCH 12/15] s390x: Adjust internal kvm code Alexander Graf
2011-04-12 21:32   ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 13/15] s390x: translate engine for s390x CPU Alexander Graf
2011-04-04 14:32 ` [Qemu-devel] [PATCH 14/15] s390x: build s390x by default Alexander Graf
2011-04-04 14:32 ` Alexander Graf [this message]
2011-04-05  4:54   ` [Qemu-devel] [PATCH 15/15] tcg: use ext op for deposit Aurelien Jarno
2011-04-05  7:55     ` Alexander Graf
2011-04-10 19:23       ` Aurelien Jarno
2011-04-10 19:25         ` Alexander Graf
2011-04-10 20:08           ` Aurelien Jarno
2011-04-10 20:17             ` Alexander Graf
2011-04-10 20:28               ` Aurelien Jarno
2011-04-14 16:27                 ` 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=1301927544-32767-16-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).