Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/base/pr115068.c

raw
1 /* { dg-do compile { target { ! riscv_abi_e } } } */
2 /* { dg-add-options riscv_v } */
3 /* { dg-additional-options "-std=gnu99 -Wno-pedantic" } */
4
5 #include <stdint.h>
6 #include "riscv_vector.h"
7
8 vfloat64m8_t
9 test_vfwadd_wf_f64m8_m (vbool8_t vm, vfloat64m8_t vs2, float rs1, size_t vl)
10 {
11 return __riscv_vfwadd_wf_f64m8_m (vm, vs2, rs1, vl);
12 }
13
14 vint64m8_t
15 test_vwadd_wx_i64m8_m (vbool8_t vm, vint64m8_t vs2, int32_t rs1, size_t vl)
16 {
17 return __riscv_vwadd_wx_i64m8_m (vm, vs2, rs1, vl);
18 }
19
20 vint64m8_t
21 test_vwsub_wx_i64m8_m (vbool8_t vm, vint64m8_t vs2, int32_t rs1, size_t vl)
22 {
23 return __riscv_vwsub_wx_i64m8_m (vm, vs2, rs1, vl);
24 }
25
26 char global_memory[1024];
27 void *fake_memory = (void *) global_memory;
28
29 int
30 main ()
31 {
32 asm volatile ("fence" ::: "memory");
33 vfloat64m8_t vfwadd_wf_f64m8_m_vd = test_vfwadd_wf_f64m8_m (
34 __riscv_vreinterpret_v_i8m1_b8 (__riscv_vundefined_i8m1 ()),
35 __riscv_vundefined_f64m8 (), 1.0, __riscv_vsetvlmax_e64m8 ());
36 asm volatile ("" ::"vr"(vfwadd_wf_f64m8_m_vd) : "memory");
37
38 asm volatile ("fence" ::: "memory");
39 vint64m8_t vwadd_wx_i64m8_m_vd = test_vwadd_wx_i64m8_m (
40 __riscv_vreinterpret_v_i8m1_b8 (__riscv_vundefined_i8m1 ()),
41 __riscv_vundefined_i64m8 (), 1.0, __riscv_vsetvlmax_e64m8 ());
42 asm volatile ("" ::"vr"(vwadd_wx_i64m8_m_vd) : "memory");
43
44 asm volatile ("fence" ::: "memory");
45 vint64m8_t vwsub_wx_i64m8_m_vd = test_vwsub_wx_i64m8_m (
46 __riscv_vreinterpret_v_i8m1_b8 (__riscv_vundefined_i8m1 ()),
47 __riscv_vundefined_i64m8 (), 1.0, __riscv_vsetvlmax_e64m8 ());
48 asm volatile ("" ::"vr"(vwsub_wx_i64m8_m_vd) : "memory");
49
50 return 0;
51 }
52
53 /* { dg-final { scan-assembler-not "vfwadd.wf\tv0.*v0" } } */
54 /* { dg-final { scan-assembler-not "vwadd.wx\tv0.*v0" } } */
55 /* { dg-final { scan-assembler-not "vwsub.wx\tv0.*v0" } } */