Hi, On 7/15/25 22:14, Segher Boessenkool wrote:
Does the manual say what type the result should be?
I would expect that it does not matter in the majority of cases. The output from the comparison has a width that is measured in lanes, and it will be used as an input to a conditional or flow control instruction that has a control input whose width is measured in lanes.
The type information is relevant only when storing or spilling the variable, to select the appropriate load/store instructions -- but these are symmetrical, and when the value is retrieved, it is distributed across lanes as before and the layout of the storage is no longer relevant.
I also expect that in pretty much any vector unit that exists, the output of the comparison instructions can directly be used for selection and flow control, and the conversion to and from the type declared in the input language is either a no-op or becomes one during optimization (e.g. sign-extend followed by masking out higher-order bits).
When we need to store or spill, we're already on a fairly slow path anyway, and the difference in load/store efficiency between different types is tiny compared to the cost of touching memory in the first place.
Simon