summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/riscv/rvv/base/vxrm-6.c
blob: 4b346d67c27b40b6f81aca206257db9db71e3e54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do compile } */
/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */

#include "riscv_vector.h"

void f (void * in, void *out, int32_t x, int n, int m)
{
  vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4);
  vint32m1_t v2 = __riscv_vle32_v_i32m1_tu (v, in + 100, 4);
  vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, VXRM_RDN, 4);
  v3 = __riscv_vaadd_vx_i32m1 (v3, 3, VXRM_RDN, 4);
  __riscv_vse32_v_i32m1 (out + 100, v3, 4);
}

/* { dg-final { scan-assembler-times {csrwi\s+vxrm,\s*2} 1 } } */