This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch 1/4] change specific int128 -> generic intN


> Except gcc now knows the size of partial int modes.  In this case,
> PSImode is 20 bits and TYPE_SIZE is 20 bits, so they match.

I don't understand.  The problematic change is

> -      TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)));
> +      TYPE_SIZE (type) = bitsize_int (GET_MODE_PRECISION (TYPE_MODE
> (type))); TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE
> (type))); break;

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.

> 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)?

-- 
Eric Botcazou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]