[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/20] target-sparc: Split out get_temp_i32
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 09/20] target-sparc: Split out get_temp_i32 |
Date: |
Tue, 16 Oct 2012 19:32:20 +1000 |
Signed-off-by: Richard Henderson <address@hidden>
---
target-sparc/translate.c | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index e3e4256..5296a37 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -125,6 +125,22 @@ static int sign_extend(int x, int len)
#define IS_IMM (insn & (1<<13))
+static inline TCGv_i32 get_temp_i32(DisasContext *dc)
+{
+ TCGv_i32 t;
+ assert(dc->n_t32 < ARRAY_SIZE(dc->t32));
+ dc->t32[dc->n_t32++] = t = tcg_temp_new_i32();
+ return t;
+}
+
+static inline TCGv get_temp_tl(DisasContext *dc)
+{
+ TCGv t;
+ assert(dc->n_ttl < ARRAY_SIZE(dc->ttl));
+ dc->ttl[dc->n_ttl++] = t = tcg_temp_new();
+ return t;
+}
+
static inline void gen_update_fprs_dirty(int rd)
{
#if defined(TARGET_SPARC64)
@@ -145,16 +161,13 @@ static TCGv_i32 gen_load_fpr_F(DisasContext *dc, unsigned
int src)
if (src & 1) {
return MAKE_TCGV_I32(GET_TCGV_I64(cpu_fpr[src / 2]));
} else {
- TCGv_i32 ret = tcg_temp_new_i32();
+ TCGv_i32 ret = get_temp_i32(dc);
TCGv_i64 t = tcg_temp_new_i64();
tcg_gen_shri_i64(t, cpu_fpr[src / 2], 32);
tcg_gen_trunc_i64_i32(ret, t);
tcg_temp_free_i64(t);
- dc->t32[dc->n_t32++] = ret;
- assert(dc->n_t32 <= ARRAY_SIZE(dc->t32));
-
return ret;
}
#endif
@@ -265,14 +278,6 @@ static inline void gen_address_mask(DisasContext *dc, TCGv
addr)
#endif
}
-static inline TCGv get_temp_tl(DisasContext *dc)
-{
- TCGv t;
- assert(dc->n_ttl < ARRAY_SIZE(dc->ttl));
- dc->ttl[dc->n_ttl++] = t = tcg_temp_new();
- return t;
-}
-
static inline TCGv gen_load_gpr(DisasContext *dc, int reg)
{
if (reg == 0 || reg >= 8) {
--
1.7.11.7
- [Qemu-devel] [PATCH 04/20] target-sparc: Convert asi helpers to gen_*_gpr, (continued)
- [Qemu-devel] [PATCH 04/20] target-sparc: Convert asi helpers to gen_*_gpr, Richard Henderson, 2012/10/16
- [Qemu-devel] [PATCH 05/20] target-sparc: Convert swap to gen_load/store_gpr, Richard Henderson, 2012/10/16
- [Qemu-devel] [PATCH 08/20] target-sparc: Make the cpu_addr variable local to load/store handling, Richard Henderson, 2012/10/16
- [Qemu-devel] [PATCH 06/20] target-sparc: Finish conversion to gen_load_gpr, Richard Henderson, 2012/10/16
- [Qemu-devel] [PATCH 07/20] target-sparc: Cleanup cpu_src[12] allocation, Richard Henderson, 2012/10/16
- [Qemu-devel] [PATCH 19/20] target-sparc: Make cpu_dst local to OP=2 insns, Richard Henderson, 2012/10/16
- [Qemu-devel] [PATCH 18/20] target-sparc: Only use cpu_dst for eventual writes to a gpr, Richard Henderson, 2012/10/16
- [Qemu-devel] [PATCH 20/20] target-sparc: Remove cpu_tmp0 as a global, Richard Henderson, 2012/10/16
- [Qemu-devel] [PATCH 10/20] target-sparc: Use get_temp_i32 in gen_dest_fpr_F, Richard Henderson, 2012/10/16
- [Qemu-devel] [PATCH 11/20] target-sparc: Avoid cpu_tmp32 in Read Priv Register, Richard Henderson, 2012/10/16
- [Qemu-devel] [PATCH 09/20] target-sparc: Split out get_temp_i32,
Richard Henderson <=
- [Qemu-devel] [PATCH 12/20] target-sparc: Avoid cpu_tmp32 in Write Priv Register, Richard Henderson, 2012/10/16
- [Qemu-devel] [PATCH 13/20] target-sparc: Tidy ldfsr, stfsr, Richard Henderson, 2012/10/16
- [Qemu-devel] [PATCH 15/20] target-sparc: Don't use a temporary for gen_dest_fpr_D, Richard Henderson, 2012/10/16
- [Qemu-devel] [PATCH 14/20] target-sparc: Remove usage of cpu_tmp64 from most helper functions, Richard Henderson, 2012/10/16
- [Qemu-devel] [PATCH 17/20] target-sparc: Remove last uses of cpu_tmp64, Richard Henderson, 2012/10/16
- [Qemu-devel] [PATCH 16/20] target-sparc: Remove cpu_tmp64 use from softint insns, Richard Henderson, 2012/10/16
- Re: [Qemu-devel] [PATCH v2 00/20] target-sparc: Cleanup handling of temps, Blue Swirl, 2012/10/20