[Qemu-devel] [PATCH] target-mips: Fix incorrect shift for SHILO and SHILOV

2012-12-04 Thread Petar Jovanovic
From: Petar Jovanovic pet...@mips.com helper_shilo has not been shifting an accumulator value correctly for negative values in 'shift' field. Minor optimization for shift=0 case. This change also adds tests that will trigger issue and check for regressions. Signed-off-by: Petar Jovanovic

Re: [Qemu-devel] [PATCH] target-mips: Fix incorrect shift for SHILO and SHILOV

2012-12-04 Thread Blue Swirl
On Tue, Dec 4, 2012 at 2:49 PM, Petar Jovanovic petar.jovano...@rt-rk.com wrote: From: Petar Jovanovic pet...@mips.com helper_shilo has not been shifting an accumulator value correctly for negative values in 'shift' field. Minor optimization for shift=0 case. This change also adds tests that

Re: [Qemu-devel] [PATCH] target-mips: Fix incorrect shift for SHILO and SHILOV

2012-12-04 Thread Jovanovic, Petar
diff --git a/target-mips/dsp_helper.c b/target-mips/dsp_helper.c index e7949c2..f8a7a9f 100644 --- a/target-mips/dsp_helper.c +++ b/target-mips/dsp_helper.c @@ -3814,17 +3814,17 @@ void helper_shilo(target_ulong ac, target_ulong rs, CPUMIPSState *env) rs5_0 = rs 0x3F; rs5_0 =

Re: [Qemu-devel] [PATCH] target-mips: Fix incorrect shift for SHILO and SHILOV

2012-12-04 Thread Blue Swirl
On Tue, Dec 4, 2012 at 7:43 PM, Richard Henderson r...@twiddle.net wrote: On 2012-12-04 13:00, Blue Swirl wrote: +if (rs5_0 == 0) +return; The check should be moved to translation time so that the call to this helper is not generated at all. No, we'd do that only if this value

Re: [Qemu-devel] [PATCH] target-mips: Fix incorrect shift for SHILO and SHILOV

2012-12-04 Thread Blue Swirl
On Tue, Dec 4, 2012 at 7:48 PM, Jovanovic, Petar pet...@mips.com wrote: diff --git a/target-mips/dsp_helper.c b/target-mips/dsp_helper.c index e7949c2..f8a7a9f 100644 --- a/target-mips/dsp_helper.c +++ b/target-mips/dsp_helper.c @@ -3814,17 +3814,17 @@ void helper_shilo(target_ulong ac,

Re: [Qemu-devel] [PATCH] target-mips: Fix incorrect shift for SHILO and SHILOV

2012-12-04 Thread Andreas Färber
Am 04.12.2012 20:48, schrieb Jovanovic, Petar: diff --git a/target-mips/dsp_helper.c b/target-mips/dsp_helper.c index e7949c2..f8a7a9f 100644 --- a/target-mips/dsp_helper.c +++ b/target-mips/dsp_helper.c @@ -3814,17 +3814,17 @@ void helper_shilo(target_ulong ac, target_ulong rs,

Re: [Qemu-devel] [PATCH] target-mips: Fix incorrect shift for SHILO and SHILOV

2012-12-04 Thread Jovanovic, Petar
From: Andreas Färber [afaer...@suse.de] FWIW you could use our unlikely() macro then to aid branch prediction. Just did. Thanks. Petar

Re: [Qemu-devel] [PATCH] target-mips: Fix incorrect shift for SHILO and SHILOV

2012-12-04 Thread Richard Henderson
On 2012-12-04 13:00, Blue Swirl wrote: +if (rs5_0 == 0) +return; The check should be moved to translation time so that the call to this helper is not generated at all. No, we'd do that only if this value were an immediate. Branch over helper is not an optimization for an edge