This is the mail archive of the
mailing list for the GCC project.
Re: [rtl, i386] vec_merge simplification
On Wed, 27 Mar 2013, Eric Botcazou wrote:
int is getting small to store one bit per vector element (V32QI...) so I
switched to hwint after checking that Zadeck's patches don't touch this.
unsigned HOST_WIDE_INT is indeed the correct type to use for mask manipulation
but please use UINTVAL instead of INTVAL with it. And:
+ unsigned HOST_WIDE_INT mask = (HOST_WIDE_INT_1 << n_elts) - 1;
can be flagged as relying on undefined behavior (we fixed a bunch of cases a
couple of years ago) so use:
unsigned HOST_WIDE_INT mask = ((unsigned HOST_WIDE_INT) 1 << n_elts) - 1;
By the way, shouldn't this be:
unsigned HOST_WIDE_INT mask = ((unsigned HOST_WIDE_INT) 2 << (n_elts - 1)) - 1;
so it doesn't cause undefined behavior for V64QI?