* [Qemu-devel] [PATCH] target-ppc: Use Additional Temporary in stqcx Case
@ 2014-02-24 14:16 Tom Musta
2014-02-25 2:56 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
0 siblings, 1 reply; 2+ messages in thread
From: Tom Musta @ 2014-02-24 14:16 UTC (permalink / raw)
To: qemu-devel; +Cc: Tom Musta, qemu-ppc
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 <tommusta@gmail.com>
---
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);
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH] target-ppc: Use Additional Temporary in stqcx Case
2014-02-24 14:16 [Qemu-devel] [PATCH] target-ppc: Use Additional Temporary in stqcx Case Tom Musta
@ 2014-02-25 2:56 ` Alexander Graf
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Graf @ 2014-02-25 2:56 UTC (permalink / raw)
To: Tom Musta; +Cc: qemu-ppc, qemu-devel
Tom Musta wrote:
> 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 <tommusta@gmail.com>
>
Thanks, applied to ppc-next.
Alex
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-25 1:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-24 14:16 [Qemu-devel] [PATCH] target-ppc: Use Additional Temporary in stqcx Case Tom Musta
2014-02-25 2:56 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).