OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [vararg-6.c] - Blame information for rev 378

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

Line No. Rev Author Line
1 318 jeremybenn
/* { dg-do run } */
2
/* { dg-require-effective-target avx } */
3
/* { dg-options "-mavx" } */
4
 
5
#include <stdarg.h>
6
#include <assert.h>
7
 
8
#include "avx-check.h"
9
 
10
__m128 n1 = { -283.3, -23.3, 213.4, 1119.03 };
11
__m256d n2 = { -93.83, 893.318, 3994.3, -39484.0 };
12
__m128i n3 = { 893, -3180 } ;
13
int n4 = 324;
14
double n5 = 103.3;
15
__m128i n6 = { -123, 2 };
16
__m128d n7 = { -91.387, -8193.518 };
17
__m256d n8 = { -123.3, 2.3, 3.4, -10.03 };
18
__m128 n9 = { -123.3, 2.3, 3.4, -10.03 };
19
__m128i n10 = { 1233, -100 };
20
int n11 = 407;
21
double n12 = 304.9;
22
__m128i n13 = { 233, -110 };
23
__m256i n14 = { -1233, 23, 34, -1003 };
24
__m128i n15 = { -393, -180 };
25
__m128d n16 = { 73.0, 63.18 };
26
__m256 n17 = { -183.3, -22.3, 13.9, -119.3, 483.1, 122.3, -33.4, -9.37 };
27
__m128 n18 = { -183.3, 22.3, 13.4, -19.03 };
28
 
29
__m128 e1;
30
__m256d e2;
31
__m128i e3;
32
int e4;
33
double e5;
34
__m128i e6;
35
__m128d e7;
36
__m256d e8;
37
__m128 e9;
38
__m128i e10;
39
int e11;
40
double e12;
41
__m128i e13;
42
__m256i e14;
43
__m128i e15;
44
__m128d e16;
45
__m256 e17;
46
__m128 e18;
47
 
48
static void
49
__attribute__((noinline))
50
foo (va_list va_arglist)
51
{
52
  e4 = va_arg (va_arglist, int);
53
  e5 = va_arg (va_arglist, double);
54
  e6 = va_arg (va_arglist, __m128i);
55
  e7 = va_arg (va_arglist, __m128d);
56
  e8 = va_arg (va_arglist, __m256d);
57
  e9 = va_arg (va_arglist, __m128);
58
  e10 = va_arg (va_arglist, __m128i);
59
  e11 = va_arg (va_arglist, int);
60
  e12 = va_arg (va_arglist, double);
61
  e13 = va_arg (va_arglist, __m128i);
62
  e14 = va_arg (va_arglist, __m256i);
63
  e15 = va_arg (va_arglist, __m128i);
64
  e16 = va_arg (va_arglist, __m128d);
65
  e17 = va_arg (va_arglist, __m256);
66
  e18 = va_arg (va_arglist, __m128);
67
  va_end (va_arglist);
68
}
69
 
70
static void
71
__attribute__((noinline))
72
test (__m128 a1, __m256d a2, __m128i a3, ...)
73
{
74
  va_list va_arglist;
75
 
76
  e1 = a1;
77
  e2 = a2;
78
  e3 = a3;
79
  va_start (va_arglist, a3);
80
  foo (va_arglist);
81
  va_end (va_arglist);
82
}
83
 
84
static void
85
avx_test (void)
86
{
87
  test (n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12,
88
        n13, n14, n15, n16, n17, n18);
89
  assert (__builtin_memcmp (&e1, &n1, sizeof (e1)) == 0);
90
  assert (__builtin_memcmp (&e2, &n2, sizeof (e2)) == 0);
91
  assert (__builtin_memcmp (&e3, &n3, sizeof (e3)) == 0);
92
  assert (n4 == e4);
93
  assert (n5 == e5);
94
  assert (__builtin_memcmp (&e6, &n6, sizeof (e6)) == 0);
95
  assert (__builtin_memcmp (&e7, &n7, sizeof (e7)) == 0);
96
  assert (__builtin_memcmp (&e8, &n8, sizeof (e8)) == 0);
97
  assert (__builtin_memcmp (&e9, &n9, sizeof (e9)) == 0);
98
  assert (__builtin_memcmp (&e10, &n10, sizeof (e10)) == 0);
99
  assert (n11 == e11);
100
  assert (n12 == e12);
101
  assert (__builtin_memcmp (&e13, &n13, sizeof (e13)) == 0);
102
  assert (__builtin_memcmp (&e14, &n14, sizeof (e14)) == 0);
103
  assert (__builtin_memcmp (&e15, &n15, sizeof (e15)) == 0);
104
  assert (__builtin_memcmp (&e16, &n16, sizeof (e16)) == 0);
105
  assert (__builtin_memcmp (&e17, &n17, sizeof (e17)) == 0);
106
  assert (__builtin_memcmp (&e18, &n18, sizeof (e18)) == 0);
107
}

powered by: WebSVN 2.1.0

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