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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [pr52407.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run } */
2
 
3
extern void abort (void);
4
 
5
typedef long long T;
6
typedef T vl_t __attribute__((vector_size(2 * sizeof (T))));
7
 
8
vl_t    ul[4], vl[4] = { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 } };
9
 
10
static void
11
mul_vl_l(vl_t *u, vl_t *v, T x, int m)
12
{
13
  vl_t   w;
14
  T *p = (T *)&w;
15
  p[0] = p[1] = x;
16
  while (m--)
17
    *u++ = *v++ * w;
18
}
19
 
20
int
21
main(int argc, char *argv[])
22
{
23
  int i;
24
  T *pl;
25
 
26
  pl = (T *) &ul;
27
  mul_vl_l(ul, vl, 2, 4);
28
  for (i = 0; i < 8; i++)
29
    if (pl[i] != 2 * (i + 1))
30
      abort ();
31
 
32
  return 0;
33
}

powered by: WebSVN 2.1.0

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