From patchwork Mon Feb 24 14:16:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Musta X-Patchwork-Id: 323674 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 96BC52C00D5 for ; Tue, 25 Feb 2014 01:17:11 +1100 (EST) Received: from localhost ([::1]:57892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHwLF-0007fA-Ev for incoming@patchwork.ozlabs.org; Mon, 24 Feb 2014 09:17:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHwKi-0007In-S0 for qemu-devel@nongnu.org; Mon, 24 Feb 2014 09:16:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WHwKa-000729-Ep for qemu-devel@nongnu.org; Mon, 24 Feb 2014 09:16:36 -0500 Received: from mail-qc0-x230.google.com ([2607:f8b0:400d:c01::230]:48017) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHwKa-00071s-9G; Mon, 24 Feb 2014 09:16:28 -0500 Received: by mail-qc0-f176.google.com with SMTP id r5so4288637qcx.35 for ; Mon, 24 Feb 2014 06:16:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=bBw8RWlce7Ca+LF8beIiqUlTS10bjtVKcJ01rIB4Vy8=; b=ppffvRKp2uh/Kvl4VnJfTIFA7z2t2bDZdYVoRpPUxDXQA+sAYyRdKe7f9A6/hT9tsf 3+e1+hX0zmaxH0FAExwTofS2IWELV8EEXZ6ul1vMtEMzyzK6aSdmlPc9QZbg5O3Xtj7c sAuSPc8x1HbRpsAsJHtr9UJoS8C+Bj5y24vOYk4lBruZbFuhCB8lCZq4wfK3fznBS6C2 w8BQNpkgj0cxvYlnBaDeo/13S+fH6MfO6WegTWvStr8RLTUeJa6tC67/CZwTOcIOfESz dnNd219X8eB6R926KItcnD+kl+UrNBRHivAcAdeWRROxvqZepKSlMMkZeFA3HafzPXC8 i/Ww== X-Received: by 10.224.135.137 with SMTP id n9mr29827937qat.54.1393251387731; Mon, 24 Feb 2014 06:16:27 -0800 (PST) Received: from tmusta-sc.rchland.ibm.com (rchp4.rochester.ibm.com. [129.42.161.36]) by mx.google.com with ESMTPSA id q3sm49904064qam.12.2014.02.24.06.16.25 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Feb 2014 06:16:27 -0800 (PST) From: Tom Musta To: qemu-devel@nongnu.org Date: Mon, 24 Feb 2014 08:16:16 -0600 Message-Id: <1393251376-2547-1-git-send-email-tommusta@gmail.com> X-Mailer: git-send-email 1.7.9.5 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c01::230 Cc: Tom Musta , qemu-ppc@nongnu.org Subject: [Qemu-devel] [PATCH] target-ppc: Use Additional Temporary in stqcx Case X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- target-ppc/translate.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 4ffb891..908264f 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);