public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/108804] New: missed vectorization in presence of conversion from uint64_t to float
@ 2023-02-15 14:16 vincenzo.innocente at cern dot ch
  2023-02-15 20:28 ` [Bug tree-optimization/108804] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2023-02-15 14:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108804
           Summary: missed vectorization in presence of conversion from
                    uint64_t to float
           Product: gcc
           Version: 12.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vincenzo.innocente at cern dot ch
  Target Milestone: ---

in the following code [1] foo does not vectorize, bar doos
compiled with -march=haswell -Ofast --no-math-errno -Wall
see
https://godbolt.org/z/E6xzfavxc

clang seems do do better

[1]
#include<cstdint>



uint64_t d[512];
//uint32_t f[1024];
float f[1024];

void foo() {
    for (int i=0; i<512; ++i) {
        uint64_t k = d[i];
        auto x  = (k & 0x007FFFFF) |  0x3F800000;
        k = k >> 23;
        auto y  = (k & 0x007FFFFF) |  0x3F800000;
        f[i]=x; f[128+i] = y;

    }    
}

void bar() {
    for (int i=0; i<512; ++i) {
        uint64_t k = d[i];
        uint32_t x  = (k & 0x007FFFFF);
        x |= 0x3F800000;
        uint32_t y  = k >> 23;
        y  = (y & 0x007FFFFF) |  0x3F800000;
        f[i]=x; f[128+i] = y;

    }  
}

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-05-30 23:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-15 14:16 [Bug tree-optimization/108804] New: missed vectorization in presence of conversion from uint64_t to float 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
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

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).