From: Tom Musta <tommusta@gmail.com>
To: Richard Henderson <rth@twiddle.net>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, thuth@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH] tcg: Fix tcg_reg_alloc_mov vs no-op truncation
Date: Tue, 13 May 2014 17:13:24 -0500 [thread overview]
Message-ID: <53729904.8000601@gmail.com> (raw)
In-Reply-To: <1400018359-6121-1-git-send-email-rth@twiddle.net>
On 5/13/2014 4:59 PM, Richard Henderson wrote:
> Commit af3cbfbe8018ccc16fb3a0048e928f66f0d05e87 hoisted some "common"
> loads of the temporary type, forgetting that the types could differ
> during truncating moves. This affects the correctness of the memory
> offset on big-endian hosts.
>
> Signed-off-by: Richard Henderson <rth@twiddle.net>
Tested-by: Tom Musta <tommusta@gmail.com>
Works functionally and also the low level traces look better:
---
IN:
0x00000fff79d62ae4: rlwimi r4,r4,8,16,23
OP:
ld_i32 tmp0,env,$0xfffffffffffffffc
movi_i32 tmp1,$0x0
brcond_i32 tmp0,tmp1,ne,$0x0
---- 0xfff79d62ae4
mov_i32 tmp0,r4
movi_i32 tmp1,$0x8
rotl_i32 tmp0,tmp0,tmp1
movi_i64 tmp3,$0xffffffff
and_i64 tmp2,tmp0,tmp3
movi_i64 tmp4,$0xff00
and_i64 tmp2,tmp2,tmp4
movi_i64 tmp4,$0xffffffffffff00ff
and_i64 tmp3,r4,tmp4
or_i64 r4,tmp2,tmp3
goto_tb $0x0
movi_i64 nip,$0xfff79d62ae8
exit_tb $0xfff79e7dc30
set_label $0x0
exit_tb $0xfff79e7dc33
OUT: [size=136]
0x60363920: lwz r14,-4(r27)
0x60363924: cmpwi cr7,r14,0
0x60363928: bne- cr7,0x60363994
0x6036392c: ld r14,32(r27) # TEM -- looks better
0x60363930: mr r15,r14
0x60363934: rotlwi r15,r15,8
0x60363938: andi. r15,r15,65280
0x6036393c: lis r0,-1
0x60363940: ori r0,r0,255
0x60363944: and r14,r14,r0
0x60363948: or r14,r15,r14
0x6036394c: std r14,32(r27)
0x60363950: .long 0x0
0x60363954: .long 0x0
0x60363958: .long 0x0
...
NIP 00000fff79d62ae8 LR 00000fff79d55af0 CTR 0000000000000007 XER 0000000000000000
MSR 8000000002006000 HID0 0000000000000000 HF 0000000002006000 idx 0
TB 00000000 00000000
GPR00 00000000100002d9 0000004000a0e040 00000fff79d88ae8 00000000100002d9
GPR04 0000000000002424 0000000000000000 0000000000000000 0000000000000000 # TEM so does GPR04
GPR08 0000000000000000 0000000010010978 000000007fffffff 0000000000000001
prev parent reply other threads:[~2014-05-13 22:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-13 21:59 [Qemu-devel] [PATCH] tcg: Fix tcg_reg_alloc_mov vs no-op truncation Richard Henderson
2014-05-13 22:13 ` Tom Musta [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53729904.8000601@gmail.com \
--to=tommusta@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=thuth@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.