> Hi, yeah that's right.  That's a good indication I need to add that to the 
> docs.
> Now however I only try a vector of all zeros in expand atm, mainly because I 
> don't
> know where to get the other possible else values for non-Len based targets.
> There's a target hook preferred_else_value which different targets seem to
> have interpreted slightly different I think.. AArch64 seems to have 
> interpreted
> it as "given a conditional operation which value is the else value" whereas
> RISC-V seems to have done the same, but defaults to zero if the operation is
> unconditional.
>
> And the default implementation is default_preferred_else_value returns 0.

Just to add a little: I think the implementations of preferred_else_value (not 
mask_load_else) are aligned.  aarch64 and x86 use "zeros" because that's what 
the hardware does and riscv uses "undefined" for vector types, again because 
that's what the hardware/SPEC allows.
Using zero causes slightly less efficient riscv code because we then need to 
explicitly zero out the inactive elements.  As long as we're not relying on 
those in any way (like we do in the mask load case), preferred_else_value 
should work I'd say. 

-- 
Regards
 Robin

Reply via email to