Esempio n. 1
0
int
test00 (void* p, int x)
{
  int* tcb = (int*)__builtin_thread_pointer ();
  int r = tcb[4];

  __builtin_set_thread_pointer (p);

  tcb = (int*)__builtin_thread_pointer ();
  return tcb[255] + r;
}
Esempio n. 2
0
void
test02 (int* x, int a, int b)
{
  int* tcb = (int*)__builtin_thread_pointer ();
  tcb[50] = a;

  __builtin_set_thread_pointer (x);
  
  tcb = (int*)__builtin_thread_pointer ();
  tcb[40] = b;
}
Esempio n. 3
0
int
test04 (const int* x, int c, int** xx, int d)
{
  int s = 0;
  int i;
  for (i = 0; i < c; ++i)
  {
    volatile int* tcb = (volatile int*)__builtin_thread_pointer ();
    tcb[20] = s;
 
   __builtin_set_thread_pointer (xx[i]);

    tcb = (volatile int*)__builtin_thread_pointer ();
    s ^= x[i] + tcb[40] + d;
  }
  return s;
}
Esempio n. 4
0
int
test01 (int x)
{
  /* We must see a stc gbr,rn before the function call, because
     a function call could modify the gbr.  In this case the user requests
     the old gbr value, before the function call.  */
  int* p = (int*)__builtin_thread_pointer ();
  p[5] = test00 ();
  return 0;
}
Esempio n. 5
0
int
test_01 (int x, volatile int* y, int a)
{
  if (a)
    test_00 ();

  y[0] = 1;

  tcb_t* tcb = (tcb_t*)__builtin_thread_pointer ();
  return (a & 5) ? tcb->x : tcb->w;
}
Esempio n. 6
0
int
test03 (const int* x, int c)
{
  volatile int* tcb = (volatile int*)__builtin_thread_pointer ();

  int s = 0;
  int i;
  for (i = 0; i < c; ++i)
    s ^= x[i] + tcb[40];

  return s;
}
Esempio n. 7
0
void *f0()
{
  return __builtin_thread_pointer();
}
Esempio n. 8
0
int
test_00 (int a, tcb_t* b, int c)
{
  tcb_t* tcb = (tcb_t*)__builtin_thread_pointer ();
  return (a & 5) ? tcb->x : tcb->w;
}
Esempio n. 9
0
int
test_00 (int a, tcb_t* b)
{
  tcb_t* tcb = (a & 5) ? (tcb_t*)__builtin_thread_pointer () : b;
  return tcb->w + tcb->x;
}
Esempio n. 10
0
void*
test00 (void)
{
  return __builtin_thread_pointer ();
}
Esempio n. 11
0
void *tp (void) {
  return __builtin_thread_pointer ();
// CHECK: call {{.*}} @llvm.thread.pointer()
}
Esempio n. 12
0
int
test01 (void)
{
  unsigned short* tcb = (unsigned short*)__builtin_thread_pointer ();
  return tcb[500];
}