Received: from eggs.gnu.org ([2001:4830:134:3::10]:59046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLhod-0001Kz-I7 for qemu-devel@nongnu.org; Thu, 06 Mar 2014 18:35:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLhnz-0003RD-JI for qemu-devel@nongnu.org; Thu, 06 Mar 2014 18:35:03 -0500 From: Alexander Graf Date: Fri, 7 Mar 2014 00:34:10 +0100 Message-Id: <1394148857-19607-124-git-send-email-agraf@suse.de> In-Reply-To: <1394148857-19607-1-git-send-email-agraf@suse.de> References: <1394148857-19607-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PULL 123/130] target-ppc: Use Additional Temporary in stqcx Case List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Tom Musta , blauwirbel@gmail.com, qemu-ppc@nongnu.org, aliguori@amazon.com, aurelien@aurel32.net From: Tom Musta Per Alex Graf's suggestion, the recently added case to gen_conditional_store for stqcx should use an additional temporary when accessing the second doubleword. This avoids the mutation of the EA argument to the function, which is counter intuitive. Signed-off-by: Tom Musta Signed-off-by: Alexander Graf --- target-ppc/translate.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 051693b..91c33dc 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -3333,7 +3333,7 @@ static void gen_conditional_store(DisasContext *ctx, TCGv EA, gen_qemu_st16(ctx, cpu_gpr[reg], EA); #if defined(TARGET_PPC64) } else if (size == 16) { - TCGv gpr1, gpr2; + TCGv gpr1, gpr2 , EA8; if (unlikely(ctx->le_mode)) { gpr1 = cpu_gpr[reg+1]; gpr2 = cpu_gpr[reg]; @@ -3342,8 +3342,10 @@ static void gen_conditional_store(DisasContext *ctx, TCGv EA, gpr2 = cpu_gpr[reg+1]; } gen_qemu_st64(ctx, gpr1, EA); - gen_addr_add(ctx, EA, EA, 8); - gen_qemu_st64(ctx, gpr2, EA); + EA8 = tcg_temp_local_new(); + gen_addr_add(ctx, EA8, EA, 8); + gen_qemu_st64(ctx, gpr2, EA8); + tcg_temp_free(EA8); #endif } else { gen_qemu_st8(ctx, cpu_gpr[reg], EA); -- 1.8.1.4