qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH RFC 5/9] tcg/i386: implement ext_i32_i64 and extu_i32_i64 ops
Date: Wed, 15 Jul 2015 13:03:15 +0200	[thread overview]
Message-ID: <1436958199-5181-6-git-send-email-aurelien@aurel32.net> (raw)
In-Reply-To: <1436958199-5181-1-git-send-email-aurelien@aurel32.net>

Implementing them as real ops means they can't be optimized out by
the register allocator or the optimizer.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 tcg/i386/tcg-target.c | 5 +++++
 tcg/i386/tcg-target.h | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c
index ff4d9cf..637b1fb 100644
--- a/tcg/i386/tcg-target.c
+++ b/tcg/i386/tcg-target.c
@@ -2034,9 +2034,11 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
     case INDEX_op_bswap64_i64:
         tcg_out_bswap64(s, args[0]);
         break;
+    case INDEX_op_extu_i32_i64:
     case INDEX_op_ext32u_i64:
         tcg_out_ext32u(s, args[0], args[1]);
         break;
+    case INDEX_op_ext_i32_i64:
     case INDEX_op_ext32s_i64:
         tcg_out_ext32s(s, args[0], args[1]);
         break;
@@ -2171,6 +2173,9 @@ static const TCGTargetOpDef x86_op_defs[] = {
     { INDEX_op_ext16u_i64, { "r", "r" } },
     { INDEX_op_ext32u_i64, { "r", "r" } },
 
+    { INDEX_op_ext_i32_i64, { "r", "r" } },
+    { INDEX_op_extu_i32_i64, { "r", "r" } },
+
     { INDEX_op_deposit_i64, { "Q", "0", "Q" } },
     { INDEX_op_movcond_i64, { "r", "r", "re", "r", "0" } },
 
diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h
index 274c97f..16f3949 100644
--- a/tcg/i386/tcg-target.h
+++ b/tcg/i386/tcg-target.h
@@ -131,8 +131,8 @@ extern bool have_bmi1;
 
 /* size changing optional ops */
 #define TCG_TARGET_HAS_trunc_shr_i64_i32 0
-#define TCG_TARGET_HAS_ext_i32_i64       0
-#define TCG_TARGET_HAS_extu_i32_i64      0
+#define TCG_TARGET_HAS_ext_i32_i64       1
+#define TCG_TARGET_HAS_extu_i32_i64      1
 
 #endif
 
-- 
2.1.4

  parent reply	other threads:[~2015-07-15 11:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-15 11:03 [Qemu-devel] [PATCH RFC 0/9] tcg: improve size changing ops Aurelien Jarno
2015-07-15 11:03 ` [Qemu-devel] [PATCH RFC 1/9] tcg: rename trunc_shr_i32 into trunc_shr_i64_i32 Aurelien Jarno
2015-07-17  6:14   ` Richard Henderson
2015-07-15 11:03 ` [Qemu-devel] [PATCH RFC 2/9] tcg: don't abuse TCG type in tcg_gen_trunc_shr_i64_i32 Aurelien Jarno
2015-07-17  6:14   ` Richard Henderson
2015-07-15 11:03 ` [Qemu-devel] [PATCH RFC 3/9] tcg: implement real ext_i32_i64 and extu_i32_i64 ops Aurelien Jarno
2015-07-17  6:19   ` Richard Henderson
2015-07-15 11:03 ` [Qemu-devel] [PATCH RFC 4/9] tcg/optimize: add optimizations for " Aurelien Jarno
2015-07-17  6:23   ` Richard Henderson
2015-07-15 11:03 ` Aurelien Jarno [this message]
2015-07-15 11:03 ` [Qemu-devel] [PATCH RFC 6/9] tcg/i386: document the way 32/64-bit conversions are handled Aurelien Jarno
2015-07-15 11:03 ` [Qemu-devel] [PATCH RFC 7/9] tcg: replace ext/u_i32_i64 by a mov when not implemented Aurelien Jarno
2015-07-17  6:30   ` Richard Henderson
2015-07-15 11:03 ` [Qemu-devel] [PATCH RFC 8/9] tcg/optimize: do not simplify size changing moves Aurelien Jarno
2015-07-17  6:38   ` Richard Henderson
2015-07-17 10:33     ` Aurelien Jarno
2015-07-18  7:24       ` Richard Henderson
2015-07-18 21:19         ` Aurelien Jarno
2015-07-15 11:03 ` [Qemu-devel] [PATCH RFC 9/9] tcg: update README about size changing ops Aurelien Jarno
2015-07-17  6:42   ` Richard Henderson

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=1436958199-5181-6-git-send-email-aurelien@aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=pbonzini@redhat.com \
    --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).