On Mon, Jul 24, 2017 at 8:28 PM, Balbir Singh wrote:
> On Mon, Jul 24, 2017 at 11:01 AM, Matt Brown
> wrote:
>> This adds emulations for the popcntb, popcntw, and popcntd instructions.
>> Tested for correctness against the popcnt{b,w,d} instructions on ppc64le.
>>
>> Signed-off-by: Matt Brown
>>
On Mon, Jul 24, 2017 at 11:01 AM, Matt Brown
wrote:
> This adds emulations for the popcntb, popcntw, and popcntd instructions.
> Tested for correctness against the popcnt{b,w,d} instructions on ppc64le.
>
> Signed-off-by: Matt Brown
> ---
> v2:
> - fixed opcodes
> - fixed typecast
Hi Matt,
On Mon, Jul 24, 2017 at 11:01:06AM +1000, Matt Brown wrote:
> + for (i = 0; i < (64 / size); i++) {
If you do
for (i = 0; i < 64; i += size)
things are slightly nicer.
> + if ((i * size) < 32)
> + low |= n << (i * size);
> + else
> +
This adds emulations for the popcntb, popcntw, and popcntd instructions.
Tested for correctness against the popcnt{b,w,d} instructions on ppc64le.
Signed-off-by: Matt Brown
---
v2:
- fixed opcodes
- fixed typecasting
- fixed bitshifting error for both 32 and 64bit arch
---