C++ Mathematical Expression Toolkit (ExprTk) release
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
exprtk::details::vec_mul_op< T > Struct Template Reference

Public Types

typedef vector_interface< T > * ivector_ptr
 

Static Public Member Functions

static T process (const ivector_ptr v)
 

Detailed Description

template<typename T>
struct exprtk::details::vec_mul_op< T >

Definition at line 16673 of file exprtk.hpp.

Member Typedef Documentation

◆ ivector_ptr

Definition at line 16675 of file exprtk.hpp.

Member Function Documentation

◆ process()

template<typename T >
static T exprtk::details::vec_mul_op< T >::process ( const ivector_ptr  v)
inlinestatic

Definition at line 16677 of file exprtk.hpp.

16678 {
16679 const T* vec = v->vec()->vds().data();
16680 const std::size_t vec_size = v->vec()->size();
16681
16682 loop_unroll::details lud(vec_size);
16683
16684 if (vec_size <= static_cast<std::size_t>(lud.batch_size))
16685 {
16686 T result = T(1);
16687 int i = 0;
16688
16689 switch (vec_size)
16690 {
16691 #define case_stmt(N,fall_through) \
16692 case N : result *= vec[i++]; \
16693 fall_through \
16694
16695 #ifndef exprtk_disable_superscalar_unroll
16702 #endif
16704 case_stmt( 2, exprtk_fallthrough) case_stmt( 1, (void)0;)
16705 }
16706
16707 #undef case_stmt
16708
16709 return result;
16710 }
16711
16712 T r[] = {
16713 T(1), T(1), T(1), T(1), T(1), T(1), T(1), T(1),
16714 T(1), T(1), T(1), T(1), T(1), T(1), T(1), T(1)
16715 };
16716
16717 const T* upper_bound = vec + lud.upper_bound;
16718
16719 while (vec < upper_bound)
16720 {
16721 #define exprtk_loop(N) \
16722 r[N] *= vec[N]; \
16723
16724 exprtk_loop( 0) exprtk_loop( 1)
16725 exprtk_loop( 2) exprtk_loop( 3)
16726 #ifndef exprtk_disable_superscalar_unroll
16727 exprtk_loop( 4) exprtk_loop( 5)
16728 exprtk_loop( 6) exprtk_loop( 7)
16729 exprtk_loop( 8) exprtk_loop( 9)
16730 exprtk_loop(10) exprtk_loop(11)
16731 exprtk_loop(12) exprtk_loop(13)
16732 exprtk_loop(14) exprtk_loop(15)
16733 #endif
16734
16735 vec += lud.batch_size;
16736 }
16737
16738 int i = 0;
16739
16740 switch (lud.remainder)
16741 {
16742 #define case_stmt(N,fall_through) \
16743 case N : r[0] *= vec[i++]; \
16744 fall_through \
16745
16746 #ifndef exprtk_disable_superscalar_unroll
16753 #endif
16755 case_stmt( 1, (void)0;)
16756 }
16757
16758 #undef exprtk_loop
16759 #undef case_stmt
16760
16761 return (r[ 0] * r[ 1] * r[ 2] * r[ 3])
16762 #ifndef exprtk_disable_superscalar_unroll
16763 * (r[ 4] * r[ 5] * r[ 6] * r[ 7])
16764 * (r[ 8] * r[ 9] * r[10] * r[11])
16765 * (r[12] * r[13] * r[14] * r[15])
16766 #endif
16767 ;
16768 }
#define case_stmt(N)
Definition exprtk.hpp:33204
#define exprtk_fallthrough
Definition exprtk.hpp:86
#define exprtk_loop(N)
bool match_impl(const Iterator pattern_begin, const Iterator pattern_end, const Iterator data_begin, const Iterator data_end, const typename std::iterator_traits< Iterator >::value_type &zero_or_more, const typename std::iterator_traits< Iterator >::value_type &exactly_one)
Definition exprtk.hpp:605

References case_stmt, exprtk::details::vec_data_store< T >::data(), exprtk_fallthrough, exprtk_loop, exprtk::details::match_impl(), exprtk::details::vector_node< T >::size(), exprtk::details::vector_node< T >::vds(), and exprtk::details::vector_interface< T >::vec().

Here is the call graph for this function:

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