________________________________________ From: Peter Maydell [peter.mayd...@linaro.org] Sent: Friday, May 17, 2013 8:01 PM To: Petar Jovanovic Cc: qemu-devel@nongnu.org; Petar Jovanovic; aurel...@aurel32.net Subject: Re: [Qemu-devel] [PATCH 2/2] target-mips: fix EXTPDP and setting up pos field in the DSPControl reg
On 13 May 2013 14:20, Petar Jovanovic <petar.jovano...@rt-rk.com> wrote: > @@ -3439,10 +3439,9 @@ target_ulong helper_extpdp(target_ulong ac, > target_ulong size, > if (sub >= -1) { > acc = ((uint64_t)env->active_tc.HI[ac] << 32) | > ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO); > - temp = (acc >> (start_pos - size)) & > - (((uint32_t)0x01 << (size + 1)) - 1); > + temp = (acc >> (start_pos - size)) & (~0U >> (31 - size)); temp = extract64(acc, start_pos - size, size + 1); I think? thanks -- PMM ________________________________________ Thanks Peter, this is indeed more readable. I have just uploaded another patch set with the use of extract64 helper. http://patchwork.ozlabs.org/patch/244721/ Note to Aurelien - the #include "qemu/bitops.h" will cause a conflict if the patch "target-mips: clean-up in BIT_INSV" is applied first, since both patches add that line at the top of the file. Petar