https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127382
--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
It isn't that much different from say long double on x86, though in that case
it is always undefined padding bits.
The only portable builtin for user apps is __builtin_clear_padding through
which one can observe which bits are padding and which are not and can decide
what to do with those bits. Though, most code in the wild just shouldn't care,
similarly how most code in the wild doesn't care about padding bits inside of
structures etc.
For the vectorizer,
struct bitint_info info;
bool ok = targetm.c.bitint_type_info (TYPE_PRECISION (rhs_type),
&info);
gcc_assert (ok);
switch (info.extended)
{
case bitint_ext_undef:
/* Here it needs to extend on loads. */
break;
case bitint_ext_partial:
case bitint_ext_full:
/* Here it needs to extend on stores. */
break;
}
Partial (aka LoongArch) is a little bit complicated, but generally it is just
for the multi-info.mode integers, bits up to GET_MODE_PRECISION (info.mode)
boundary are extended but bits up to GET_MODE_PRECISION (info.abi_mode) beyond
that if any are undefined.