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>
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 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 long int hp_timing_t

Define Documentation

#define HP_TIMING_ACCUM (   Sum,
  Diff 
)
Value:
do {                                                    \
  hp_timing_t __diff = (Diff) - GLRO(dl_hp_timing_overhead);   \
  __asm__ __volatile__("srl %L0, 0, %%g1\n\t"           \
                     "sllx  %H0, 32, %%g6\n\t"          \
                     "or    %%g1, %%g6, %%g1\n\t"              \
                     "1: ldx       [%1], %%g5\n\t"                    \
                     "add   %%g5, %%g1, %%g6\n\t"              \
                     "casx  [%1], %%g5,  %%g6\n\t"             \
                     "cmp   %%g5, %%g6\n\t"                    \
                     "bne,pn       %%xcc, 1b\n\t"                     \
                     " nop"                             \
                     : /* no outputs */                 \
                     : "r" (__diff), "r" (&(Sum))              \
                     : "memory", "g1", "g5", "g6");            \
} while(0)

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

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

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

#define HP_TIMING_AVAIL   (1)

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

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

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

#define HP_TIMING_DIFF_INIT ( )
Value:
do {                                                                 \
    int __cnt = 5;                                                   \
    GLRO(dl_hp_timing_overhead) = ~0ull;                             \
    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 40 of file hp-timing.h.

#define HP_TIMING_INLINE   (1)

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

#define HP_TIMING_NOW (   Var)
Value:
__asm__ __volatile__ ("rd %%tick, %L0\n\t" \
                         "srlx %L0, 32, %H0" \
                         : "=r" (Var))

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

#define HP_TIMING_PRINT (   Buf,
  Len,
  Val 
)
Value:
do {                                                                 \
    char __buf[20];                                                  \
    char *__cp = _itoa (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, sizeof (" clock cycles")));  \
  } while (0)

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

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

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


Typedef Documentation

typedef unsigned long long int hp_timing_t

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