Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr115214.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-mrvv-vector-bits=scalable -march=rv64gcv -mabi=lp64d -O3 -w -std=gnu17" } */
3 /* { dg-skip-if "" { *-*-* } { "-flto" } } */
4
5 #include "riscv_vector.h"
6
7 static inline __attribute__(()) int vaddq_f32();
8 static inline __attribute__(()) int vload_tillz_f32(int nlane) {
9 vint32m1_t __trans_tmp_9;
10 {
11 int __trans_tmp_0 = nlane;
12 {
13 vint64m1_t __trans_tmp_1;
14 vint64m1_t __trans_tmp_2;
15 vint64m1_t __trans_tmp_3;
16 vint64m1_t __trans_tmp_4;
17 if (__trans_tmp_0 == 1) {
18 {
19 __trans_tmp_3 =
20 __riscv_vslideup_vx_i64m1(__trans_tmp_1, __trans_tmp_2, 1, 2);
21 }
22 __trans_tmp_4 = __trans_tmp_2;
23 }
24 __trans_tmp_4 = __trans_tmp_3;
25 __trans_tmp_9 = __riscv_vreinterpret_v_i64m1_i32m1(__trans_tmp_3);
26 }
27 }
28 return vaddq_f32(__trans_tmp_9); /* { dg-error {RVV type 'vint32m1_t' cannot be passed to an unprototyped function} } */
29 }
30
31 char CFLOAT_add_args[3];
32 const int *CFLOAT_add_steps;
33 const int CFLOAT_steps;
34
35 __attribute__(()) void CFLOAT_add() {
36 char *b_src0 = &CFLOAT_add_args[0], *b_src1 = &CFLOAT_add_args[1],
37 *b_dst = &CFLOAT_add_args[2];
38 const float *src1 = (float *)b_src1;
39 float *dst = (float *)b_dst;
40 const int ssrc1 = CFLOAT_add_steps[1] / sizeof(float);
41 const int sdst = CFLOAT_add_steps[2] / sizeof(float);
42 const int hstep = 4 / 2;
43 vfloat32m1x2_t a;
44 int len = 255;
45 for (; len > 0; len -= hstep, src1 += 4, dst += 4) {
46 int b = vload_tillz_f32(len);
47 int r = vaddq_f32(a.__val[0], b); /* { dg-error {RVV type '__rvv_float32m1_t' cannot be passed to an unprototyped function} } */
48 }
49 for (; len > 0; --len, b_src0 += CFLOAT_steps,
50 b_src1 += CFLOAT_add_steps[1], b_dst += CFLOAT_add_steps[2])
51 ;
52 }