proxygen
folly::compression::instructions::Nehalem Struct Reference

#include <Instructions.h>

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

Static Public Member Functions

static bool supported (const folly::CpuId &cpuId={})
 
static FOLLY_ALWAYS_INLINE uint64_t popcount (uint64_t value)
 
- Static Public Member Functions inherited from folly::compression::instructions::Default
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 86 of file Instructions.h.

Member Function Documentation

static FOLLY_ALWAYS_INLINE uint64_t folly::compression::instructions::Nehalem::popcount ( uint64_t  value)
inlinestatic

Definition at line 91 of file Instructions.h.

References uint64_t.

91  {
92 // POPCNT is supported starting with Intel Nehalem, AMD K10.
93 #if defined(__GNUC__) || defined(__clang__)
94  // GCC and Clang won't inline the intrinsics.
95  uint64_t result;
96  asm("popcntq %1, %0" : "=r"(result) : "r"(value));
97  return result;
98 #else
99  return uint64_t(_mm_popcnt_u64(value));
100 #endif
101  }
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
static bool folly::compression::instructions::Nehalem::supported ( const folly::CpuId cpuId = {})
inlinestatic

Definition at line 87 of file Instructions.h.

Referenced by folly::compression::instructions::detect(), and folly::compression::instructions::Haswell::supported().

87  {}) {
88  return cpuId.popcnt();
89  }
FOLLY_ALWAYS_INLINE bool popcnt() const
Definition: CpuId.h:136

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