一呼百應, "one call, a hundred responses"
Loading...
Searching...
No Matches
numerics.hpp File Reference
#include <bit>
#include <cmath>
#include <cstdint>
#include <type_traits>
#include "attributes/common.hpp"
#include "types.hpp"
#include "numerics/bf16.hpp"
#include "numerics/fp16.hpp"
Include dependency graph for numerics.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ein::imm_t< N >
 A compile time constant passed as an empty struct. More...
 

Namespaces

namespace  ein
 

Concepts

concept  ein::one_of
 N is one of the candidates
 
concept  ein::not_one_of
 N is not one of the candidates
 

Macros

#define IFAVX512(x, y)
 

Typedefs

template<typename T >
using ein::int_t
 returns a signed integer type of the same size as T suitable for std::bitcast
 
template<typename T >
using ein::uint_t
 returns an unsigned integer type of the same size as T suitable for std::bitcast
 

Enumerations

enum class  ein::CMPINT : size_t {
  ein::CMPINT::EQ = 0x0uz ,
  ein::CMPINT::LT = 0x1uz ,
  ein::CMPINT::LE = 0x2uz ,
  ein::CMPINT::FALSE = 0x3uz ,
  ein::CMPINT::NE = 0x4uz ,
  ein::CMPINT::NLT = 0x5uz ,
  ein::CMPINT::NLE = 0x6uz ,
  ein::CMPINT::TRUE = 0x7uz
}
 
enum class  ein::CMP : size_t {
  ein::CMP::EQ_OQ = 0x00uz ,
  ein::CMP::LT_OS = 0x01uz ,
  ein::CMP::LE_OS = 0x02uz ,
  ein::CMP::UNORD_Q = 0x03uz ,
  ein::CMP::NEQ_UQ = 0x04uz ,
  ein::CMP::NLT_US = 0x05uz ,
  ein::CMP::NLE_US = 0x06uz ,
  ein::CMP::ORD_Q = 0x07uz ,
  ein::CMP::EQ_UQ = 0x08uz ,
  ein::CMP::NGE_US = 0x09uz ,
  ein::CMP::NGT_US = 0x0Auz ,
  ein::CMP::FALSE_OQ = 0x0Buz ,
  ein::CMP::NEQ_OQ = 0x0Cuz ,
  ein::CMP::GE_OS = 0x0Duz ,
  ein::CMP::GT_OS = 0x0Euz ,
  ein::CMP::TRUE_UQ = 0x0Fuz ,
  ein::CMP::EQ_OS = 0x10uz ,
  ein::CMP::LT_OQ = 0x11uz ,
  ein::CMP::LE_OQ = 0x12uz ,
  ein::CMP::UNORD_S = 0x13uz ,
  ein::CMP::NEQ_US = 0x14uz ,
  ein::CMP::NLT_UQ = 0x15uz ,
  ein::CMP::NLE_UQ = 0x16uz ,
  ein::CMP::ORD_S = 0x17uz ,
  ein::CMP::EQ_US = 0x18uz ,
  ein::CMP::NGE_UQ = 0x19uz ,
  ein::CMP::NGT_UQ = 0x1Auz ,
  ein::CMP::FALSE_OS = 0x1Buz ,
  ein::CMP::NEQ_OS = 0x1Cuz ,
  ein::CMP::GE_OQ = 0x1Duz ,
  ein::CMP::GT_OQ = 0x1Euz ,
  ein::CMP::TRUE_US = 0x1Fuz
}
 

Functions

template<typename T >
constexpr bool ein::cmp_unord (T a, T b) noexcept
 Return true if either argument is NaN.
 
template<typename T >
constexpr bool ein::cmp_ord (T a, T b) noexcept
 Return true if neither argument is NaN.
 
template<one_of_t< float, double > T>
constexpr T ein::scalef (T x, T y) noexcept
 
template<CMPINT imm8, typename T >
requires (one_of_t<T,uint8_t,int8_t,uint16_t,int16_t,uint32_t,int32_t,uint64_t,int64_t> && (size_t(imm8) < 8uz))
constexpr bool ein::cmpint (T a, T b) noexcept
 
template<CMP imm8, typename T >
requires (one_of_t<T,float,double> && (size_t(imm8) < 32uz))
constexpr bool ein::cmp (T a, T b) noexcept
 perform an avx512 style floating point comparison for scalar values.
 

Variables

template<size_t N>
constinit imm_t< N > ein::imm {}
 A compile time constant passed as an empty struct.
 
constexpr size_t ein::max_fp_comparison_predicate
 AVX512 added many more floating point comparison types. Do we have them?
 

Detailed Description

SPDX-FileType: Source
SPDX-FileCopyrightText: 2024 Edward Kmett <ekmett@gmail.com>
SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0

Definition in file numerics.hpp.

Macro Definition Documentation

◆ IFAVX512

#define IFAVX512 ( x,
y )
Value:
x

Definition at line 18 of file numerics.hpp.