ApInt::sign_bit always returns the most significant bit of the most significant digit of the ApInt which is wrong since Digit does not know about the bit width of an ApInt and thus this calculation only works for bit widths that are multiples of the exact Digit bit width which is 64. ApInt::most_significant_bit has the same error.
ApInt::sign_bit
always returns the most significant bit of the most significant digit of theApInt
which is wrong sinceDigit
does not know about the bit width of anApInt
and thus this calculation only works for bit widths that are multiples of the exactDigit
bit width which is64
.ApInt::most_significant_bit
has the same error.