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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [sse-recip-vec.c] - Blame information for rev 318

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse -mfpmath=sse -mrecip" } */
3
/* { dg-require-effective-target sse } */
4
 
5
#include "sse-check.h"
6
 
7
extern float sqrtf (float);
8
extern float fabsf (float);
9
 
10
#define N 8
11
 
12
float a[N] = { 0.f, 18.f, 108.f, 324.f, 720.f, 1944.f, 3087.f, 5832.f };
13
float b[N] = { 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f };
14
float r[N];
15
 
16
float rc[N] = { 0.f, 3.f, 6.f, 9.f, 12.f, 18.f, 21.f, 27.f };
17
 
18
static void
19
sse_test (void)
20
{
21
  int i;
22
 
23
  for (i = 0; i < N; i++)
24
    {
25
      r[i] = sqrtf (a[i] / b[i]);
26
    }
27
 
28
  /* check results:  */
29
  for (i = 0; i < N; i++)
30
    {
31
      if (fabsf (r[i] - rc[i]) > 0.0001)
32
        abort();
33
    }
34
}

powered by: WebSVN 2.1.0

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