[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 02/13] target-ppc: Use movcond in isel
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 02/13] target-ppc: Use movcond in isel |
Date: |
Fri, 27 May 2016 13:04:47 +1000 |
From: Richard Henderson <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
target-ppc/translate.c | 29 +++++++++++------------------
1 file changed, 11 insertions(+), 18 deletions(-)
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 745f4de..3ea6625 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -756,27 +756,20 @@ static void gen_cmpli(DisasContext *ctx)
/* isel (PowerPC 2.03 specification) */
static void gen_isel(DisasContext *ctx)
{
- TCGLabel *l1, *l2;
uint32_t bi = rC(ctx->opcode);
- uint32_t mask;
- TCGv_i32 t0;
+ uint32_t mask = 0x08 >> (bi & 0x03);
+ TCGv t0 = tcg_temp_new();
+ TCGv zr;
- l1 = gen_new_label();
- l2 = gen_new_label();
+ tcg_gen_extu_i32_tl(t0, cpu_crf[bi >> 2]);
+ tcg_gen_andi_tl(t0, t0, mask);
- mask = 0x08 >> (bi & 0x03);
- t0 = tcg_temp_new_i32();
- tcg_gen_andi_i32(t0, cpu_crf[bi >> 2], mask);
- tcg_gen_brcondi_i32(TCG_COND_EQ, t0, 0, l1);
- if (rA(ctx->opcode) == 0)
- tcg_gen_movi_tl(cpu_gpr[rD(ctx->opcode)], 0);
- else
- tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rA(ctx->opcode)]);
- tcg_gen_br(l2);
- gen_set_label(l1);
- tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rB(ctx->opcode)]);
- gen_set_label(l2);
- tcg_temp_free_i32(t0);
+ zr = tcg_const_tl(0);
+ tcg_gen_movcond_tl(TCG_COND_NE, cpu_gpr[rD(ctx->opcode)], t0, zr,
+ rA(ctx->opcode) ? cpu_gpr[rA(ctx->opcode)] : zr,
+ cpu_gpr[rB(ctx->opcode)]);
+ tcg_temp_free(zr);
+ tcg_temp_free(t0);
}
/* cmpb: PowerPC 2.05 specification */
--
2.5.5
- [Qemu-ppc] [PULL 00/13] ppc-for-2.7 queue 20160527, David Gibson, 2016/05/26
- [Qemu-ppc] [PULL 02/13] target-ppc: Use movcond in isel,
David Gibson <=
- [Qemu-ppc] [PULL 07/13] Added negative check for get_image_size(), David Gibson, 2016/05/26
- [Qemu-ppc] [PULL 13/13] MAINTAINERS: Add David Gibson as ppc maintainer, David Gibson, 2016/05/26
- [Qemu-ppc] [PULL 04/13] target-ppc: Cleanups to rldinm, rldnm, rldimi, David Gibson, 2016/05/26
- [Qemu-ppc] [PULL 03/13] target-ppc: Use 32-bit rotate instead of deposit + 64-bit rotate, David Gibson, 2016/05/26
- [Qemu-ppc] [PULL 12/13] spapr_iommu: Move table allocation to helpers, David Gibson, 2016/05/26
- [Qemu-ppc] [PULL 06/13] hw/net/spapr_llan: Provide counter with dropped rx frames to the guest, David Gibson, 2016/05/26
- [Qemu-ppc] [PULL 09/13] spapr: ensure device trees are always associated with DRC, David Gibson, 2016/05/26
- [Qemu-ppc] [PULL 01/13] target-ppc: Correct KVM synchronization for ppc_hash64_set_external_hpt(), David Gibson, 2016/05/26
- [Qemu-ppc] [PULL 08/13] PPC/KVM: early validation of vcpu id, David Gibson, 2016/05/26
- [Qemu-ppc] [PULL 11/13] spapr_iommu: Finish renaming vfio_accel to need_vfio, David Gibson, 2016/05/26