https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113622
--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Xi Ruoyao from comment #12)
> (In reply to Jakub Jelinek from comment #11)
> > I think it is most important we don't ICE and generate correct code. I
> > doubt this is used too much in real-world code, otherwise it would have been
> > reported years ago, so how efficient it will be is less important.
>
> Hmm, but for another test case (LoongArch):
>
> typedef double __attribute__ ((vector_size (32))) vec;
> register vec a asm("f25"), b asm("f26"), c asm("f27");
>
> void
> test (void)
> {
> for (int i = 0; i < 4; i++)
> c[i] = __builtin_isless (a[i], b[i]) ? 0.1 : 0.2;
> }
>
> I'll have to write a loop (because __builtin_isless does not work on
> vectors). Or is there a vector built-in I'm missing?
Why are you doing that?
Normally tests would do
vec
test (vec a, vec b)
{
vec c = {};
for (int i = 0; i < 4; i++)
c[i] = __builtin_isless (a[i], b[i]) ? 0.1 : 0.2;
return c;
}
or something similar.