[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 0/7] tcg: movcond (ppc32 version)
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH v2 0/7] tcg: movcond (ppc32 version) |
Date: |
Fri, 21 Sep 2012 15:21:24 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0 |
On 09/21/2012 01:10 PM, malc wrote:
> + if (dest == v2) {
> + label_ptr = s->code_ptr;
> + tcg_out32 (s, tcg_to_bc[tcg_invert_cond (cond)]);
> + tcg_out_mov (s, TCG_TYPE_I32, dest, v1);
> + reloc_pc14 (label_ptr, (tcg_target_long) s->code_ptr);
> + }
> + else {
> + tcg_out_mov (s, TCG_TYPE_I32, dest, v1);
> + label_ptr = s->code_ptr;
> + tcg_out32 (s, tcg_to_bc[cond]);
> + tcg_out_mov (s, TCG_TYPE_I32, dest, v2);
> + reloc_pc14 (label_ptr, (tcg_target_long) s->code_ptr);
> + }
How about
if (dest == v2) {
cond = tcg_invert_cond(cond);
v2 = v1;
} else if (dest != v1) {
tcg_out_mov(s, TCG_TYPE_I32, dest, v1);
}
/* Branch forward over one insn. */
tcg_out32 (s, tcg_to_bc[cond] | 4);
tcg_out_mov(s, TCG_TYPE_I32, dest, v2);
which avoids an extra mov if dest == v1, and also minimizes the code.
r~
- Re: [Qemu-devel] [PATCH 7/7] tcg: Streamline movcond_i64 using movcond_i32, (continued)
[Qemu-devel] [PATCH 2/7] target-alpha: Use movcond, Richard Henderson, 2012/09/21
[Qemu-devel] [PATCH 5/7] tcg: Optimize two-address commutative operations, Richard Henderson, 2012/09/21
[Qemu-devel] [PATCH 6/7] tcg: Streamline movcond_i64 using 32-bit arithmetic, Richard Henderson, 2012/09/21
Re: [Qemu-devel] [PATCH v2 0/7] tcg: movcond, Aurelien Jarno, 2012/09/21
Re: [Qemu-devel] [PATCH v2 0/7] tcg: movcond (ppc32 version), malc, 2012/09/21