Returns true if the right shift is inexact (i.e. any bit shifted out is non-zero)
This is analogous to an shr version of @shlWithOverflow
fn wideShrWithTruncation(comptime Z: type, hi: *Z, lo: *Z, count: u32) bool
fn wideShrWithTruncation(comptime Z: type, hi: *Z, lo: *Z, count: u32) bool {
@setRuntimeSafety(compiler_rt.test_safety);
const typeWidth = @typeInfo(Z).int.bits;
var inexact = false;
if (count < typeWidth) {
inexact = (lo.* << @intCast(typeWidth -% count)) != 0;
lo.* = (hi.* << @intCast(typeWidth -% count)) | (lo.* >> @intCast(count));
hi.* = hi.* >> @intCast(count);
} else if (count < 2 * typeWidth) {
inexact = (hi.* << @intCast(2 * typeWidth -% count) | lo.*) != 0;
lo.* = hi.* >> @intCast(count -% typeWidth);
hi.* = 0;
} else {
inexact = (hi.* | lo.*) != 0;
lo.* = 0;
hi.* = 0;
}
return inexact;
}