public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/113240] New: Use wrong rule to pass fixed-length(size<=2*XLEN) vector argument
@ 2024-01-05  2:41 lehua.ding at rivai dot ai
  2024-01-05  2:50 ` [Bug target/113240] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: lehua.ding at rivai dot ai @ 2024-01-05  2:41 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113240
           Summary: Use wrong rule to pass fixed-length(size<=2*XLEN)
                    vector argument
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lehua.ding at rivai dot ai
  Target Milestone: ---

According to a recent proposal
(https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/416), GCC
incorrectly uses references when passing fixed-length vector arguments with
size less than or equal to 2*VLEN instead of scalar registers for passing.
Reproduced online: https://godbolt.org/z/3ooovcz7c

C Code:
```
#include <stdint.h>

typedef int v4si __attribute__ ((vector_size (16)));

v4si foo (v4si a, v4si b)
{
  v4si c = a + b;
  return c;
}
```

Asm:
```
foo:
        vsetivli        zero,4,e32,m1,ta,ma
        vle32.v v1,0(a1)
        vle32.v v2,0(a2)
        vadd.vv v1,v1,v2
        vse32.v v1,0(a0)
        ret
```

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

end of thread, other threads:[~2024-01-05  7:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-05  2:41 [Bug target/113240] New: Use wrong rule to pass fixed-length(size<=2*XLEN) vector argument lehua.ding at rivai dot ai
2024-01-05  2:50 ` [Bug target/113240] " pinskia at gcc dot gnu.org
2024-01-05  3:14 ` lehua.ding at rivai dot ai
2024-01-05  3:39 ` pinskia at gcc dot gnu.org
2024-01-05  3:49 ` lehua.ding at rivai dot ai
2024-01-05  4:38 ` pinskia at gcc dot gnu.org
2024-01-05  7:05 ` kito 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).