https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119100
Andrew Waterman <andrew at sifive dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew at sifive dot com --- Comment #4 from Andrew Waterman <andrew at sifive dot com> --- > It really depends on the uarch behavior. I think this is yet another case that needs to depend on -mtune. And there are (at least) two distinct cases: if the value is already in a scalar register (so the tradeoff is using a vf/vx form vs. splatting), or if the value is in memory (so the tradeoff is using a scalar load and a vf/vx form, or using vlse with rs2=x0 to splat from memory). In the absence of other information, it makes sense to use the scalar forms, as they usually reduce instruction count and register pressure. > My general sense is that we probably want to default towards the vf/vi forms, > but I don't have emperical data to back that up yet. I know you meant to write vx rather than vi, since vi doesn't result in any additional communication from scalar to vector. I'm pointing this out just so no one else is misled: there's never a reason to avoid a vi form in favor of a vv form. The potential tradeoff exists only for vf/vx.