public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "mkretz at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/85048] [missed optimization] vector conversions Date: Fri, 19 Apr 2024 13:49:13 +0000 [thread overview] Message-ID: <bug-85048-4-5Ce4eYJcrb@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-85048-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85048 --- Comment #13 from Matthias Kretz (Vir) <mkretz at gcc dot gnu.org> --- Should I open a new PR for the remaining ((u)int64, 16) <-> (float, 16) conversions? https://godbolt.org/z/x3xPMYKj3 Note that __builtin_convertvector produces the code we want. template <class T, int N, int Size = N * sizeof (T)> using V [[gnu::vector_size (Size)]] = T; template <class From, class To> V<To, 16> cvt16 (V<From, 16> x) { #if BUILTIN return __builtin_convertvector (x, V<To, 16>); #else return V<To, 16>{ To (x[0]), To (x[1]), To (x[2]), To (x[3]), To (x[4]), To (x[5]), To (x[6]), To (x[7]), To (x[8]), To (x[9]), To (x[10]), To (x[11]), To (x[12]), To (x[13]), To (x[14]), To (x[15]) }; #endif } #define _(name, from, to, size) \ auto name (V<from, size> x) { return cvt##size<from, to> (x); } // integral -> float _ (vcvtqq2ps, int64_t, float, 16) _ (vcvtuqq2ps, uint64_t, float, 16) // float -> integral _ (vcvttps2qq, float, int64_t, 16) _ (vcvttps2uqq, float, uint64_t, 16)
next prev parent reply other threads:[~2024-04-19 13:49 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-85048-4@http.gcc.gnu.org/bugzilla/> 2023-03-21 20:07 ` mkretz at gcc dot gnu.org 2023-03-22 1:25 ` crazylht at gmail dot com 2023-03-22 1:40 ` crazylht at gmail dot com 2023-03-22 2:10 ` crazylht at gmail dot com 2023-03-31 1:04 ` cvs-commit at gcc dot gnu.org 2023-03-31 1:07 ` crazylht at gmail dot com 2023-03-31 7:28 ` ubizjak at gmail dot com 2024-04-19 13:49 ` mkretz at gcc dot gnu.org [this message] 2024-04-22 0:37 ` liuhongt at gcc dot gnu.org 2024-04-22 8:21 ` mkretz at gcc dot gnu.org 2024-04-22 11:52 ` liuhongt at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-85048-4-5Ce4eYJcrb@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).