From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Li3nl-0002sy-FG for qemu-devel@nongnu.org; Fri, 13 Mar 2009 05:35:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Li3nk-0002sa-L7 for qemu-devel@nongnu.org; Fri, 13 Mar 2009 05:35:36 -0400 Received: from [199.232.76.173] (port=34668 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Li3nk-0002sU-81 for qemu-devel@nongnu.org; Fri, 13 Mar 2009 05:35:36 -0400 Received: from savannah.gnu.org ([199.232.41.3]:54195 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Li3nj-0006PJ-Rn for qemu-devel@nongnu.org; Fri, 13 Mar 2009 05:35:36 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Li3nj-00072L-Ai for qemu-devel@nongnu.org; Fri, 13 Mar 2009 09:35:35 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1Li3ni-00072C-Rf for qemu-devel@nongnu.org; Fri, 13 Mar 2009 09:35:35 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Fri, 13 Mar 2009 09:35:34 +0000 Subject: [Qemu-devel] [6835] target-ppc: use the new bswap* TCG ops Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6835 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6835 Author: aurel32 Date: 2009-03-13 09:35:34 +0000 (Fri, 13 Mar 2009) Log Message: ----------- target-ppc: use the new bswap* TCG ops Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/target-ppc/translate.c Modified: trunk/target-ppc/translate.c =================================================================== --- trunk/target-ppc/translate.c 2009-03-13 09:35:26 UTC (rev 6834) +++ trunk/target-ppc/translate.c 2009-03-13 09:35:34 UTC (rev 6835) @@ -2580,35 +2580,16 @@ { tcg_gen_qemu_ld16u(arg1, arg2, ctx->mem_idx); if (unlikely(ctx->le_mode)) { -#if defined(TARGET_PPC64) - TCGv_i32 t0 = tcg_temp_new_i32(); - tcg_gen_trunc_tl_i32(t0, arg1); - tcg_gen_bswap16_i32(t0, t0); - tcg_gen_extu_i32_tl(arg1, t0); - tcg_temp_free_i32(t0); -#else - tcg_gen_bswap16_i32(arg1, arg1); -#endif + tcg_gen_bswap16_tl(arg1, arg1); } } static always_inline void gen_qemu_ld16s(DisasContext *ctx, TCGv arg1, TCGv arg2) { if (unlikely(ctx->le_mode)) { -#if defined(TARGET_PPC64) - TCGv_i32 t0; tcg_gen_qemu_ld16u(arg1, arg2, ctx->mem_idx); - t0 = tcg_temp_new_i32(); - tcg_gen_trunc_tl_i32(t0, arg1); - tcg_gen_bswap16_i32(t0, t0); - tcg_gen_extu_i32_tl(arg1, t0); + tcg_gen_bswap16_tl(arg1, arg1); tcg_gen_ext16s_tl(arg1, arg1); - tcg_temp_free_i32(t0); -#else - tcg_gen_qemu_ld16u(arg1, arg2, ctx->mem_idx); - tcg_gen_bswap16_i32(arg1, arg1); - tcg_gen_ext16s_i32(arg1, arg1); -#endif } else { tcg_gen_qemu_ld16s(arg1, arg2, ctx->mem_idx); } @@ -2618,15 +2599,7 @@ { tcg_gen_qemu_ld32u(arg1, arg2, ctx->mem_idx); if (unlikely(ctx->le_mode)) { -#if defined(TARGET_PPC64) - TCGv_i32 t0 = tcg_temp_new_i32(); - tcg_gen_trunc_tl_i32(t0, arg1); - tcg_gen_bswap32_i32(t0, t0); - tcg_gen_extu_i32_tl(arg1, t0); - tcg_temp_free_i32(t0); -#else - tcg_gen_bswap32_i32(arg1, arg1); -#endif + tcg_gen_bswap32_tl(arg1, arg1); } } @@ -2634,13 +2607,9 @@ static always_inline void gen_qemu_ld32s(DisasContext *ctx, TCGv arg1, TCGv arg2) { if (unlikely(ctx->le_mode)) { - TCGv_i32 t0; tcg_gen_qemu_ld32u(arg1, arg2, ctx->mem_idx); - t0 = tcg_temp_new_i32(); - tcg_gen_trunc_tl_i32(t0, arg1); - tcg_gen_bswap32_i32(t0, t0); - tcg_gen_ext_i32_tl(arg1, t0); - tcg_temp_free_i32(t0); + tcg_gen_bswap32_tl(arg1, arg1); + tcg_gen_ext32s_tl(arg1, arg1); } else tcg_gen_qemu_ld32s(arg1, arg2, ctx->mem_idx); } @@ -2662,25 +2631,11 @@ static always_inline void gen_qemu_st16(DisasContext *ctx, TCGv arg1, TCGv arg2) { if (unlikely(ctx->le_mode)) { -#if defined(TARGET_PPC64) - TCGv_i32 t0; - TCGv t1; - t0 = tcg_temp_new_i32(); - tcg_gen_trunc_tl_i32(t0, arg1); - tcg_gen_ext16u_i32(t0, t0); - tcg_gen_bswap16_i32(t0, t0); - t1 = tcg_temp_new(); - tcg_gen_extu_i32_tl(t1, t0); - tcg_temp_free_i32(t0); - tcg_gen_qemu_st16(t1, arg2, ctx->mem_idx); - tcg_temp_free(t1); -#else TCGv t0 = tcg_temp_new(); tcg_gen_ext16u_tl(t0, arg1); - tcg_gen_bswap16_i32(t0, t0); + tcg_gen_bswap16_tl(t0, t0); tcg_gen_qemu_st16(t0, arg2, ctx->mem_idx); tcg_temp_free(t0); -#endif } else { tcg_gen_qemu_st16(arg1, arg2, ctx->mem_idx); } @@ -2689,23 +2644,11 @@ static always_inline void gen_qemu_st32(DisasContext *ctx, TCGv arg1, TCGv arg2) { if (unlikely(ctx->le_mode)) { -#if defined(TARGET_PPC64) - TCGv_i32 t0; - TCGv t1; - t0 = tcg_temp_new_i32(); - tcg_gen_trunc_tl_i32(t0, arg1); - tcg_gen_bswap32_i32(t0, t0); - t1 = tcg_temp_new(); - tcg_gen_extu_i32_tl(t1, t0); - tcg_temp_free_i32(t0); - tcg_gen_qemu_st32(t1, arg2, ctx->mem_idx); - tcg_temp_free(t1); -#else - TCGv t0 = tcg_temp_new_i32(); - tcg_gen_bswap32_i32(t0, arg1); + TCGv t0 = tcg_temp_new(); + tcg_gen_ext32u_tl(t0, arg1); + tcg_gen_bswap32_tl(t0, t0); tcg_gen_qemu_st32(t0, arg2, ctx->mem_idx); tcg_temp_free(t0); -#endif } else { tcg_gen_qemu_st32(arg1, arg2, ctx->mem_idx); } @@ -2993,15 +2936,7 @@ { tcg_gen_qemu_ld16u(arg1, arg2, ctx->mem_idx); if (likely(!ctx->le_mode)) { -#if defined(TARGET_PPC64) - TCGv_i32 t0 = tcg_temp_new_i32(); - tcg_gen_trunc_tl_i32(t0, arg1); - tcg_gen_bswap16_i32(t0, t0); - tcg_gen_extu_i32_tl(arg1, t0); - tcg_temp_free_i32(t0); -#else - tcg_gen_bswap16_i32(arg1, arg1); -#endif + tcg_gen_bswap16_tl(arg1, arg1); } } GEN_LDX(lhbr, ld16ur, 0x16, 0x18, PPC_INTEGER); @@ -3011,15 +2946,7 @@ { tcg_gen_qemu_ld32u(arg1, arg2, ctx->mem_idx); if (likely(!ctx->le_mode)) { -#if defined(TARGET_PPC64) - TCGv_i32 t0 = tcg_temp_new_i32(); - tcg_gen_trunc_tl_i32(t0, arg1); - tcg_gen_bswap32_i32(t0, t0); - tcg_gen_extu_i32_tl(arg1, t0); - tcg_temp_free_i32(t0); -#else - tcg_gen_bswap32_i32(arg1, arg1); -#endif + tcg_gen_bswap32_tl(arg1, arg1); } } GEN_LDX(lwbr, ld32ur, 0x16, 0x10, PPC_INTEGER); @@ -3028,25 +2955,11 @@ static void always_inline gen_qemu_st16r(DisasContext *ctx, TCGv arg1, TCGv arg2) { if (likely(!ctx->le_mode)) { -#if defined(TARGET_PPC64) - TCGv_i32 t0; - TCGv t1; - t0 = tcg_temp_new_i32(); - tcg_gen_trunc_tl_i32(t0, arg1); - tcg_gen_ext16u_i32(t0, t0); - tcg_gen_bswap16_i32(t0, t0); - t1 = tcg_temp_new(); - tcg_gen_extu_i32_tl(t1, t0); - tcg_temp_free_i32(t0); - tcg_gen_qemu_st16(t1, arg2, ctx->mem_idx); - tcg_temp_free(t1); -#else TCGv t0 = tcg_temp_new(); tcg_gen_ext16u_tl(t0, arg1); - tcg_gen_bswap16_i32(t0, t0); + tcg_gen_bswap16_tl(t0, t0); tcg_gen_qemu_st16(t0, arg2, ctx->mem_idx); tcg_temp_free(t0); -#endif } else { tcg_gen_qemu_st16(arg1, arg2, ctx->mem_idx); } @@ -3057,23 +2970,11 @@ static void always_inline gen_qemu_st32r(DisasContext *ctx, TCGv arg1, TCGv arg2) { if (likely(!ctx->le_mode)) { -#if defined(TARGET_PPC64) - TCGv_i32 t0; - TCGv t1; - t0 = tcg_temp_new_i32(); - tcg_gen_trunc_tl_i32(t0, arg1); - tcg_gen_bswap32_i32(t0, t0); - t1 = tcg_temp_new(); - tcg_gen_extu_i32_tl(t1, t0); - tcg_temp_free_i32(t0); - tcg_gen_qemu_st32(t1, arg2, ctx->mem_idx); - tcg_temp_free(t1); -#else - TCGv t0 = tcg_temp_new_i32(); - tcg_gen_bswap32_i32(t0, arg1); + TCGv t0 = tcg_temp_new(); + tcg_gen_ext32u_tl(t0, arg1); + tcg_gen_bswap32_tl(t0, t0); tcg_gen_qemu_st32(t0, arg2, ctx->mem_idx); tcg_temp_free(t0); -#endif } else { tcg_gen_qemu_st32(arg1, arg2, ctx->mem_idx); }