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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [tic6x/] [builtins/] [extclr.c] - Blame information for rev 848

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

Line No. Rev Author Line
1 691 jeremybenn
#include <c6x_intrinsics.h>
2
 
3
extern void abort (void);
4
 
5
#define N 4
6
 
7
int vals[N] = { 0, 0xffffffff, 0x89abcdef, 0xdeadbeef };
8
 
9
int main ()
10
{
11
  int i;
12
  for (i = 0; i < N; i++)
13
    {
14
      int shf1, shf2;
15
      int v = vals[i];
16
      unsigned int uv = v;
17
 
18
      for (shf1 = 0; shf1 < 32; shf1++)
19
        for (shf2 = 0; shf2 < 32; shf2++)
20
          {
21
            int r = (shf1 << 5) | shf2;
22
            if (shf2 > shf1)
23
              {
24
                unsigned int mask = (1u << (shf2 - shf1) << 1) - 1;
25
                mask <<= shf1;
26
                if (_clrr (v, r) != (v & ~mask))
27
                  abort ();
28
              }
29
            if (_extr (v, r) != v << shf1 >> shf2)
30
              abort ();
31
            if (_extru (v, r) != uv << shf1 >> shf2)
32
              abort ();
33
          }
34
    }
35
  return 0;
36
}

powered by: WebSVN 2.1.0

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