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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vmx/] [bug-1.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
#include <stdlib.h>
2
#include <stdio.h>
3
#include <stddef.h>
4
#include <altivec.h>
5
 
6
#define NPAGES 20
7
#define NSKIP 10
8
static vector float big[NPAGES*4096/16] = { {1,1,1,1} };
9
/* NPAGES pages worth.  */
10
 
11
static int failed;
12
 
13
static void f(vector float *p)
14
{
15
  int i = 1;
16
  p = (vector float *)(((ptrdiff_t)p + 4095) & ~4095);
17
 
18
  i += NSKIP;
19
  p += NSKIP*4096/16;
20
 
21
  while (i < NPAGES)
22
    {
23
      if (!vec_all_eq(*p,((vector float){0,0,0,0})))
24
        {
25
          printf("*p isn't zero at 0x%p, page %d\n", p, i);
26
          failed++;
27
        }
28
      i++;
29
      p += 4096/16;
30
    }
31
}
32
 
33
int main(void)
34
{
35
  f(big);
36
  if (failed)
37
    abort ();
38
  return 0;
39
}

powered by: WebSVN 2.1.0

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