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/] [sse4a-montss.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-require-effective-target sse4a } */
3
/* { dg-options "-O2 -msse4a" } */
4
 
5
#include "sse4a-check.h"
6
 
7
#include <ammintrin.h>
8
 
9
static void
10
sse4a_test_movntss (float *out, float *in)
11
{
12
  __m128 in_v4sf = _mm_load_ss (in);
13
  _mm_stream_ss (out, in_v4sf);
14
}
15
 
16
static int
17
chk_ss (float *v1, float *v2)
18
{
19
  int n_fails = 0;
20
  if (v1[0] != v2[0])
21
    n_fails += 1;
22
  return n_fails;
23
}
24
 
25
float vals[10] =
26
  {
27
    100.0,  200.0, 300.0, 400.0, 5.0,
28
    -1.0, .345, -21.5, 9.32,  8.41
29
  };
30
 
31
static void
32
sse4a_test (void)
33
{
34
  int i;
35
  int fail = 0;
36
  float *out;
37
 
38
  out = (float *) malloc (sizeof (float));
39
  for (i = 0; i < 10; i += 1)
40
    {
41
      sse4a_test_movntss (out, &vals[i]);
42
 
43
      fail += chk_ss (out, &vals[i]);
44
    }
45
 
46
  if (fail != 0)
47
    abort ();
48
}

powered by: WebSVN 2.1.0

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