On Fri, Jan 31, 2020 at 11:30:22AM -0600, Segher Boessenkool wrote: > But why is that the correct thing to do? Garbage in, garbage out is > perfectly fine? Or do we have (e.g.) builtins that specify this masking? > If so, please say that here.
It has been this way since I added these for power7 or power8, so I'm not changing the semantics here. Quoting from the LE abi: VEC_EXTRACT (ARG1, ARG2) This function uses modular arithmetic on ARG2 to determine the element number. For example, if ARG2 is out of range, the compiler uses ARG2 modulo the number of elements in the vector to determine the element position. So if we were to remove the ANDing, we would have to change the ABI. -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meiss...@linux.ibm.com, phone: +1 (978) 899-4797