forked from gcc-mirror/gcc
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RISC-V: Do not allow v0 as dest when merging [PR115068].
This patch splits the vfw...wf pattern so we do not emit e.g. vfwadd.wf v0,v8,fa5,v0.t anymore. gcc/ChangeLog: PR target/115068 * config/riscv/vector.md: Split vfw<insn>.wf pattern. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/pr115068-run.c: New test. * gcc.target/riscv/rvv/base/pr115068.c: New test. (cherry picked from commit a2fd081)
- Loading branch information
1 parent
3a7e796
commit 937713a
Showing
3 changed files
with
67 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* { dg-do run } */ | ||
/* { dg-require-effective-target riscv_v_ok } */ | ||
/* { dg-add-options riscv_v } */ | ||
/* { dg-additional-options "-std=gnu99" } */ | ||
|
||
#include <stdint.h> | ||
#include <riscv_vector.h> | ||
|
||
vfloat64m8_t | ||
test_vfwadd_wf_f64m8_m (vbool8_t vm, vfloat64m8_t vs2, float rs1, size_t vl) | ||
{ | ||
return __riscv_vfwadd_wf_f64m8_m (vm, vs2, rs1, vl); | ||
} | ||
|
||
char global_memory[1024]; | ||
void *fake_memory = (void *) global_memory; | ||
|
||
int | ||
main () | ||
{ | ||
asm volatile ("fence" ::: "memory"); | ||
vfloat64m8_t vfwadd_wf_f64m8_m_vd = test_vfwadd_wf_f64m8_m ( | ||
__riscv_vreinterpret_v_i8m1_b8 (__riscv_vundefined_i8m1 ()), | ||
__riscv_vundefined_f64m8 (), 1.0, __riscv_vsetvlmax_e64m8 ()); | ||
asm volatile ("" ::"vr"(vfwadd_wf_f64m8_m_vd) : "memory"); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-add-options riscv_v } */ | ||
/* { dg-additional-options "-std=gnu99" } */ | ||
|
||
#include <stdint.h> | ||
#include <riscv_vector.h> | ||
|
||
vfloat64m8_t | ||
test_vfwadd_wf_f64m8_m (vbool8_t vm, vfloat64m8_t vs2, float rs1, size_t vl) | ||
{ | ||
return __riscv_vfwadd_wf_f64m8_m (vm, vs2, rs1, vl); | ||
} | ||
|
||
char global_memory[1024]; | ||
void *fake_memory = (void *) global_memory; | ||
|
||
int | ||
main () | ||
{ | ||
asm volatile ("fence" ::: "memory"); | ||
vfloat64m8_t vfwadd_wf_f64m8_m_vd = test_vfwadd_wf_f64m8_m ( | ||
__riscv_vreinterpret_v_i8m1_b8 (__riscv_vundefined_i8m1 ()), | ||
__riscv_vundefined_f64m8 (), 1.0, __riscv_vsetvlmax_e64m8 ()); | ||
asm volatile ("" ::"vr"(vfwadd_wf_f64m8_m_vd) : "memory"); | ||
|
||
return 0; | ||
} | ||
|
||
/* { dg-final { scan-assembler-not "vfwadd.wf\tv0.*v0" } } */ |