From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5501] TCG: add logical operations found on alpha and powerpc processors
Date: Tue, 21 Oct 2008 11:29:00 +0000 [thread overview]
Message-ID: <E1KsFQ4-0003r2-3I@cvs.savannah.gnu.org> (raw)
Revision: 5501
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5501
Author: aurel32
Date: 2008-10-21 11:28:59 +0000 (Tue, 21 Oct 2008)
Log Message:
-----------
TCG: add logical operations found on alpha and powerpc processors
- andc_i32/i64 t0, t1, t2
- eqv_i32/i64 t0, t1, t2
- nand_i32/i64 t0, t1, t2
- nor_i32/i64 t0, t1, t2
- orc_i32/i64 t0, t1, t2
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Modified Paths:
--------------
trunk/tcg/README
trunk/tcg/tcg-op.h
Modified: trunk/tcg/README
===================================================================
--- trunk/tcg/README 2008-10-21 11:28:46 UTC (rev 5500)
+++ trunk/tcg/README 2008-10-21 11:28:59 UTC (rev 5501)
@@ -205,6 +205,26 @@
t0=~t1
+* andc_i32/i64 t0, t1, t2
+
+t0=t1&~t2
+
+* eqv_i32/i64 t0, t1, t2
+
+t0=~(t1^t2)
+
+* nand_i32/i64 t0, t1, t2
+
+t0=~(t1&t2)
+
+* nor_i32/i64 t0, t1, t2
+
+t0=~(t1|t2)
+
+* orc_i32/i64 t0, t1, t2
+
+t0=t1|~t2
+
********* Shifts
* shl_i32/i64 t0, t1, t2
Modified: trunk/tcg/tcg-op.h
===================================================================
--- trunk/tcg/tcg-op.h 2008-10-21 11:28:46 UTC (rev 5500)
+++ trunk/tcg/tcg-op.h 2008-10-21 11:28:59 UTC (rev 5501)
@@ -1425,6 +1425,96 @@
#endif
}
+static inline void tcg_gen_andc_i32(TCGv ret, TCGv arg1, TCGv arg2)
+{
+ TCGv t0;
+ t0 = tcg_temp_new(TCG_TYPE_I32);
+ tcg_gen_not_i32(t0, arg2);
+ tcg_gen_and_i32(ret, arg1, t0);
+ tcg_temp_free(t0);
+}
+
+static inline void tcg_gen_andc_i64(TCGv ret, TCGv arg1, TCGv arg2)
+{
+ TCGv t0;
+ t0 = tcg_temp_new(TCG_TYPE_I64);
+ tcg_gen_not_i64(t0, arg2);
+ tcg_gen_and_i64(ret, arg1, t0);
+ tcg_temp_free(t0);
+}
+
+static inline void tcg_gen_eqv_i32(TCGv ret, TCGv arg1, TCGv arg2)
+{
+ TCGv t0;
+ t0 = tcg_temp_new(TCG_TYPE_I32);
+ tcg_gen_xor_i32(t0, arg1, arg2);
+ tcg_gen_not_i32(ret, t0);
+ tcg_temp_free(t0);
+}
+
+static inline void tcg_gen_eqv_i64(TCGv ret, TCGv arg1, TCGv arg2)
+{
+ TCGv t0;
+ t0 = tcg_temp_new(TCG_TYPE_I64);
+ tcg_gen_xor_i64(t0, arg1, arg2);
+ tcg_gen_not_i64(ret, t0);
+ tcg_temp_free(t0);
+}
+
+static inline void tcg_gen_nand_i32(TCGv ret, TCGv arg1, TCGv arg2)
+{
+ TCGv t0;
+ t0 = tcg_temp_new(TCG_TYPE_I32);
+ tcg_gen_and_i32(t0, arg1, arg2);
+ tcg_gen_not_i32(ret, t0);
+ tcg_temp_free(t0);
+}
+
+static inline void tcg_gen_nand_i64(TCGv ret, TCGv arg1, TCGv arg2)
+{
+ TCGv t0;
+ t0 = tcg_temp_new(TCG_TYPE_I64);
+ tcg_gen_and_i64(t0, arg1, arg2);
+ tcg_gen_not_i64(ret, t0);
+ tcg_temp_free(t0);
+}
+
+static inline void tcg_gen_nor_i32(TCGv ret, TCGv arg1, TCGv arg2)
+{
+ TCGv t0;
+ t0 = tcg_temp_new(TCG_TYPE_I32);
+ tcg_gen_or_i32(t0, arg1, arg2);
+ tcg_gen_not_i32(ret, t0);
+ tcg_temp_free(t0);
+}
+
+static inline void tcg_gen_nor_i64(TCGv ret, TCGv arg1, TCGv arg2)
+{
+ TCGv t0;
+ t0 = tcg_temp_new(TCG_TYPE_I64);
+ tcg_gen_or_i64(t0, arg1, arg2);
+ tcg_gen_not_i64(ret, t0);
+ tcg_temp_free(t0);
+}
+
+static inline void tcg_gen_orc_i32(TCGv ret, TCGv arg1, TCGv arg2)
+{
+ TCGv t0;
+ t0 = tcg_temp_new(TCG_TYPE_I32);
+ tcg_gen_not_i32(t0, arg2);
+ tcg_gen_or_i32(ret, arg1, t0);
+ tcg_temp_free(t0);
+}
+
+static inline void tcg_gen_orc_i64(TCGv ret, TCGv arg1, TCGv arg2)
+{
+ TCGv t0;
+ t0 = tcg_temp_new(TCG_TYPE_I64);
+ tcg_gen_not_i64(t0, arg2);
+ tcg_gen_or_i64(ret, arg1, t0);
+ tcg_temp_free(t0);
+}
+
/***************************************/
/* QEMU specific operations. Their type depend on the QEMU CPU
type. */
@@ -1678,6 +1768,11 @@
#define tcg_gen_ext32u_tl tcg_gen_ext32u_i64
#define tcg_gen_ext32s_tl tcg_gen_ext32s_i64
#define tcg_gen_concat_tl_i64 tcg_gen_concat32_i64
+#define tcg_gen_andc_tl tcg_gen_andc_i64
+#define tcg_gen_eqv_tl tcg_gen_eqv_i64
+#define tcg_gen_nand_tl tcg_gen_nand_i64
+#define tcg_gen_nor_tl tcg_gen_nor_i64
+#define tcg_gen_orc_tl tcg_gen_orc_i64
#define tcg_const_tl tcg_const_i64
#else
#define TCG_TYPE_TL TCG_TYPE_I32
@@ -1730,6 +1825,11 @@
#define tcg_gen_ext32u_tl tcg_gen_mov_i32
#define tcg_gen_ext32s_tl tcg_gen_mov_i32
#define tcg_gen_concat_tl_i64 tcg_gen_concat_i32_i64
+#define tcg_gen_andc_tl tcg_gen_andc_i32
+#define tcg_gen_eqv_tl tcg_gen_eqv_i32
+#define tcg_gen_nand_tl tcg_gen_nand_i32
+#define tcg_gen_nor_tl tcg_gen_nor_i32
+#define tcg_gen_orc_tl tcg_gen_orc_i32
#define tcg_const_tl tcg_const_i32
#endif
reply other threads:[~2008-10-21 11:29 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=E1KsFQ4-0003r2-3I@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).