Richard Sandiford <richard.sandif...@arm.com> writes: > I think this would also simplify the evpc detection, since the requirement > for using AND is the same for big-endian and little-endian, namely that > index I of the result must either come from index I of the nonzero > vector or from any element of the zero vector. (What differs between > big-endian and little-endian is which masks correspond to FMOV.)
Or perhaps more accurately, what differs between big-endian and little-endian is the constant that needs to be materialised for a given permute mask. I think the easiest way of handling that would be to construct an array of target_units (0xffs for bytes that come from the nonzero vector, 0x00s for bytes that come from the zero vector) and then get native_encode_rtx to convert that into a vector constant. native_encode_rtx will then do the endian correction for us. Thanks, Richard