OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [fma-256-fmaddsubXX.c] - Blame information for rev 848

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do run } */
2
/* { dg-require-effective-target fma } */
3
/* { dg-options "-O2 -mfma" } */
4
 
5
#include "fma-check.h"
6
 
7
#include <x86intrin.h>
8
#include "m256-check.h"
9
 
10
void
11
check_mm256_fmaddsub_ps (__m256 __A, __m256 __B, __m256 __C)
12
{
13
  union256 a, b, c, e;
14
  a.x = __A;
15
  b.x = __B;
16
  c.x = __C;
17
  float d[8];
18
  int i;
19
  e.x = _mm256_fmaddsub_ps (__A, __B, __C);
20
  for (i = 0; i < 8; i++)
21
    {
22
      d[i] = a.a[i] * b.a[i] + (i % 2 == 1 ? c.a[i] : -c.a[i]);
23
    }
24
  if (check_union256 (e, d))
25
    abort ();
26
}
27
 
28
void
29
check_mm256_fmaddsub_pd (__m256d __A, __m256d __B, __m256d __C)
30
{
31
  union256d a, b, c, e;
32
  a.x = __A;
33
  b.x = __B;
34
  c.x = __C;
35
  double d[4];
36
  int i;
37
  e.x = _mm256_fmaddsub_pd (__A, __B, __C);
38
  for (i = 0; i < 4; i++)
39
    {
40
      d[i] = a.a[i] * b.a[i] + (i % 2 == 1 ? c.a[i] : -c.a[i]);
41
    }
42
  if (check_union256d (e, d))
43
    abort ();
44
}
45
 
46
static void
47
fma_test (void)
48
{
49
  union256 c[3];
50
  union256d d[3];
51
  int i, j;
52
  for (i = 0; i < 3; i++)
53
    {
54
      for (j = 0; j < 8; j++)
55
        c[i].a[j] = i * j + 3.5;
56
      for (j = 0; j < 4; j++)
57
        d[i].a[j] = i * j + 3.5;
58
    }
59
  check_mm256_fmaddsub_pd (d[0].x, d[1].x, d[2].x);
60
  check_mm256_fmaddsub_ps (c[0].x, c[1].x, c[2].x);
61
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.