https://github.com/bitcoin/bitcoin/blob/master/src/uint256.h#L258-L259 https://github.com/bitcoin/bitcoin/blob/master/src/uint256.cpp#L204-L216
I might be going a little insane, but I'd assume to find the highest set bit in a uint256 you'd need to start at the highest bit of the leftmost uint32 and progress right. That is:
for (int pos = 0; pos < WIDTH; pos++) {