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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [sparc/] [pdist-3.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do run } */
2
/* { dg-require-effective-target ultrasparc_hw } */
3
/* { dg-options "-mcpu=ultrasparc -mvis -O1" } */
4
 
5
typedef long long int64_t;
6
typedef unsigned char vec8 __attribute__((vector_size(8)));
7
 
8
extern void abort ();
9
extern void exit (int);
10
 
11
#define _(A) (unsigned char)A
12
 
13
int64_t foo (vec8 a, vec8 b) {
14
  int64_t d = 2;
15
  d = __builtin_vis_pdist (a, b, d);
16
  return d;
17
}
18
 
19
int64_t bar () {
20
  int64_t d = 2;
21
  vec8 a = { _(1), _(2), _(3), _(4), _(5), _(6), _(7), _(255) };
22
  vec8 b = { _(2), _(4), _(8), _(16), _(32), _(64), _(128), _(8) };
23
  d = __builtin_vis_pdist (a, b, d);
24
  return d;
25
}
26
 
27
 
28
static vec8 a = { 1, 2, 3, 4, 5, 6, 7, 255 };
29
static vec8 b = { 2, 4, 8, 16, 32, 64, 128, 8 };
30
 
31
int main (int argc, char *argv[]) {
32
 
33
  if (foo (a, b) != bar ())
34
    abort ();
35
 
36
  exit (0);
37
}

powered by: WebSVN 2.1.0

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