[Bug target/95125] Unoptimal code for vectorized conversions

crazylht at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri May 22 07:46:23 GMT 2020


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

--- Comment #5 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Uroš Bizjak from comment #3)
> It turns out that a bunch of patterns have to be renamed (and testcases
> added).
> 
> Easyhack, waiting for someone to show some love to conversion patterns in
> sse.md.

expander for floatv4siv4df2, fix_truncv4dfv4si2 already exists.

if change **float_double fix_double** to
---
void
float_double (void)
{
    d[0] = i[0];
    d[1] = i[1];
    d[2] = i[2];
    d[3] = i[3];
}

void
fix_double (void)
{
    i[0] = d[0];
    i[1] = d[1];
    i[2] = d[2];
    i[3] = d[3];
}
----

it successfully generate

---
float_double():
        vcvtdq2pd       i(%rip), %ymm0
        vmovapd %ymm0, d(%rip)
        vzeroupper
        ret
fix_double():
        vcvttpd2dqy     d(%rip), %xmm0
        vmovdqa %xmm0, i(%rip)
        ret
l:
-----


More information about the Gcc-bugs mailing list