public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "crazylht at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108804] missed vectorization in presence of conversion from uint64_t to float Date: Tue, 21 Feb 2023 00:54:47 +0000 [thread overview] Message-ID: <bug-108804-4-4qQ5leQKR4@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-108804-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108804 --- Comment #3 from Hongtao.liu <crazylht at gmail dot com> --- I think the point here is: although it's unit64_t -> float, but the range of x and y can be represent as int32(k & 0x007FFFFF) | 0x3F800000), so we can use int32 -> float instructions which are supported by the backend. So it looks to me a middle-end issue. A simple testcase clang generates vcvtdq2ps but gcc doesn't vectorize. #include<stdint.h> uint64_t d[512]; float f[1024]; void foo() { for (int i=0; i<512; ++i) { uint64_t k = d[i]; f[i]=(k & 0x3F30FFFF); } } manually add convertion then gcc also can do vectorization. #include<stdint.h> uint64_t d[512]; float f[1024]; void foo() { for (int i=0; i<512; ++i) { uint64_t k = d[i]; f[i]=(int)(k & 0x3F30FFFF); } }
next prev parent reply other threads:[~2023-02-21 0:54 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-02-15 14:16 [Bug tree-optimization/108804] New: " vincenzo.innocente at cern dot ch 2023-02-15 20:28 ` [Bug tree-optimization/108804] " pinskia at gcc dot gnu.org 2023-02-15 20:30 ` [Bug target/108804] " pinskia at gcc dot gnu.org 2023-02-20 11:14 ` rguenth at gcc dot gnu.org 2023-02-21 0:54 ` crazylht at gmail dot com [this message] 2023-03-09 5:52 ` crazylht at gmail dot com 2023-05-30 23:18 ` cvs-commit at gcc dot gnu.org 2023-05-30 23:18 ` crazylht at gmail dot com
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-108804-4-4qQ5leQKR4@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).