[PATCH] D42100: Fix codegen of stores of vectors with non byte-sized elements.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 12:46:09 PST 2018


efriedma added a comment.

We never really formally defined the encoding of vectors, I think.  The DataLayout has computed the size in bits of vector types as element_size_in_bits*num_elements for a long time, though (so there's no padding between elements), and we've generally had the rule that the lowest element has the lowest address, since that's generally how vector units work on both big-endian and little-endian targets.

Given those two constraints, there's only one possible rule for non-power-of-two byte-sized elements: `<4 x i24>` should have the same layout as `<{ i24, i24, i24, i24 }>` (a packed struct).  And there's only one way to extrapolate that rule to non-byte-size element types: essentially, if you bitcast the vector to an integer, the first element should be in the high bit(s).


https://reviews.llvm.org/D42100





More information about the llvm-commits mailing list