summaryrefslogtreecommitdiff
path: root/tcg
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-21 13:48:32 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-21 13:48:32 +0000
commit36aa55dcd9775a2164d831d3d3e2a16977995f14 (patch)
tree8cae41e48031febf5bfbc04d0c84c639f62ed2ab /tcg
parent436d124b7d538b1fd9cf72edf17770664c309856 (diff)
Add concat_i32_i64 op.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5280 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'tcg')
-rw-r--r--tcg/README4
-rw-r--r--tcg/tcg-op.h17
2 files changed, 21 insertions, 0 deletions
diff --git a/tcg/README b/tcg/README
index b03432e23..b4d07b6f4 100644
--- a/tcg/README
+++ b/tcg/README
@@ -265,6 +265,10 @@ Convert t1 (32 bit) to t0 (64 bit) and does zero extension
* trunc_i64_i32 t0, t1
Truncate t1 (64 bit) to t0 (32 bit)
+* concat_i32_i64 t0, t1, t2
+Construct t0 (64-bit) taking the low half from t1 (32 bit) and the high half
+from t2 (32 bit).
+
********* Load/Store
* ld_i32/i64 t0, t1, offset
diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h
index bc6be8537..7b39fe865 100644
--- a/tcg/tcg-op.h
+++ b/tcg/tcg-op.h
@@ -1395,6 +1395,23 @@ static inline void tcg_gen_discard_i64(TCGv arg)
}
#endif
+static inline void tcg_gen_concat_i32_i64(TCGv dest, TCGv low, TCGv high)
+{
+#if TCG_TARGET_REG_BITS == 32
+ tcg_gen_mov_i32(dest, low);
+ tcg_gen_mov_i32(TCGV_HIGH(dest), high);
+#else
+ TCGv tmp = tcg_temp_new (TCG_TYPE_I64);
+ /* This extension is only needed for type correctness.
+ We may be able to do better given target specific information. */
+ tcg_gen_extu_i32_i64(tmp, high);
+ tcg_gen_shli_i64(tmp, tmp, 32);
+ tcg_gen_extu_i32_i64(dest, low);
+ tcg_gen_or_i64(dest, dest, tmp);
+ tcg_temp_free(tmp);
+#endif
+}
+
/***************************************/
/* QEMU specific operations. Their type depend on the QEMU CPU
type. */