aboutsummaryrefslogtreecommitdiff
path: root/tcg/tcg-op.h
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-04 08:14:08 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-04 08:14:08 +0000
commitf730fd27b8e358efb3f7b31a564ecc6b1543b689 (patch)
tree524dee59297649f4ae8ac44b92d6de1bd23d85bb /tcg/tcg-op.h
parent653ccb8099e0f87960dc363bf2d875edf0676e8b (diff)
Add helpers and shorthands for mul and muli operations.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4319 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'tcg/tcg-op.h')
-rw-r--r--tcg/tcg-op.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h
index c1ff8f4448..46abcf8fed 100644
--- a/tcg/tcg-op.h
+++ b/tcg/tcg-op.h
@@ -438,6 +438,11 @@ static inline void tcg_gen_mul_i32(TCGv ret, TCGv arg1, TCGv arg2)
tcg_gen_op3(INDEX_op_mul_i32, ret, arg1, arg2);
}
+static inline void tcg_gen_muli_i32(TCGv ret, TCGv arg1, int32_t arg2)
+{
+ tcg_gen_mul_i32(ret, arg1, tcg_const_i32(arg2));
+}
+
#ifdef TCG_TARGET_HAS_div_i32
static inline void tcg_gen_div_i32(TCGv ret, TCGv arg1, TCGv arg2)
{
@@ -698,6 +703,11 @@ static inline void tcg_gen_mul_i64(TCGv ret, TCGv arg1, TCGv arg2)
tcg_gen_mov_i64(ret, t0);
}
+static inline void tcg_gen_muli_i64(TCGv ret, TCGv arg1, int64_t arg2)
+{
+ tcg_gen_mul_i64(ret, arg1, tcg_const_i64(arg2));
+}
+
static inline void tcg_gen_div_i64(TCGv ret, TCGv arg1, TCGv arg2)
{
tcg_gen_helper_1_2(tcg_helper_div_i64, ret, arg1, arg2);
@@ -886,6 +896,11 @@ static inline void tcg_gen_mul_i64(TCGv ret, TCGv arg1, TCGv arg2)
tcg_gen_op3(INDEX_op_mul_i64, ret, arg1, arg2);
}
+static inline void tcg_gen_muli_i64(TCGv ret, TCGv arg1, int64_t arg2)
+{
+ tcg_gen_mul_i64(ret, arg1, tcg_const_i64(arg2));
+}
+
#ifdef TCG_TARGET_HAS_div_i64
static inline void tcg_gen_div_i64(TCGv ret, TCGv arg1, TCGv arg2)
{
@@ -1395,6 +1410,8 @@ static inline void tcg_gen_qemu_st64(TCGv arg, TCGv addr, int mem_index)
#define tcg_gen_sar_tl tcg_gen_sar_i64
#define tcg_gen_sari_tl tcg_gen_sari_i64
#define tcg_gen_brcond_tl tcg_gen_brcond_i64
+#define tcg_gen_mul_tl tcg_gen_mul_i64
+#define tcg_gen_muli_tl tcg_gen_muli_i64
#define tcg_gen_discard_tl tcg_gen_discard_i64
#define tcg_gen_trunc_tl_i32 tcg_gen_trunc_i64_i32
#define tcg_gen_trunc_i64_tl tcg_gen_mov_i64
@@ -1435,6 +1452,8 @@ static inline void tcg_gen_qemu_st64(TCGv arg, TCGv addr, int mem_index)
#define tcg_gen_sar_tl tcg_gen_sar_i32
#define tcg_gen_sari_tl tcg_gen_sari_i32
#define tcg_gen_brcond_tl tcg_gen_brcond_i32
+#define tcg_gen_mul_tl tcg_gen_mul_i32
+#define tcg_gen_muli_tl tcg_gen_muli_i32
#define tcg_gen_discard_tl tcg_gen_discard_i32
#define tcg_gen_trunc_tl_i32 tcg_gen_mov_i32
#define tcg_gen_trunc_i64_tl tcg_gen_trunc_i64_i32