proxygen
folly::compression::instructions::Default Struct Reference

#include <Instructions.h>

Inheritance diagram for folly::compression::instructions::Default:
folly::compression::instructions::Nehalem folly::compression::instructions::Haswell

Static Public Member Functions

static bool supported (const folly::CpuId &={})
 
static FOLLY_ALWAYS_INLINE uint64_t popcount (uint64_t value)
 
static FOLLY_ALWAYS_INLINE int ctz (uint64_t value)
 
static FOLLY_ALWAYS_INLINE int clz (uint64_t value)
 
static FOLLY_ALWAYS_INLINE uint64_t blsr (uint64_t value)
 
static FOLLY_ALWAYS_INLINE uint64_t bextr (uint64_t value, uint32_t start, uint32_t length)
 
static FOLLY_ALWAYS_INLINE uint64_t bzhi (uint64_t value, uint32_t index)
 

Detailed Description

Definition at line 42 of file Instructions.h.

Member Function Documentation

static FOLLY_ALWAYS_INLINE uint64_t folly::compression::instructions::Default::bextr ( uint64_t  value,
uint32_t  start,
uint32_t  length 
)
inlinestatic

Definition at line 65 of file Instructions.h.

References start.

Referenced by TEST().

65  {
66  if (start > 63) {
67  return 0ULL;
68  }
69  if (start + length > 64) {
70  length = 64 - start;
71  }
72 
73  return (value >> start) &
74  ((length == 64) ? (~0ULL) : ((1ULL << length) - 1ULL));
75  }
auto start
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
static FOLLY_ALWAYS_INLINE uint64_t folly::compression::instructions::Default::blsr ( uint64_t  value)
inlinestatic

Definition at line 57 of file Instructions.h.

References FOLLY_ALWAYS_INLINE, and uint64_t.

57  {
58  return value & (value - 1);
59  }
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
static FOLLY_ALWAYS_INLINE uint64_t folly::compression::instructions::Default::bzhi ( uint64_t  value,
uint32_t  index 
)
inlinestatic

Definition at line 78 of file Instructions.h.

References uint64_t.

78  {
79  if (index > 63) {
80  return 0;
81  }
82  return value & ((uint64_t(1) << index) - 1);
83  }
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
static FOLLY_ALWAYS_INLINE int folly::compression::instructions::Default::clz ( uint64_t  value)
inlinestatic

Definition at line 53 of file Instructions.h.

53  {
54  DCHECK_GT(value, 0u);
55  return __builtin_clzll(value);
56  }
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
static FOLLY_ALWAYS_INLINE int folly::compression::instructions::Default::ctz ( uint64_t  value)
inlinestatic

Definition at line 49 of file Instructions.h.

49  {
50  DCHECK_GT(value, 0u);
51  return __builtin_ctzll(value);
52  }
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
static FOLLY_ALWAYS_INLINE uint64_t folly::compression::instructions::Default::popcount ( uint64_t  value)
inlinestatic

Definition at line 46 of file Instructions.h.

References uint64_t.

46  {
47  return uint64_t(__builtin_popcountll(value));
48  }
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
static bool folly::compression::instructions::Default::supported ( const folly::CpuId = {})
inlinestatic

Definition at line 43 of file Instructions.h.

43  {}) {
44  return true;
45  }

The documentation for this struct was generated from the following file: