| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d -mrvv-vector-bits=scalable --param vect-epilogues-nomask=0 -fno-signaling-nans" } */ |
| 3 |
|
| 4 |
#include <stdint-gcc.h> |
| 5 |
|
| 6 |
#ifndef FN |
| 7 |
#define FN(X) __builtin_fmax##X |
| 8 |
#endif |
| 9 |
|
| 10 |
#define DEF_LOOP(FN, SUFFIX, TYPE) \ |
| 11 |
void __attribute__ ((noipa)) \ |
| 12 |
test_##TYPE (TYPE *__restrict x, TYPE *__restrict y, int n) \ |
| 13 |
{ \ |
| 14 |
for (int i = 0; i < n; ++i) \ |
| 15 |
x[i] = FN (SUFFIX) (x[i], y[i]); \ |
| 16 |
} |
| 17 |
|
| 18 |
#define TEST_ALL(T) T (FN, f16, _Float16) |
| 19 |
|
| 20 |
TEST_ALL (DEF_LOOP) |
| 21 |
|
| 22 |
/* { dg-final { scan-assembler-times {vfmax\.vv\s+v[0-9]+,v[0-9]+,v[0-9]+} 1 } } */ |