Grok 10.0.5
base.h File Reference
#include <stddef.h>
#include <stdint.h>
#include "hwy/detect_compiler_arch.h"
#include "hwy/highway_export.h"

Go to the source code of this file.

Classes

struct  hwy::float16_t
 
struct  hwy::bfloat16_t
 
struct  hwy::uint128_t
 
struct  hwy::K64V64
 
struct  hwy::K32V32
 
struct  hwy::EnableIfT< Condition >
 
struct  hwy::EnableIfT< true >
 
struct  hwy::IsSameT< T, U >
 
struct  hwy::IsSameT< T, T >
 
struct  hwy::SizeTag< N >
 
struct  hwy::RemoveConstT< T >
 
struct  hwy::RemoveConstT< const T >
 
struct  hwy::detail::Relations< uint8_t >
 
struct  hwy::detail::Relations< int8_t >
 
struct  hwy::detail::Relations< uint16_t >
 
struct  hwy::detail::Relations< int16_t >
 
struct  hwy::detail::Relations< uint32_t >
 
struct  hwy::detail::Relations< int32_t >
 
struct  hwy::detail::Relations< uint64_t >
 
struct  hwy::detail::Relations< int64_t >
 
struct  hwy::detail::Relations< uint128_t >
 
struct  hwy::detail::Relations< float16_t >
 
struct  hwy::detail::Relations< bfloat16_t >
 
struct  hwy::detail::Relations< float >
 
struct  hwy::detail::Relations< double >
 
struct  hwy::detail::TypeFromSize< 1 >
 
struct  hwy::detail::TypeFromSize< 2 >
 
struct  hwy::detail::TypeFromSize< 4 >
 
struct  hwy::detail::TypeFromSize< 8 >
 
struct  hwy::detail::TypeFromSize< 16 >
 

Namespaces

namespace  hwy
 
namespace  hwy::detail
 

Macros

#define HWY_STR_IMPL(macro)
 
#define HWY_STR(macro)
 
#define HWY_RESTRICT   __restrict__
 
#define HWY_INLINE   inline
 
#define HWY_NOINLINE   __attribute__((noinline))
 
#define HWY_FLATTEN   __attribute__((flatten))
 
#define HWY_NORETURN   __attribute__((noreturn))
 
#define HWY_LIKELY(expr)
 
#define HWY_UNLIKELY(expr)
 
#define HWY_PRAGMA(tokens)
 
#define HWY_DIAGNOSTICS(tokens)
 
#define HWY_DIAGNOSTICS_OFF(msc, gcc)
 
#define HWY_MAYBE_UNUSED   __attribute__((unused))
 
#define HWY_MUST_USE_RESULT   __attribute__((warn_unused_result))
 
#define HWY_FORMAT(idx_fmt, idx_arg)
 
#define HWY_ASSUME_ALIGNED(ptr, align)
 
#define HWY_PUSH_ATTRIBUTES(targets_str)
 
#define HWY_POP_ATTRIBUTES
 
#define HWY_API   static HWY_INLINE HWY_FLATTEN HWY_MAYBE_UNUSED
 
#define HWY_CONCAT_IMPL(a, b)
 
#define HWY_CONCAT(a, b)
 
#define HWY_MIN(a, b)
 
#define HWY_MAX(a, b)
 
#define HWY_UNROLL(factor)
 
#define HWY_DEFAULT_UNROLL
 
#define HWY_ASSUME(expr)
 
#define HWY_FENCE
 
#define HWY_REP4(literal)
 
#define HWY_ABORT(format, ...)
 
#define HWY_ASSERT(condition)
 
#define HWY_IS_MSAN   0
 
#define HWY_IS_ASAN   0
 
#define HWY_IS_TSAN   0
 
#define HWY_ATTR_NO_MSAN
 
#define HWY_IS_DEBUG_BUILD   1
 
#define HWY_DASSERT(condition)
 
#define HWY_ALIGN_MAX   alignas(16)
 
#define HWY_IF_LE128(T, N)
 
#define HWY_IF_LE64(T, N)
 
#define HWY_IF_LE32(T, N)
 
#define HWY_IF_GE32(T, N)
 
#define HWY_IF_GE64(T, N)
 
#define HWY_IF_GE128(T, N)
 
#define HWY_IF_GT128(T, N)
 
#define HWY_IF_UNSIGNED(T)
 
#define HWY_IF_SIGNED(T)
 
#define HWY_IF_FLOAT(T)
 
#define HWY_IF_NOT_FLOAT(T)
 
#define HWY_IF_LANE_SIZE(T, bytes)
 
#define HWY_IF_NOT_LANE_SIZE(T, bytes)
 
#define HWY_IF_LANE_SIZE_ONE_OF(T, bit_array)
 
#define HWY_IF_LANES_PER_BLOCK(T, N, LANES)
 

Typedefs

using hwy::float32_t = float
 
using hwy::float64_t = double
 
template<bool Condition>
using hwy::EnableIf = typename EnableIfT<Condition>::type
 
template<class T >
using hwy::RemoveConst = typename RemoveConstT<T>::type
 
template<typename T >
using hwy::MakeUnsigned = typename detail::Relations<T>::Unsigned
 
template<typename T >
using hwy::MakeSigned = typename detail::Relations<T>::Signed
 
template<typename T >
using hwy::MakeFloat = typename detail::Relations<T>::Float
 
template<typename T >
using hwy::MakeWide = typename detail::Relations<T>::Wide
 
template<typename T >
using hwy::MakeNarrow = typename detail::Relations<T>::Narrow
 
template<size_t N>
using hwy::UnsignedFromSize = typename detail::TypeFromSize<N>::Unsigned
 
template<size_t N>
using hwy::SignedFromSize = typename detail::TypeFromSize<N>::Signed
 
template<size_t N>
using hwy::FloatFromSize = typename detail::TypeFromSize<N>::Float
 
using hwy::UnsignedTag = SizeTag<0>
 
using hwy::SignedTag = SizeTag<0x100>
 
using hwy::FloatTag = SizeTag<0x200>
 
using hwy::NonFloatTag = SizeTag<0x400>
 

Functions

static HWY_MAYBE_UNUSED bool hwy::operator< (const uint128_t &a, const uint128_t &b)
 
static HWY_MAYBE_UNUSED bool hwy::operator> (const uint128_t &a, const uint128_t &b)
 
static HWY_MAYBE_UNUSED bool hwy::operator== (const uint128_t &a, const uint128_t &b)
 
static HWY_MAYBE_UNUSED bool hwy::operator< (const K64V64 &a, const K64V64 &b)
 
static HWY_MAYBE_UNUSED bool hwy::operator> (const K64V64 &a, const K64V64 &b)
 
static HWY_MAYBE_UNUSED bool hwy::operator== (const K64V64 &a, const K64V64 &b)
 
static HWY_MAYBE_UNUSED bool hwy::operator< (const K32V32 &a, const K32V32 &b)
 
static HWY_MAYBE_UNUSED bool hwy::operator> (const K32V32 &a, const K32V32 &b)
 
static HWY_MAYBE_UNUSED bool hwy::operator== (const K32V32 &a, const K32V32 &b)
 
template<typename T , typename U >
HWY_API constexpr bool hwy::IsSame ()
 
template<typename T , class R = detail::Relations<T>>
constexpr auto hwy::TypeTag () -> hwy::SizeTag<((R::is_signed+R::is_float)<< 8)>
 
template<typename T , class R = detail::Relations<T>>
constexpr auto hwy::IsFloatTag () -> hwy::SizeTag<(R::is_float ? 0x200 :0x400)>
 
template<typename T >
HWY_API constexpr bool hwy::IsFloat ()
 
template<typename T >
HWY_API constexpr bool hwy::IsSigned ()
 
template<>
constexpr bool hwy::IsSigned< float16_t > ()
 
template<>
constexpr bool hwy::IsSigned< bfloat16_t > ()
 
template<typename T >
HWY_API constexpr T hwy::LimitsMax ()
 
template<typename T >
HWY_API constexpr T hwy::LimitsMin ()
 
template<typename T >
HWY_API constexpr T hwy::LowestValue ()
 
template<>
constexpr float hwy::LowestValue< float > ()
 
template<>
constexpr double hwy::LowestValue< double > ()
 
template<typename T >
HWY_API constexpr T hwy::HighestValue ()
 
template<>
constexpr float hwy::HighestValue< float > ()
 
template<>
constexpr double hwy::HighestValue< double > ()
 
template<typename T >
HWY_API constexpr T hwy::Epsilon ()
 
template<>
constexpr float hwy::Epsilon< float > ()
 
template<>
constexpr double hwy::Epsilon< double > ()
 
template<typename T >
constexpr int hwy::MantissaBits ()
 
template<>
constexpr int hwy::MantissaBits< float > ()
 
template<>
constexpr int hwy::MantissaBits< double > ()
 
template<typename T >
constexpr MakeSigned< T > hwy::MaxExponentTimes2 ()
 
template<typename T >
constexpr MakeUnsigned< T > hwy::SignMask ()
 
template<typename T >
constexpr MakeUnsigned< T > hwy::ExponentMask ()
 
template<typename T >
constexpr MakeUnsigned< T > hwy::MantissaMask ()
 
template<typename T >
constexpr T hwy::MantissaEnd ()
 
template<>
constexpr float hwy::MantissaEnd< float > ()
 
template<>
constexpr double hwy::MantissaEnd< double > ()
 
template<typename T >
constexpr int hwy::ExponentBits ()
 
template<typename T >
constexpr MakeSigned< T > hwy::MaxExponentField ()
 
template<typename T1 , typename T2 >
constexpr T1 hwy::DivCeil (T1 a, T2 b)
 
constexpr size_t hwy::RoundUpTo (size_t what, size_t align)
 
HWY_API size_t hwy::Num0BitsBelowLS1Bit_Nonzero32 (const uint32_t x)
 
HWY_API size_t hwy::Num0BitsBelowLS1Bit_Nonzero64 (const uint64_t x)
 
HWY_API size_t hwy::Num0BitsAboveMS1Bit_Nonzero32 (const uint32_t x)
 
HWY_API size_t hwy::Num0BitsAboveMS1Bit_Nonzero64 (const uint64_t x)
 
HWY_API size_t hwy::PopCount (uint64_t x)
 
template<typename TI >
constexpr size_t hwy::FloorLog2 (TI x)
 
template<typename TI >
constexpr size_t hwy::CeilLog2 (TI x)
 
template<typename T >
HWY_INLINE constexpr T hwy::AddWithWraparound (hwy::FloatTag, T t, size_t n)
 
template<typename T >
HWY_INLINE constexpr T hwy::AddWithWraparound (hwy::NonFloatTag, T t, size_t n)
 
HWY_API uint64_t hwy::Mul128 (uint64_t a, uint64_t b, uint64_t *HWY_RESTRICT upper)
 
template<size_t kBytes, typename From , typename To >
HWY_API void hwy::CopyBytes (const From *from, To *to)
 
template<typename From , typename To >
HWY_API void hwy::CopySameSize (const From *HWY_RESTRICT from, To *HWY_RESTRICT to)
 
template<size_t kBytes, typename To >
HWY_API void hwy::ZeroBytes (To *to)
 
HWY_API float hwy::F32FromBF16 (bfloat16_t bf)
 
HWY_API bfloat16_t hwy::BF16FromF32 (float f)
 
HWY_DLLEXPORT HWY_NORETURN void hwy::HWY_FORMAT (3, 4) Abort(const char *file
 

Variables

static constexpr HWY_MAYBE_UNUSED size_t hwy::kMaxVectorSize = 16
 
HWY_DLLEXPORT HWY_NORETURN void int hwy::line
 
HWY_DLLEXPORT HWY_NORETURN void int const char * hwy::format
 

Macro Definition Documentation

◆ HWY_ABORT

◆ HWY_ALIGN_MAX

#define HWY_ALIGN_MAX   alignas(16)

◆ HWY_API

#define HWY_API   static HWY_INLINE HWY_FLATTEN HWY_MAYBE_UNUSED

◆ HWY_ASSERT

#define HWY_ASSERT ( condition)
Value:
do { \
if (!(condition)) { \
HWY_ABORT("Assert %s", #condition); \
} \
} while (0)

Referenced by hwy::HWY_NAMESPACE::Reverse8(), and hwy::HWY_NAMESPACE::VerifySort().

◆ HWY_ASSUME

#define HWY_ASSUME ( expr)
Value:
static_cast<void>(0)

◆ HWY_ASSUME_ALIGNED

#define HWY_ASSUME_ALIGNED ( ptr,
align )

◆ HWY_ATTR_NO_MSAN

#define HWY_ATTR_NO_MSAN

◆ HWY_CONCAT

#define HWY_CONCAT ( a,
b )
Value:
#define HWY_CONCAT_IMPL(a, b)
Definition base.h:131
uint32_t a
only used by MQ decoder
Definition mqc.h:48

◆ HWY_CONCAT_IMPL

#define HWY_CONCAT_IMPL ( a,
b )
Value:
a##b

◆ HWY_DASSERT

◆ HWY_DEFAULT_UNROLL

#define HWY_DEFAULT_UNROLL

◆ HWY_DIAGNOSTICS

#define HWY_DIAGNOSTICS ( tokens)
Value:
HWY_PRAGMA(GCC diagnostic tokens)
#define HWY_PRAGMA(tokens)
Definition base.h:77

Referenced by hwy::HWY_NAMESPACE::DemoteTo().

◆ HWY_DIAGNOSTICS_OFF

#define HWY_DIAGNOSTICS_OFF ( msc,
gcc )
Value:
#define HWY_DIAGNOSTICS(tokens)
Definition base.h:78

Referenced by hwy::HWY_NAMESPACE::DemoteTo().

◆ HWY_FENCE

#define HWY_FENCE

◆ HWY_FLATTEN

#define HWY_FLATTEN   __attribute__((flatten))

◆ HWY_FORMAT

#define HWY_FORMAT ( idx_fmt,
idx_arg )

◆ HWY_IF_FLOAT

#define HWY_IF_FLOAT ( T)
Value:
typename EnableIfT< Condition >::type EnableIf
Definition base.h:383

◆ HWY_IF_GE128

#define HWY_IF_GE128 ( T,
N )
Value:
hwy::EnableIf<N * sizeof(T) >= 16>* = nullptr

◆ HWY_IF_GE32

#define HWY_IF_GE32 ( T,
N )
Value:
hwy::EnableIf<N * sizeof(T) >= 4>* = nullptr

◆ HWY_IF_GE64

#define HWY_IF_GE64 ( T,
N )
Value:
hwy::EnableIf<N * sizeof(T) >= 8>* = nullptr

◆ HWY_IF_GT128

#define HWY_IF_GT128 ( T,
N )
Value:
hwy::EnableIf<(N * sizeof(T) > 16)>* = nullptr

◆ HWY_IF_LANE_SIZE

#define HWY_IF_LANE_SIZE ( T,
bytes )
Value:
hwy::EnableIf<sizeof(T) == (bytes)>* = nullptr

◆ HWY_IF_LANE_SIZE_ONE_OF

#define HWY_IF_LANE_SIZE_ONE_OF ( T,
bit_array )
Value:
hwy::EnableIf<((size_t{1} << sizeof(T)) & (bit_array)) != 0>* = nullptr

◆ HWY_IF_LANES_PER_BLOCK

#define HWY_IF_LANES_PER_BLOCK ( T,
N,
LANES )
Value:
hwy::EnableIf<HWY_MIN(sizeof(T) * N, 16) / sizeof(T) == (LANES)>* = nullptr
#define HWY_MIN(a, b)
Definition base.h:134

◆ HWY_IF_LE128

#define HWY_IF_LE128 ( T,
N )
Value:
hwy::EnableIf<N * sizeof(T) <= 16>* = nullptr

◆ HWY_IF_LE32

#define HWY_IF_LE32 ( T,
N )
Value:
hwy::EnableIf<N * sizeof(T) <= 4>* = nullptr

◆ HWY_IF_LE64

#define HWY_IF_LE64 ( T,
N )
Value:
hwy::EnableIf<N * sizeof(T) <= 8>* = nullptr

◆ HWY_IF_NOT_FLOAT

#define HWY_IF_NOT_FLOAT ( T)
Value:

◆ HWY_IF_NOT_LANE_SIZE

#define HWY_IF_NOT_LANE_SIZE ( T,
bytes )
Value:
hwy::EnableIf<sizeof(T) != (bytes)>* = nullptr

◆ HWY_IF_SIGNED

#define HWY_IF_SIGNED ( T)
Value:
hwy::EnableIf<IsSigned<T>() && !IsFloat<T>()>* = nullptr

◆ HWY_IF_UNSIGNED

#define HWY_IF_UNSIGNED ( T)
Value:

◆ HWY_INLINE

#define HWY_INLINE   inline

◆ HWY_IS_ASAN

#define HWY_IS_ASAN   0

◆ HWY_IS_DEBUG_BUILD

#define HWY_IS_DEBUG_BUILD   1

◆ HWY_IS_MSAN

#define HWY_IS_MSAN   0

◆ HWY_IS_TSAN

#define HWY_IS_TSAN   0

◆ HWY_LIKELY

#define HWY_LIKELY ( expr)
Value:
__builtin_expect(!!(expr), 1)

◆ HWY_MAX

◆ HWY_MAYBE_UNUSED

#define HWY_MAYBE_UNUSED   __attribute__((unused))

◆ HWY_MIN

◆ HWY_MUST_USE_RESULT

#define HWY_MUST_USE_RESULT   __attribute__((warn_unused_result))

◆ HWY_NOINLINE

#define HWY_NOINLINE   __attribute__((noinline))

◆ HWY_NORETURN

#define HWY_NORETURN   __attribute__((noreturn))

◆ HWY_POP_ATTRIBUTES

#define HWY_POP_ATTRIBUTES

◆ HWY_PRAGMA

#define HWY_PRAGMA ( tokens)
Value:
_Pragma(#tokens)

◆ HWY_PUSH_ATTRIBUTES

#define HWY_PUSH_ATTRIBUTES ( targets_str)

◆ HWY_REP4

#define HWY_REP4 ( literal)
Value:
literal, literal, literal, literal

◆ HWY_RESTRICT

◆ HWY_STR

#define HWY_STR ( macro)
Value:
#define HWY_STR_IMPL(macro)
Definition base.h:37

◆ HWY_STR_IMPL

#define HWY_STR_IMPL ( macro)
Value:
#macro

◆ HWY_UNLIKELY

◆ HWY_UNROLL

#define HWY_UNROLL ( factor)