qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] target-mips: fix EXTPDP and setting up pos


From: Petar Jovanovic
Subject: Re: [Qemu-devel] [PATCH 2/2] target-mips: fix EXTPDP and setting up pos field in the DSPControl reg
Date: Sat, 18 May 2013 02:04:50 +0000

________________________________________
From: Peter Maydell address@hidden
Sent: Friday, May 17, 2013 8:01 PM
To: Petar Jovanovic
Cc: address@hidden; Petar Jovanovic; address@hidden
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 <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]