On 6/16/26 08:27, Peter Maydell wrote:
+ if (t) {
+ return ((clz64(t) ^ 63) + i * 64) >> esz;
Why XOR? Shouldn't this be the same kind of expression as
we use in last_active_element():
return i * 64 + (63 - clz64(this_g));
True, it could be written that way -- it's logically equivalent. I think it's an ingrained
x86 bias on my part, where an RSUBI type instruction doesn't exist.
+ tcg_gen_clzi_i64(v, v, 64);
+ tcg_gen_subfi_i64(v, 63, v);
...and we use 63 - clz64(...) here.
With this one, v might be 0 and so 63 - 64 produces -1.
r~