Flutter Engine
The Flutter Engine
Classes | Namespaces | Macros | Typedefs | Functions
SkVx.h File Reference
#include "include/private/base/SkFeatures.h"
#include "src/base/SkUtils.h"
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <initializer_list>
#include <type_traits>
#include <utility>
#include <immintrin.h>

Go to the source code of this file.

Classes

struct  skvx::Vec< N, T >
 
struct  skvx::Vec< 4, T >
 
struct  skvx::Vec< 2, T >
 
struct  skvx::Vec< 1, T >
 
struct  skvx::Mask< T >
 
struct  skvx::Mask< float >
 
struct  skvx::Mask< double >
 
class  skvx::ScaledDividerU32
 

Namespaces

namespace  skvx
 

Macros

#define SKVX_USE_SIMD   1
 
#define SKVX_ALWAYS_INLINE   __attribute__((always_inline))
 
#define SI   static inline
 
#define SIT   template < typename T> SI
 
#define SIN   template <int N > SI
 
#define SINT   template <int N, typename T> SI
 
#define SINTU
 
#define I(x)   sk_bit_cast<Vec<N,int32_t>>(x)
 
#define F(x)   sk_bit_cast<Vec<N,float>>(x)
 

Typedefs

template<typename T >
using skvx::M = typename Mask< T >::type
 
using skvx::float2 = Vec< 2, float >
 
using skvx::float4 = Vec< 4, float >
 
using skvx::float8 = Vec< 8, float >
 
using skvx::double2 = Vec< 2, double >
 
using skvx::double4 = Vec< 4, double >
 
using skvx::double8 = Vec< 8, double >
 
using skvx::byte2 = Vec< 2, uint8_t >
 
using skvx::byte4 = Vec< 4, uint8_t >
 
using skvx::byte8 = Vec< 8, uint8_t >
 
using skvx::byte16 = Vec< 16, uint8_t >
 
using skvx::int2 = Vec< 2, int32_t >
 
using skvx::int4 = Vec< 4, int32_t >
 
using skvx::int8 = Vec< 8, int32_t >
 
using skvx::ushort2 = Vec< 2, uint16_t >
 
using skvx::ushort4 = Vec< 4, uint16_t >
 
using skvx::ushort8 = Vec< 8, uint16_t >
 
using skvx::uint2 = Vec< 2, uint32_t >
 
using skvx::uint4 = Vec< 4, uint32_t >
 
using skvx::uint8 = Vec< 8, uint32_t >
 
using skvx::long2 = Vec< 2, int64_t >
 
using skvx::long4 = Vec< 4, int64_t >
 
using skvx::long8 = Vec< 8, int64_t >
 
using skvx::half2 = Vec< 2, uint16_t >
 
using skvx::half4 = Vec< 4, uint16_t >
 
using skvx::half8 = Vec< 8, uint16_t >
 

Functions

template<int... Ix, int N, typename T >
SI Vec< sizeof...(Ix), Tskvx::shuffle (const Vec< N, T > &)
 
SINT Vec< 2 *N, Tskvx::join (const Vec< N, T > &lo, const Vec< N, T > &hi)
 
SIT Vec< 1, Tskvx::operator+ (const Vec< 1, T > &x, const Vec< 1, T > &y)
 
SIT Vec< 1, Tskvx::operator- (const Vec< 1, T > &x, const Vec< 1, T > &y)
 
SIT Vec< 1, Tskvx::operator* (const Vec< 1, T > &x, const Vec< 1, T > &y)
 
SIT Vec< 1, Tskvx::operator/ (const Vec< 1, T > &x, const Vec< 1, T > &y)
 
SIT Vec< 1, Tskvx::operator^ (const Vec< 1, T > &x, const Vec< 1, T > &y)
 
SIT Vec< 1, Tskvx::operator& (const Vec< 1, T > &x, const Vec< 1, T > &y)
 
SIT Vec< 1, Tskvx::operator| (const Vec< 1, T > &x, const Vec< 1, T > &y)
 
SIT Vec< 1, Tskvx::operator! (const Vec< 1, T > &x)
 
SIT Vec< 1, Tskvx::operator- (const Vec< 1, T > &x)
 
SIT Vec< 1, Tskvx::operator~ (const Vec< 1, T > &x)
 
SIT Vec< 1, Tskvx::operator<< (const Vec< 1, T > &x, int k)
 
SIT Vec< 1, Tskvx::operator>> (const Vec< 1, T > &x, int k)
 
SIT Vec< 1, M< T > > skvx::operator== (const Vec< 1, T > &x, const Vec< 1, T > &y)
 
SIT Vec< 1, M< T > > skvx::operator!= (const Vec< 1, T > &x, const Vec< 1, T > &y)
 
SIT Vec< 1, M< T > > skvx::operator<= (const Vec< 1, T > &x, const Vec< 1, T > &y)
 
SIT Vec< 1, M< T > > skvx::operator>= (const Vec< 1, T > &x, const Vec< 1, T > &y)
 
SIT Vec< 1, M< T > > skvx::operator< (const Vec< 1, T > &x, const Vec< 1, T > &y)
 
SIT Vec< 1, M< T > > skvx::operator> (const Vec< 1, T > &x, const Vec< 1, T > &y)
 
SINT Vec< N, Tskvx::operator+ (const Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, Tskvx::operator- (const Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, Tskvx::operator* (const Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, Tskvx::operator/ (const Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, Tskvx::operator^ (const Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, Tskvx::operator& (const Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, Tskvx::operator| (const Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, Tskvx::operator! (const Vec< N, T > &x)
 
SINT Vec< N, Tskvx::operator- (const Vec< N, T > &x)
 
SINT Vec< N, Tskvx::operator~ (const Vec< N, T > &x)
 
SINT Vec< N, Tskvx::operator<< (const Vec< N, T > &x, int k)
 
SINT Vec< N, Tskvx::operator>> (const Vec< N, T > &x, int k)
 
SINT Vec< N, M< T > > skvx::operator== (const Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, M< T > > skvx::operator!= (const Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, M< T > > skvx::operator<= (const Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, M< T > > skvx::operator>= (const Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, M< T > > skvx::operator< (const Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, M< T > > skvx::operator> (const Vec< N, T > &x, const Vec< N, T > &y)
 
SINTU Vec< N, Tskvx::operator+ (U x, const Vec< N, T > &y)
 
SINTU Vec< N, Tskvx::operator- (U x, const Vec< N, T > &y)
 
SINTU Vec< N, Tskvx::operator* (U x, const Vec< N, T > &y)
 
SINTU Vec< N, Tskvx::operator/ (U x, const Vec< N, T > &y)
 
SINTU Vec< N, Tskvx::operator^ (U x, const Vec< N, T > &y)
 
SINTU Vec< N, Tskvx::operator& (U x, const Vec< N, T > &y)
 
SINTU Vec< N, Tskvx::operator| (U x, const Vec< N, T > &y)
 
SINTU Vec< N, M< T > > skvx::operator== (U x, const Vec< N, T > &y)
 
SINTU Vec< N, M< T > > skvx::operator!= (U x, const Vec< N, T > &y)
 
SINTU Vec< N, M< T > > skvx::operator<= (U x, const Vec< N, T > &y)
 
SINTU Vec< N, M< T > > skvx::operator>= (U x, const Vec< N, T > &y)
 
SINTU Vec< N, M< T > > skvx::operator< (U x, const Vec< N, T > &y)
 
SINTU Vec< N, M< T > > skvx::operator> (U x, const Vec< N, T > &y)
 
SINTU Vec< N, Tskvx::operator+ (const Vec< N, T > &x, U y)
 
SINTU Vec< N, Tskvx::operator- (const Vec< N, T > &x, U y)
 
SINTU Vec< N, Tskvx::operator* (const Vec< N, T > &x, U y)
 
SINTU Vec< N, Tskvx::operator/ (const Vec< N, T > &x, U y)
 
SINTU Vec< N, Tskvx::operator^ (const Vec< N, T > &x, U y)
 
SINTU Vec< N, Tskvx::operator& (const Vec< N, T > &x, U y)
 
SINTU Vec< N, Tskvx::operator| (const Vec< N, T > &x, U y)
 
SINTU Vec< N, M< T > > skvx::operator== (const Vec< N, T > &x, U y)
 
SINTU Vec< N, M< T > > skvx::operator!= (const Vec< N, T > &x, U y)
 
SINTU Vec< N, M< T > > skvx::operator<= (const Vec< N, T > &x, U y)
 
SINTU Vec< N, M< T > > skvx::operator>= (const Vec< N, T > &x, U y)
 
SINTU Vec< N, M< T > > skvx::operator< (const Vec< N, T > &x, U y)
 
SINTU Vec< N, M< T > > skvx::operator> (const Vec< N, T > &x, U y)
 
SINT Vec< N, T > & skvx::operator+= (Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, T > & skvx::operator-= (Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, T > & skvx::operator*= (Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, T > & skvx::operator/= (Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, T > & skvx::operator^= (Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, T > & skvx::operator&= (Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, T > & skvx::operator|= (Vec< N, T > &x, const Vec< N, T > &y)
 
SINTU Vec< N, T > & skvx::operator+= (Vec< N, T > &x, U y)
 
SINTU Vec< N, T > & skvx::operator-= (Vec< N, T > &x, U y)
 
SINTU Vec< N, T > & skvx::operator*= (Vec< N, T > &x, U y)
 
SINTU Vec< N, T > & skvx::operator/= (Vec< N, T > &x, U y)
 
SINTU Vec< N, T > & skvx::operator^= (Vec< N, T > &x, U y)
 
SINTU Vec< N, T > & skvx::operator&= (Vec< N, T > &x, U y)
 
SINTU Vec< N, T > & skvx::operator|= (Vec< N, T > &x, U y)
 
SINT Vec< N, T > & skvx::operator<<= (Vec< N, T > &x, int bits)
 
SINT Vec< N, T > & skvx::operator>>= (Vec< N, T > &x, int bits)
 
SINT Vec< N, Tskvx::naive_if_then_else (const Vec< N, M< T > > &cond, const Vec< N, T > &t, const Vec< N, T > &e)
 
SIT Vec< 1, Tskvx::if_then_else (const Vec< 1, M< T > > &cond, const Vec< 1, T > &t, const Vec< 1, T > &e)
 
SINT Vec< N, Tskvx::if_then_else (const Vec< N, M< T > > &cond, const Vec< N, T > &t, const Vec< N, T > &e)
 
SIT bool skvx::any (const Vec< 1, T > &x)
 
SINT bool skvx::any (const Vec< N, T > &x)
 
SIT bool skvx::all (const Vec< 1, T > &x)
 
SINT bool skvx::all (const Vec< N, T > &x)
 
template<typename D , typename S >
SI Vec< 1, Dskvx::cast (const Vec< 1, S > &src)
 
template<typename D , int N, typename S >
SI Vec< N, Dskvx::cast (const Vec< N, S > &src)
 
SIT T skvx::min (const Vec< 1, T > &x)
 
SIT T skvx::max (const Vec< 1, T > &x)
 
SINT T skvx::min (const Vec< N, T > &x)
 
SINT T skvx::max (const Vec< N, T > &x)
 
SINT Vec< N, Tskvx::min (const Vec< N, T > &x, const Vec< N, T > &y)
 
SINT Vec< N, Tskvx::max (const Vec< N, T > &x, const Vec< N, T > &y)
 
SINTU Vec< N, Tskvx::min (const Vec< N, T > &x, U y)
 
SINTU Vec< N, Tskvx::max (const Vec< N, T > &x, U y)
 
SINTU Vec< N, Tskvx::min (U x, const Vec< N, T > &y)
 
SINTU Vec< N, Tskvx::max (U x, const Vec< N, T > &y)
 
SINT Vec< N, Tskvx::pin (const Vec< N, T > &x, const Vec< N, T > &lo, const Vec< N, T > &hi)
 
template<typename Fn , typename... Args, size_t... I>
SI auto skvx::map (std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>
 
template<typename Fn , int N, typename T , typename... Rest>
auto skvx::map (Fn &&fn, const Vec< N, T > &first, const Rest &... rest)
 
SIN Vec< N, float > skvx::ceil (const Vec< N, float > &x)
 
SIN Vec< N, float > skvx::floor (const Vec< N, float > &x)
 
SIN Vec< N, float > skvx::trunc (const Vec< N, float > &x)
 
SIN Vec< N, float > skvx::round (const Vec< N, float > &x)
 
SIN Vec< N, float > skvx::sqrt (const Vec< N, float > &x)
 
SIN Vec< N, float > skvx::abs (const Vec< N, float > &x)
 
SIN Vec< N, float > skvx::fma (const Vec< N, float > &x, const Vec< N, float > &y, const Vec< N, float > &z)
 
SI Vec< 1, intskvx::lrint (const Vec< 1, float > &x)
 
SIN Vec< N, intskvx::lrint (const Vec< N, float > &x)
 
SIN Vec< N, float > skvx::fract (const Vec< N, float > &x)
 
SIN Vec< N, uint16_t > skvx::to_half (const Vec< N, float > &x)
 
SIN Vec< N, float > skvx::from_half (const Vec< N, uint16_t > &x)
 
SIN Vec< N, uint8_t > skvx::div255 (const Vec< N, uint16_t > &x)
 
SIN Vec< N, uint8_t > skvx::approx_scale (const Vec< N, uint8_t > &x, const Vec< N, uint8_t > &y)
 
SINT std::enable_if_t< std::is_unsigned_v< T >, Vec< N, T > > skvx::saturated_add (const Vec< N, T > &x, const Vec< N, T > &y)
 
SIN Vec< N, uint16_t > skvx::mull (const Vec< N, uint8_t > &x, const Vec< N, uint8_t > &y)
 
SIN Vec< N, uint32_t > skvx::mull (const Vec< N, uint16_t > &x, const Vec< N, uint16_t > &y)
 
SIN Vec< N, uint16_t > skvx::mulhi (const Vec< N, uint16_t > &x, const Vec< N, uint16_t > &y)
 
SINT T skvx::dot (const Vec< N, T > &a, const Vec< N, T > &b)
 
SIT T skvx::cross (const Vec< 2, T > &a, const Vec< 2, T > &b)
 
SIN float skvx::length (const Vec< N, float > &v)
 
SIN double skvx::length (const Vec< N, double > &v)
 
SIN Vec< N, float > skvx::normalize (const Vec< N, float > &v)
 
SIN Vec< N, double > skvx::normalize (const Vec< N, double > &v)
 
SINT bool skvx::isfinite (const Vec< N, T > &v)
 
SIT void skvx::strided_load4 (const T *v, Vec< 1, T > &a, Vec< 1, T > &b, Vec< 1, T > &c, Vec< 1, T > &d)
 
SINT void skvx::strided_load4 (const T *v, Vec< N, T > &a, Vec< N, T > &b, Vec< N, T > &c, Vec< N, T > &d)
 
SI void skvx::strided_load4 (const float *v, Vec< 4, float > &a, Vec< 4, float > &b, Vec< 4, float > &c, Vec< 4, float > &d)
 
SIT void skvx::strided_load2 (const T *v, Vec< 1, T > &a, Vec< 1, T > &b)
 
SINT void skvx::strided_load2 (const T *v, Vec< N, T > &a, Vec< N, T > &b)
 

Macro Definition Documentation

◆ F

#define F (   x)    sk_bit_cast<Vec<N,float>>(x)

◆ I

#define I (   x)    sk_bit_cast<Vec<N,int32_t>>(x)

◆ SI

#define SI   static inline

Definition at line 66 of file SkVx.h.

◆ SIN

#define SIN   template <int N > SI

Definition at line 68 of file SkVx.h.

◆ SINT

#define SINT   template <int N, typename T> SI

Definition at line 69 of file SkVx.h.

◆ SINTU

#define SINTU
Value:
template <int N, typename T, typename U, \
#define SI
Definition: SkVx.h:66
#define N
Definition: beziers.cpp:19
uint8_t value
#define T
Definition: precompiler.cc:65

Definition at line 70 of file SkVx.h.

◆ SIT

#define SIT   template < typename T> SI

Definition at line 67 of file SkVx.h.

◆ SKVX_ALWAYS_INLINE

#define SKVX_ALWAYS_INLINE   __attribute__((always_inline))

Definition at line 62 of file SkVx.h.

◆ SKVX_USE_SIMD

#define SKVX_USE_SIMD   1

Definition at line 38 of file SkVx.h.