Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/base/vxrm-10.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -fno-schedule-insns -fno-schedule-insns2" } */
3
4 #include "riscv_vector.h"
5
6 void f (void * in, void *out, int32_t x, int n, int m)
7 {
8 for (int i = 0; i < n; i++) {
9 vint32m1_t v = __riscv_vle32_v_i32m1 (in + i, 4);
10 vint32m1_t v2 = __riscv_vle32_v_i32m1_tu (v, in + 100 + i, 4);
11 vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, __RISCV_VXRM_RDN, 4);
12 v3 = __riscv_vaadd_vx_i32m1 (v3, 3, __RISCV_VXRM_RDN, 4);
13 __riscv_vse32_v_i32m1 (out + 100 + i, v3, 4);
14 }
15
16 for (int i = 0; i < n; i++) {
17 vint32m1_t v = __riscv_vle32_v_i32m1 (in + i + 1000, 4);
18 vint32m1_t v2 = __riscv_vle32_v_i32m1_tu (v, in + 100 + i + 1000, 4);
19 vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, __RISCV_VXRM_RNE, 4);
20 v3 = __riscv_vaadd_vx_i32m1 (v3, 3, __RISCV_VXRM_RNE, 4);
21 __riscv_vse32_v_i32m1 (out + 100 + i + 1000, v3, 4);
22 }
23 }
24
25 /* { dg-final { scan-assembler-times {csrwi\s+vxrm,\s*1} 1 } } */
26 /* { dg-final { scan-assembler-times {csrwi\s+vxrm,\s*2} 1 } } */