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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.target/] [i386/] [sse-18.c] - Blame information for rev 825

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O3 -msse2" } */
3
extern void abort(void);
4
#include <emmintrin.h>
5
#include "../../gcc.dg/i386-cpuid.h"
6
__m128i foo (char) __attribute__((noinline));
7
__m128i foo (char x) {
8
  return _mm_set1_epi8(x);
9
}
10
__m128i bar (char) __attribute__((noinline));
11
__m128i bar (char x) {
12
  return _mm_set_epi8 (x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x);
13
}
14
 
15
main() {
16
  int i, j;
17
  union u { __m128i v; char c[16]; };
18
  union u x, y;
19
  unsigned long cpu_facilities;
20
 
21
  cpu_facilities = i386_cpuid ();
22
 
23
  if ((cpu_facilities & (bit_MMX | bit_SSE | bit_CMOV))
24
      != (bit_MMX | bit_SSE | bit_CMOV))
25
    /* If host has no vector support, pass.  */
26
    return 0;
27
 
28
  for (i = -128; i <= 127; i++)
29
    {
30
      x.v = foo ((char)i);
31
      y.v = bar ((char)i);
32
      for (j=0; j<16; j++)
33
        if (x.c[j] != y.c[j])
34
          abort();
35
    }
36
  return 0;
37
}
38
 

powered by: WebSVN 2.1.0

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