Back to index

glibc  2.9
Defines | Typedefs
hp-timing.h File Reference
#include <string.h>
#include <sys/param.h>
#include <stdio-common/_itoa.h>
#include <ia64intrin.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define HP_TIMING_AVAIL   (1)
#define HP_TIMING_INLINE   (1)
#define HP_TIMING_ZERO(Var)   (Var) = (0)
#define REPEAT_READ(val)   __builtin_expect ((long int) val == -1, 0)
#define HP_TIMING_NOW(Var)
#define HP_TIMING_DIFF_INIT()
#define HP_TIMING_DIFF(Diff, Start, End)   (Diff) = ((End) - (Start))
#define HP_TIMING_ACCUM(Sum, Diff)
#define HP_TIMING_ACCUM_NT(Sum, Diff)   (Sum) += (Diff)
#define HP_TIMING_PRINT(Buf, Len, Val)

Typedefs

typedef unsigned long int hp_timing_t

Define Documentation

#define HP_TIMING_ACCUM (   Sum,
  Diff 
)
Value:
do {                                                                 \
    hp_timing_t __oldval;                                            \
    hp_timing_t __diff = (Diff) - GLRO(dl_hp_timing_overhead);              \
    hp_timing_t __newval;                                            \
    do                                                               \
      {                                                                     \
       __oldval = (Sum);                                             \
       __newval = __oldval + __diff;                                        \
      }                                                                     \
    while (! __sync_bool_compare_and_swap (&Sum, __oldvar, __newval));             \
  } while (0)

Definition at line 119 of file hp-timing.h.

#define HP_TIMING_ACCUM_NT (   Sum,
  Diff 
)    (Sum) += (Diff)

Definition at line 133 of file hp-timing.h.

#define HP_TIMING_AVAIL   (1)

Definition at line 73 of file hp-timing.h.

#define HP_TIMING_DIFF (   Diff,
  Start,
  End 
)    (Diff) = ((End) - (Start))

Definition at line 116 of file hp-timing.h.

#define HP_TIMING_DIFF_INIT ( )
Value:
do {                                                                 \
    int __cnt = 5;                                                   \
    GLRO(dl_hp_timing_overhead) = ~0ul;                                     \
    do                                                               \
      {                                                                     \
	hp_timing_t __t1, __t2;                                             \
       HP_TIMING_NOW (__t1);                                                \
       HP_TIMING_NOW (__t2);                                                \
       if (__t2 - __t1 < GLRO(dl_hp_timing_overhead))                       \
         GLRO(dl_hp_timing_overhead) = __t2 - __t1;                         \
      }                                                                     \
    while (--__cnt > 0);                                             \
  } while (0)

Definition at line 100 of file hp-timing.h.

#define HP_TIMING_INLINE   (1)

Definition at line 76 of file hp-timing.h.

#define HP_TIMING_NOW (   Var)
Value:
({ unsigned long int __itc;                                          \
     do                                                                     \
       asm volatile ("mov %0=ar.itc" : "=r" (__itc) : : "memory");          \
     while (REPEAT_READ (__itc));                                    \
     Var = __itc; })

Definition at line 92 of file hp-timing.h.

#define HP_TIMING_PRINT (   Buf,
  Len,
  Val 
)
Value:
do {                                                                 \
    char __buf[20];                                                  \
    char *__cp = _itoa_word (Val, __buf + sizeof (__buf), 10, 0);           \
    int __len = (Len);                                                      \
    char *__dest = (Buf);                                            \
    while (__len-- > 0 && __cp < __buf + sizeof (__buf))                    \
      *__dest++ = *__cp++;                                           \
    memcpy (__dest, " clock cycles", MIN (__len,                     \
                                     (int) sizeof (" clock cycles")));   \
  } while (0)

Definition at line 136 of file hp-timing.h.

#define HP_TIMING_ZERO (   Var)    (Var) = (0)

Definition at line 82 of file hp-timing.h.

#define REPEAT_READ (   val)    __builtin_expect ((long int) val == -1, 0)

Definition at line 89 of file hp-timing.h.


Typedef Documentation

typedef unsigned long int hp_timing_t

Definition at line 79 of file hp-timing.h.