From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [6797] Implement TCG not ops for x86-64
Date: Mon, 09 Mar 2009 22:35:14 +0000 [thread overview]
Message-ID: <E1Lgo42-0007Rd-5N@cvs.savannah.gnu.org> (raw)
Revision: 6797
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6797
Author: aurel32
Date: 2009-03-09 22:35:13 +0000 (Mon, 09 Mar 2009)
Log Message:
-----------
Implement TCG not ops for x86-64
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Modified Paths:
--------------
trunk/tcg/tcg-op.h
trunk/tcg/tcg-opc.h
trunk/tcg/x86_64/tcg-target.c
trunk/tcg/x86_64/tcg-target.h
Modified: trunk/tcg/tcg-op.h
===================================================================
--- trunk/tcg/tcg-op.h 2009-03-09 21:58:46 UTC (rev 6796)
+++ trunk/tcg/tcg-op.h 2009-03-09 22:35:13 UTC (rev 6797)
@@ -1425,12 +1425,20 @@
static inline void tcg_gen_not_i32(TCGv_i32 ret, TCGv_i32 arg)
{
+#ifdef TCG_TARGET_HAS_not_i32
+ tcg_gen_op2_i32(INDEX_op_not_i32, ret, arg);
+#else
tcg_gen_xori_i32(ret, arg, -1);
+#endif
}
static inline void tcg_gen_not_i64(TCGv_i64 ret, TCGv_i64 arg)
{
+#ifdef TCG_TARGET_HAS_not_i64
+ tcg_gen_op2_i32(INDEX_op_not_i64, ret, arg);
+#else
tcg_gen_xori_i64(ret, arg, -1);
+#endif
}
static inline void tcg_gen_discard_i32(TCGv_i32 arg)
Modified: trunk/tcg/tcg-opc.h
===================================================================
--- trunk/tcg/tcg-opc.h 2009-03-09 21:58:46 UTC (rev 6796)
+++ trunk/tcg/tcg-opc.h 2009-03-09 22:35:13 UTC (rev 6797)
@@ -147,6 +147,12 @@
DEF2(bswap_i64, 1, 1, 0, 0)
#endif
#endif
+#ifdef TCG_TARGET_HAS_not_i32
+DEF2(not_i32, 1, 1, 0, 0)
+#endif
+#ifdef TCG_TARGET_HAS_not_i64
+DEF2(not_i64, 1, 1, 0, 0)
+#endif
#ifdef TCG_TARGET_HAS_neg_i32
DEF2(neg_i32, 1, 1, 0, 0)
#endif
Modified: trunk/tcg/x86_64/tcg-target.c
===================================================================
--- trunk/tcg/x86_64/tcg-target.c 2009-03-09 21:58:46 UTC (rev 6796)
+++ trunk/tcg/x86_64/tcg-target.c 2009-03-09 22:35:13 UTC (rev 6797)
@@ -1108,6 +1108,13 @@
tcg_out_modrm(s, 0xf7 | P_REXW, 3, args[0]);
break;
+ case INDEX_op_not_i32:
+ tcg_out_modrm(s, 0xf7, 2, args[0]);
+ break;
+ case INDEX_op_not_i64:
+ tcg_out_modrm(s, 0xf7 | P_REXW, 2, args[0]);
+ break;
+
case INDEX_op_ext8s_i32:
tcg_out_modrm(s, 0xbe | P_EXT | P_REXB, args[0], args[1]);
break;
@@ -1286,6 +1293,9 @@
{ INDEX_op_neg_i32, { "r", "0" } },
{ INDEX_op_neg_i64, { "r", "0" } },
+ { INDEX_op_not_i32, { "r", "0" } },
+ { INDEX_op_not_i64, { "r", "0" } },
+
{ INDEX_op_ext8s_i32, { "r", "r"} },
{ INDEX_op_ext16s_i32, { "r", "r"} },
{ INDEX_op_ext8s_i64, { "r", "r"} },
Modified: trunk/tcg/x86_64/tcg-target.h
===================================================================
--- trunk/tcg/x86_64/tcg-target.h 2009-03-09 21:58:46 UTC (rev 6796)
+++ trunk/tcg/x86_64/tcg-target.h 2009-03-09 22:35:13 UTC (rev 6797)
@@ -60,6 +60,8 @@
#define TCG_TARGET_HAS_bswap_i64
#define TCG_TARGET_HAS_neg_i32
#define TCG_TARGET_HAS_neg_i64
+#define TCG_TARGET_HAS_not_i32
+#define TCG_TARGET_HAS_not_i64
#define TCG_TARGET_HAS_ext8s_i32
#define TCG_TARGET_HAS_ext16s_i32
#define TCG_TARGET_HAS_ext8s_i64
reply other threads:[~2009-03-09 22:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=E1Lgo42-0007Rd-5N@cvs.savannah.gnu.org \
--to=aurelien@aurel32.net \
--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).