> The whole point of using _PRECISION is to have the size be exactly the > same as the mode (bitsize is bigger than the mode for partial-int > modes). TYPE_SIZE_UNIT should be its storage size, right? If the > type is not a multiple of BITS_PER_UNIT, the actual size and > stored-in-memory size are going to be different.
But you cannot use the PRECISION of a mode to set a size, since the SIZE of the mode can be used by the machine to access the object in that mode, so you'll end up with types whose TYPE_SIZE is smaller than the access size. You need to use TYPE_PRECISION here. > The problem in the old code is that BITSIZE is not the size in bits of > the type, it's the size in bytes times BITS_PER_UNIT. This meant that > all partial-int modes would be converted into their non-partial modes > eventually. Most of my patch is about avoiding that. Yes, BITSIZE is the size rounded up to BITS_PER_UNIT, but why is that a problem exactly? Do you have modes whose size is not multiple of the unit? > I'm not reducing it, I'm removing a case where it's rounded up. > Rounding up a 20-bit PSImode gives you SImode eventually. Yes, you are reducing it, the precision of bitsize must be at least that of sizetype + BITS_PER_UNIT_LOG + 1. -- Eric Botcazou