public static ulong bits_zerohigh(ulong x, int startIndex) { if (Bmi2.IsBmi2Supported) { return(Bmi2.bzhi_u64(x, (uint)startIndex)); } else { return(andnot(x, ulong.MaxValue << startIndex)); } }