summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/riscv/rvv/base/scalar_move-10.c
blob: 9760d77fb22b4cf7d243132ca242eeeb6d0e4092 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* { dg-do compile } */
/* { dg-options "-march=rv64gcv -mabi=lp64d -O0" } */
/* { dg-final { check-function-bodies "**" "" } } */

#include "riscv_vector.h"

/*
** foo1:
** ...
** vsetivli\tzero,0,e16,m1,t[au],m[au]
** vmv.x.s\t[a-x0-9]+,v[0-9]+
** ...
*/
int16_t foo1 (void *base, size_t vl)
{
    int16_t maxVal = __riscv_vmv_x_s_i16m1_i16 (__riscv_vle16_v_i16m1 (base, vl));
    return maxVal;
}

/*
** foo2:
** ...
** vsetivli\tzero,0,e32,m1,t[au],m[au]
** vfmv.f.s\tf[a-x0-9]+,v[0-9]+
** ...
*/
float foo2 (void *base, size_t vl)
{
    float maxVal = __riscv_vfmv_f_s_f32m1_f32 (__riscv_vle32_v_f32m1 (base, vl));
    return maxVal;
}