| 1 |
/* { dg-do run { target { riscv_v } } } */ |
| 2 |
/* { dg-options "-O2" } */ |
| 3 |
|
| 4 |
#include "riscv_vector.h" |
| 5 |
#include <stdio.h> |
| 6 |
|
| 7 |
int main() |
| 8 |
{ |
| 9 |
int32_t a = 1; |
| 10 |
int32_t b[1] = {3}; |
| 11 |
int32_t c[1] = {10}; |
| 12 |
int32_t d[1] = {0}; |
| 13 |
vint32m1_t vb = __riscv_vle32_v_i32m1 (b, 1); |
| 14 |
vint32m1_t vc = __riscv_vle32_v_i32m1 (c, 1); |
| 15 |
vint32m1_t vd = __riscv_vnmsub_vx_i32m1 (vb, a, vc, 1); |
| 16 |
__riscv_vse32_v_i32m1 (d, vd, 1); |
| 17 |
if (d[0] != 7){ |
| 18 |
printf("d[0] should be 7, but got %d\n", d[0]); |
| 19 |
__builtin_abort (); |
| 20 |
} |
| 21 |
return 0; |
| 22 |
} |