qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC PATCH v2 30/44] target/loongarch: Implement vclo vclz


From: Richard Henderson
Subject: Re: [RFC PATCH v2 30/44] target/loongarch: Implement vclo vclz
Date: Sat, 1 Apr 2023 20:34:08 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

On 3/27/23 20:06, Song Gao wrote:
+#define DO_CLO_B(N)  (clz32((uint8_t)~N) - 24)
+#define DO_CLO_H(N)  (clz32((uint16_t)~N) - 16)

I think this is wrong. You *want* the high bits to be set, so that they are ones, and included in the count, which you then subtract off. You want the "real" count to start after the 24th leading 1.


r~



reply via email to

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