FD.io VPP  v18.10-32-g1161dda
Vector Packet Processing
cpu.h File Reference
+ Include dependency graph for cpu.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define foreach_march_variant(macro, x)
 
#define CLIB_CPU_OPTIMIZED
 
#define CLIB_MULTIARCH_ARCH_CHECK(arch, fn, tgt)
 
#define CLIB_MULTIARCH_SELECT_FN(fn, ...)
 
#define CLIB_MULTIARCH_FN(fn)   fn
 
#define CLIB_MARCH_SFX   CLIB_MULTIARCH_FN
 
#define foreach_x86_64_flags
 
#define foreach_aarch64_flags
 
#define AARCH64_CPU_IMPLEMENTER_THUNERDERX2   0x43
 
#define AARCH64_CPU_PART_THUNERDERX2   0x0af
 
#define AARCH64_CPU_IMPLEMENTER_QDF24XX   0x51
 
#define AARCH64_CPU_PART_QDF24XX   0xc00
 
#define AARCH64_CPU_IMPLEMENTER_CORTEXA72   0x41
 
#define AARCH64_CPU_PART_CORTEXA72   0xd08
 
#define CLIB_MARCH_FN_PRIORITY()   0
 
#define CLIB_MARCH_FN_CONSTRUCTOR(fn)
 
#define CLIB_MARCH_FN(fn, rtype, _args...)
 
#define CLIB_MARCH_FN_SELECT(fn)   (* fn ## _selected)
 

Functions

static int clib_get_cpuid (const u32 lev, u32 *eax, u32 *ebx, u32 *ecx, u32 *edx)
 
static foreach_aarch64_flags int clib_cpu_supports_aes ()
 
static int clib_cpu_march_priority_avx512 ()
 
static int clib_cpu_march_priority_avx2 ()
 
static u32 clib_cpu_implementer ()
 
static u32 clib_cpu_part ()
 
static int clib_cpu_march_priority_thunderx2t99 ()
 
static int clib_cpu_march_priority_qdf24xx ()
 
static int clib_cpu_march_priority_cortexa72 ()
 

Variables

format_function_t format_cpu_uarch
 
format_function_t format_cpu_model_name
 
format_function_t format_cpu_flags
 

Macro Definition Documentation

#define AARCH64_CPU_IMPLEMENTER_CORTEXA72   0x41

Definition at line 246 of file cpu.h.

#define AARCH64_CPU_IMPLEMENTER_QDF24XX   0x51

Definition at line 244 of file cpu.h.

#define AARCH64_CPU_IMPLEMENTER_THUNERDERX2   0x43

Definition at line 242 of file cpu.h.

#define AARCH64_CPU_PART_CORTEXA72   0xd08

Definition at line 247 of file cpu.h.

#define AARCH64_CPU_PART_QDF24XX   0xc00

Definition at line 245 of file cpu.h.

#define AARCH64_CPU_PART_THUNERDERX2   0x0af

Definition at line 243 of file cpu.h.

#define CLIB_CPU_OPTIMIZED

Definition at line 39 of file cpu.h.

#define CLIB_MARCH_FN (   fn,
  rtype,
  _args... 
)
Value:
static rtype CLIB_CPU_OPTIMIZED CLIB_MARCH_SFX (fn ## _ma)(_args); \
rtype (*fn ## _selected) (_args) = & CLIB_MARCH_SFX (fn ## _ma); \
int fn ## _selected_priority = 0; \
static inline rtype CLIB_CPU_OPTIMIZED \
CLIB_MARCH_SFX (fn ## _ma)(_args)
#define CLIB_CPU_OPTIMIZED
Definition: cpu.h:39
#define CLIB_MARCH_SFX
Definition: cpu.h:62

Definition at line 295 of file cpu.h.

#define CLIB_MARCH_FN_CONSTRUCTOR (   fn)
Value:
CLIB_MARCH_SFX(fn ## _march_constructor) (void) \
{ \
if (CLIB_MARCH_FN_PRIORITY() > fn ## _selected_priority) \
{ \
fn ## _selected = & CLIB_MARCH_SFX (fn ## _ma); \
fn ## _selected_priority = CLIB_MARCH_FN_PRIORITY(); \
} \
} \
#define CLIB_MARCH_SFX
Definition: cpu.h:62
#define CLIB_MARCH_FN_PRIORITY()
Definition: cpu.h:279

Definition at line 283 of file cpu.h.

#define CLIB_MARCH_FN_PRIORITY ( )    0

Definition at line 279 of file cpu.h.

#define CLIB_MARCH_FN_SELECT (   fn)    (* fn ## _selected)

Definition at line 310 of file cpu.h.

#define CLIB_MARCH_SFX   CLIB_MULTIARCH_FN

Definition at line 62 of file cpu.h.

#define CLIB_MULTIARCH_ARCH_CHECK (   arch,
  fn,
  tgt 
)
Value:
if (clib_cpu_supports_ ## arch()) \
return & fn ## _ ##arch;

Definition at line 43 of file cpu.h.

#define CLIB_MULTIARCH_FN (   fn)    fn

Definition at line 59 of file cpu.h.

#define CLIB_MULTIARCH_SELECT_FN (   fn,
  ... 
)
Value:
__VA_ARGS__ void * fn ## _multiarch_select(void) \
{ \
return & fn; \
}
#define CLIB_MULTIARCH_ARCH_CHECK(arch, fn, tgt)
Definition: cpu.h:43
#define foreach_march_variant(macro, x)
Definition: cpu.h:32

Definition at line 47 of file cpu.h.

#define foreach_aarch64_flags
Value:
_ (fp, 0) \
_ (asimd, 1) \
_ (evtstrm, 2) \
_ (aarch64_aes, 3) \
_ (pmull, 4) \
_ (sha1, 5) \
_ (sha2, 6) \
_ (crc32, 7) \
_ (atomics, 8) \
_ (fphp, 9) \
_ (asimdhp, 10) \
_ (cpuid, 11) \
_ (asimdrdm, 12) \
_ (jscvt, 13) \
_ (fcma, 14) \
_ (lrcpc, 15) \
_ (dcpop, 16) \
_ (sha3, 17) \
_ (sm3, 18) \
_ (sm4, 19) \
_ (asimddp, 20) \
_ (sha512, 21) \
_ (sve, 22)

Definition at line 77 of file cpu.h.

#define foreach_march_variant (   macro,
 
)

Definition at line 32 of file cpu.h.

#define foreach_x86_64_flags
Value:
_ (sse3, 1, ecx, 0) \
_ (ssse3, 1, ecx, 9) \
_ (sse41, 1, ecx, 19) \
_ (sse42, 1, ecx, 20) \
_ (avx, 1, ecx, 28) \
_ (avx2, 7, ebx, 5) \
_ (avx512f, 7, ebx, 16) \
_ (x86_aes, 1, ecx, 25) \
_ (sha, 7, ebx, 29) \
_ (invariant_tsc, 0x80000007, edx, 8)

Definition at line 64 of file cpu.h.

Function Documentation

static u32 clib_cpu_implementer ( )
inlinestatic

Definition at line 187 of file cpu.h.

+ Here is the caller graph for this function:

static int clib_cpu_march_priority_avx2 ( )
inlinestatic

Definition at line 179 of file cpu.h.

static int clib_cpu_march_priority_avx512 ( )
inlinestatic

Definition at line 171 of file cpu.h.

static int clib_cpu_march_priority_cortexa72 ( )
inlinestatic

Definition at line 268 of file cpu.h.

+ Here is the call graph for this function:

static int clib_cpu_march_priority_qdf24xx ( )
inlinestatic

Definition at line 259 of file cpu.h.

+ Here is the call graph for this function:

static int clib_cpu_march_priority_thunderx2t99 ( )
inlinestatic

Definition at line 250 of file cpu.h.

+ Here is the call graph for this function:

static u32 clib_cpu_part ( )
inlinestatic

Definition at line 215 of file cpu.h.

+ Here is the caller graph for this function:

static foreach_aarch64_flags int clib_cpu_supports_aes ( )
inlinestatic

Definition at line 159 of file cpu.h.

static int clib_get_cpuid ( const u32  lev,
u32 eax,
u32 ebx,
u32 ecx,
u32 edx 
)
inlinestatic

Definition at line 106 of file cpu.h.

Variable Documentation

format_function_t format_cpu_flags

Definition at line 314 of file cpu.h.

format_function_t format_cpu_model_name

Definition at line 313 of file cpu.h.

format_function_t format_cpu_uarch

Definition at line 312 of file cpu.h.