public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107283] New: conversions u/int64_t to float64/32_t are not vectorized
@ 2022-10-16 23:22 g.peterhoff@t-online.de
  2022-10-16 23:24 ` [Bug tree-optimization/107283] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: g.peterhoff@t-online.de @ 2022-10-16 23:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107283
           Summary: conversions u/int64_t to float64/32_t are not
                    vectorized
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: g.peterhoff@t-online.de
  Target Milestone: ---

The conversions u/int64_t to float64/32_t are not vectorisized if no HW-support
(eg AVX512) available.

But we can do that manually
https://stackoverflow.com/questions/41144668/how-to-efficiently-perform-double-int64-conversions-with-sse-avx

In the case u/int64_t -> float32_t i first convert to float64_t and then to
float32_t. There might be a better way to implement this.

With HW-support the standard implementation is of course faster.

https://godbolt.org/z/WTa663PrK

thx
Gero

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

* [Bug tree-optimization/107283] conversions u/int64_t to float64/32_t are not vectorized
  2022-10-16 23:22 [Bug c++/107283] New: conversions u/int64_t to float64/32_t are not vectorized g.peterhoff@t-online.de
@ 2022-10-16 23:24 ` pinskia at gcc dot gnu.org
  2022-10-16 23:31 ` g.peterhoff@t-online.de
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-16 23:24 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
           Severity|normal                      |enhancement
          Component|c++                         |tree-optimization

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I suspect there is a dup of this bug already.

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

* [Bug tree-optimization/107283] conversions u/int64_t to float64/32_t are not vectorized
  2022-10-16 23:22 [Bug c++/107283] New: conversions u/int64_t to float64/32_t are not vectorized g.peterhoff@t-online.de
  2022-10-16 23:24 ` [Bug tree-optimization/107283] " pinskia at gcc dot gnu.org
@ 2022-10-16 23:31 ` g.peterhoff@t-online.de
  2022-10-17  8:10 ` [Bug target/107283] " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: g.peterhoff@t-online.de @ 2022-10-16 23:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from g.peterhoff@t-online.de ---
That will be right. I had reported something similar many years ago - but it
was not fixed.

thx
Gero

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

* [Bug target/107283] conversions u/int64_t to float64/32_t are not vectorized
  2022-10-16 23:22 [Bug c++/107283] New: conversions u/int64_t to float64/32_t are not vectorized g.peterhoff@t-online.de
  2022-10-16 23:24 ` [Bug tree-optimization/107283] " pinskia at gcc dot gnu.org
  2022-10-16 23:31 ` g.peterhoff@t-online.de
@ 2022-10-17  8:10 ` rguenth at gcc dot gnu.org
  2022-10-17  9:41 ` jakub at gcc dot gnu.org
  2022-10-17  9:59 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-10-17  8:10 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
          Component|tree-optimization           |target
             Target|                            |x86_64-*-* i?86-*-*
   Last reconfirmed|                            |2022-10-17
            Version|unknown                     |13.0
             Status|UNCONFIRMED                 |NEW
             Blocks|                            |53947

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
More like a target issue.  Note that u/int64_t when it doesn't fit float32_t
eventually would need to raise a different exception than the float64_t ->
float32_t Inf result does so the trick might not be fully IEEE conforming.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
[Bug 53947] [meta-bug] vectorizer missed-optimizations

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

* [Bug target/107283] conversions u/int64_t to float64/32_t are not vectorized
  2022-10-16 23:22 [Bug c++/107283] New: conversions u/int64_t to float64/32_t are not vectorized g.peterhoff@t-online.de
                   ` (2 preceding siblings ...)
  2022-10-17  8:10 ` [Bug target/107283] " rguenth at gcc dot gnu.org
@ 2022-10-17  9:41 ` jakub at gcc dot gnu.org
  2022-10-17  9:59 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-10-17  9:41 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The link you've provided is about how to do it with severe limitations.
So, we could do it that way only if the ranger tells us the integral (or
floating point) values are in a certain range (+ -ffast-math or similar that
you don't care about infinities etc.).

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

* [Bug target/107283] conversions u/int64_t to float64/32_t are not vectorized
  2022-10-16 23:22 [Bug c++/107283] New: conversions u/int64_t to float64/32_t are not vectorized g.peterhoff@t-online.de
                   ` (3 preceding siblings ...)
  2022-10-17  9:41 ` jakub at gcc dot gnu.org
@ 2022-10-17  9:59 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-10-17  9:59 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl.tools at gmail dot com,
                   |                            |liuhongt at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Sorry, I missed the full sequences later on for {,u}int64_t -> double, that is
something to look at first I guess.

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

end of thread, other threads:[~2022-10-17  9:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-16 23:22 [Bug c++/107283] New: conversions u/int64_t to float64/32_t are not vectorized g.peterhoff@t-online.de
2022-10-16 23:24 ` [Bug tree-optimization/107283] " pinskia at gcc dot gnu.org
2022-10-16 23:31 ` g.peterhoff@t-online.de
2022-10-17  8:10 ` [Bug target/107283] " rguenth at gcc dot gnu.org
2022-10-17  9:41 ` jakub at gcc dot gnu.org
2022-10-17  9:59 ` jakub at gcc dot gnu.org

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