> which means that the precision of the mode is used to set the size > of the type, which very likely means that the size of the mode is > larger. So the size of the mode will be larger than the size of the > type, which is a lie.
For partial int modes, the precision and size are the same, and normally not a power of two. The assumption that "PSImode is the same size as SImode" is no longer valid. > > The code was biting me when TYPE_SIZE was bigger than PSImode, and > > the code kept choosing SImode instead. > > IMO you're papering over the real issue, which appears to be the > choice of the mode. Why does the code choose PSImode instead of > SImode, if the type and the mode have the same precision (20) and > size (24)? PSImode is 20 bits, fits in a 20 bit register, and uses 20 bit operations. SImode is 32 bits, fits in two 16 bit registers, and uses 32 bit operations. If a type is 17-20 bits, PSImode is chosen. If it's 21 bits or larger, SImode is chosen. If it's 16 or fewer bits, HImode is chosen. If you look at part 2 of the patch, you'll see lots of code that implements this logic, although the change to specify the sizes of partial int modes has been in for a while.