https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114801
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Christophe Lyon from comment #3) > lowpart_subreg does not work either. > > If we put the predicates in a variable in the testcase, then in > function_expander::add_input_operand() x is already a (subreg/s/v:HI (reg:SI > 116 [ _3 ]) 0) so taking gen_lowpart of that is OK (we just want HImode to > get the 16 bits of predicates). If x could be e.g. (subreg:SI (reg:DI ...) ...), then one needs to use for GET_CODE (x) == SUBREG && GET_MODE (x) != mode do a force_reg first. > But when predicates are passed as a constant as in the testcase, we have > x = (const_int -13108 [0xffffffffffffcccc]) > and gen_lowpart (HImode, x) fails on that. Why doesn't lowpart_subreg (mode, x, GET_MODE (x) == VOIDmode ? DImode : GET_MODE (x)); work? I.e. for CONST_INTs assume it is some constant in a mode equal or wider than mode. Unless mode can be TImode or x can be __int128 constants, that is. > I'm trying an approach to convert the constant into a vector of constants > whose mode will V4BImode in this case.