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-19.c] - Blame information for rev 318

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O3 -msse2" } */
3
/* { dg-require-effective-target sse2 } */
4
/* { dg-final { scan-assembler "punpcklbw" } } */
5
extern void abort();
6
#include <emmintrin.h>
7
__m128i foo (char) __attribute__((noinline));
8
__m128i foo (char x) {
9
  return _mm_set1_epi8(x);
10
}
11
__m128i bar (char) __attribute__((noinline));
12
__m128i bar (char x) {
13
  return _mm_set_epi8 (x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x);
14
}
15
 
16
main() {
17
  int i, j;
18
  union u { __m128i v; char c[16]; };
19
  union u x, y;
20
  for (i = -128; i <= 127; i++)
21
    {
22
      x.v = foo ((char)i);
23
      y.v = bar ((char)i);
24
      for (j=0; j<16; j++)
25
        if (x.c[j] != y.c[j])
26
          abort();
27
    }
28
  return 0;
29
}
30
 

powered by: WebSVN 2.1.0

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