summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/vect-fmaxv-fminv.x
blob: 0bc6ba494cf76e606a7084d74e71f629c4bb01a9 (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
32
33
34
35
36
37
38
39
40
41
42
43

typedef float *__restrict__ pRF32;
typedef double *__restrict__ pRF64;

float maxv_f32 (pRF32 a)
{
  int i;
  float s = a[0];
  for (i=1;i<8;i++)
    s = (s > a[i] ? s :  a[i]);

  return s;
}

float minv_f32 (pRF32 a)
{
  int i;
  float s = a[0];
  for (i=1;i<16;i++)
    s = (s < a[i] ? s :  a[i]);

  return s;
}

double maxv_f64 (pRF64 a)
{
  int i;
  double s = a[0];
  for (i=1;i<8;i++)
    s = (s > a[i] ? s :  a[i]);

  return s;
}

double minv_f64 (pRF64 a)
{
  int i;
  double s = a[0];
  for (i=1;i<16;i++)
    s = (s < a[i] ? s :  a[i]);

  return s;
}