public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/111506] New: RISC-V: Failed to vectorize conversion from INT64 -> _Float16
@ 2023-09-21  1:23 juzhe.zhong at rivai dot ai
  2023-09-28 14:23 ` [Bug target/111506] " cvs-commit at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: juzhe.zhong at rivai dot ai @ 2023-09-21  1:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111506
           Summary: RISC-V: Failed to vectorize conversion from INT64 ->
                    _Float16
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: juzhe.zhong at rivai dot ai
  Target Milestone: ---

#include <stdint.h>

void foo (int64_t *__restrict a, _Float16 * b, int n)
{
    for (int i = 0; i < n; i++) {
        b[i] = (_Float16)a[i];
    }
}

-march=rv64gcv_zvfh_zfh -O3  -fno-trapping-math -fopt-info-vec-missed
-march=rv64gcv_zvfh_zfh -O3  -ffast-math -fopt-info-vec-missed

<source>:5:23: missed: couldn't vectorize loop
<source>:6:27: missed: not vectorized: no vectype for stmt: _4 = *_3;
 scalar_type: int64_t
Compiler returned: 0

https://godbolt.org/z/orevoq7E1

Consider LLVM can vectorize with -fno-trapping-math.
However, LLVM can not vectorize when -ftrapping-math.

So, we need an explicit patterns from INT64 -> _Float16 with
!flag_trapping_math

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

end of thread, other threads:[~2023-10-02 22:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-21  1:23 [Bug c/111506] New: RISC-V: Failed to vectorize conversion from INT64 -> _Float16 juzhe.zhong at rivai dot ai
2023-09-28 14:23 ` [Bug target/111506] " cvs-commit at gcc dot gnu.org
2023-09-28 14:24 ` juzhe.zhong at rivai dot ai
2023-10-02  7:48 ` rdapp at gcc dot gnu.org
2023-10-02 17:29 ` joseph at codesourcery dot com
2023-10-02 18:35 ` rdapp at gcc dot gnu.org
2023-10-02 22:30 ` joseph at codesourcery 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).