[Bug rtl-optimization/56766] Fails to combine (vec_select (vec_concat ...)) to (vec_merge ...)

ubizjak at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Jun 12 06:24:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56766

--- Comment #21 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Richard Biener from comment #0)

> typedef double v2df __attribute__((vector_size(16)));
> typedef long long v2di __attribute__((vector_size(16)));
> v2df foo (v2df x, v2df y)
> {
>   v2df tem1 = x + y;
>   v2df tem2 = x - y;
>   return __builtin_shuffle (tem1, tem2, (v2di) { 0, 3 });
> }

This testcase is wrong, it doesn't describe addsubpd insn. Since the element 0
is at the left, the above describes

__builtin_shuffle ({ x0 + y0, x1 + y1 }, { x0 - y0, x1 - y1 }, { 0, 3 })

==>

{ x0 + y0, x1 - y1 }

addsubpd insn however does:

{ x0 - y0, x1 + y1 }

I will attach the testcase I'm using here, and updated patch.


More information about the Gcc-bugs mailing list