summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/paired-3.c
blob: 2e4bbf4af6d004a7043b67576c5acd6664498076 (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
/* { dg-do compile { target { powerpc-*-linux*paired* && ilp32 } } } */
/* { dg-options "-mpaired -ffinite-math-only" } */

/* Test PowerPC PAIRED extensions.  */

#include <paired.h>
#include <stdlib.h>

static float out[2] __attribute__ ((aligned (8)));

vector float b = { 2.0, 8.0 };
vector float c = { 3.0, 5.0 };

vector float a = { 0.0, 0.0 };
void
test_api ()
{

  if (paired_cmpu0_lt (b, c))
    {
      a = paired_add (b, c);
      paired_stx (a, 0, out);
    }
  if ((out[0] != 5.0) || (out[1] != 13.0))
    abort ();
}

int
main ()
{
  test_api ();
  return (0);
}