diff mbox

[RFC,3/6] tcg: Add tcg_gen_qemu_{ld,st}64_tl()

Message ID 1323521895-26693-4-git-send-email-andreas.faerber@web.de
State New
Headers show

Commit Message

Andreas Färber Dec. 10, 2011, 12:58 p.m. UTC
Encapsule the conversion from/to i64.
This avoids a temporary and a tcg_gen_trunc_i64_tl()/ext_tl_i64().

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
 tcg/tcg-op.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h
index d065e74..07c6d3e 100644
--- a/tcg/tcg-op.h
+++ b/tcg/tcg-op.h
@@ -3217,6 +3217,18 @@  static inline void tcg_gen_deposit_tl(TCGv ret, TCGv arg1, TCGv arg2,
 #endif
 }
 
+#if TARGET_LONG_BITS == 64
+static inline void tcg_gen_qemu_ld64_tl(TCGv ret, TCGv addr, int mem_index)
+{
+    tcg_gen_qemu_ld64(MAKE_TCGV_I64(GET_TCGV_TL(ret)), addr, mem_index);
+}
+
+static inline void tcg_gen_qemu_st64_tl(TCGv arg, TCGv addr, int mem_index)
+{
+    tcg_gen_qemu_st64(MAKE_TCGV_I64(GET_TCGV_TL(arg)), addr, mem_index);
+}
+#endif
+
 static inline TCGv tcg_const_tl(tcg_target_long val)
 {
 #if TARGET_LONG_BITS == 64