VCTR
Loading...
Searching...
No Matches
vctr::expressions::FastLog2< extent, SrcType > Class Template Reference

Calculates a fast approximation for the log2 function. More...

Inheritance diagram for vctr::expressions::FastLog2< extent, SrcType >:
vctr::ExpressionTemplateBase

Public Types

using value_type = ValueType< SrcType >
 
using Constants = detail::FastLog2Constants< value_type >
 

Public Member Functions

VCTR_FORCEDINLINE value_type operator[] (size_t i) const
 
VCTR_FORCEDINLINE VCTR_TARGET ("avx") void prepareAVXEvaluation() const
 
VCTR_FORCEDINLINE VCTR_TARGET ("fma") AVXRegister< value_type > getAVX(size_t i) const
 
VCTR_FORCEDINLINE VCTR_TARGET ("sse4.1") void prepareSSEEvaluation() const
 
VCTR_FORCEDINLINE VCTR_TARGET ("sse4.1") SSERegister< value_type > getSSE(size_t i) const
 
void prepareNeonEvaluation () const
 
NeonRegister< value_type > getNeon (size_t i) const
 

Detailed Description

template<size_t extent, class SrcType>
requires std::same_as<float, ValueType<SrcType>>
class vctr::expressions::FastLog2< extent, SrcType >

Calculates a fast approximation for the log2 function.

This implementation is inspired by https://github.com/romeric/fastapprox/blob/ccc534400ec3e0f67de4eafb53377334962d9db6/fastapprox/src/fastlog.h#L48. It relies on reinterpreting the bytes of a float as integer and manipulating the exponent and mantissa part.


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