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 16474 of file exprtk.hpp.

Member Typedef Documentation

◆ ivector_ptr

Definition at line 16476 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 16478 of file exprtk.hpp.

16479 {
16480 const T* vec = v->vec()->vds().data();
16481 const std::size_t vec_size = v->vec()->size();
16482
16483 loop_unroll::details lud(vec_size);
16484
16485 if (vec_size <= static_cast<std::size_t>(lud.batch_size))
16486 {
16487 T result = T(1);
16488 int i = 0;
16489
16490 switch (vec_size)
16491 {
16492 #define case_stmt(N,fall_through) \
16493 case N : result *= vec[i++]; \
16494 fall_through \
16495
16496 #ifndef exprtk_disable_superscalar_unroll
16503 #endif
16505 case_stmt( 2, exprtk_fallthrough) case_stmt( 1, (void)0;)
16506 }
16507
16508 #undef case_stmt
16509
16510 return result;
16511 }
16512
16513 T r[] = {
16514 T(1), T(1), T(1), T(1), T(1), T(1), T(1), T(1),
16515 T(1), T(1), T(1), T(1), T(1), T(1), T(1), T(1)
16516 };
16517
16518 const T* upper_bound = vec + lud.upper_bound;
16519
16520 while (vec < upper_bound)
16521 {
16522 #define exprtk_loop(N) \
16523 r[N] *= vec[N]; \
16524
16525 exprtk_loop( 0) exprtk_loop( 1)
16526 exprtk_loop( 2) exprtk_loop( 3)
16527 #ifndef exprtk_disable_superscalar_unroll
16528 exprtk_loop( 4) exprtk_loop( 5)
16529 exprtk_loop( 6) exprtk_loop( 7)
16530 exprtk_loop( 8) exprtk_loop( 9)
16531 exprtk_loop(10) exprtk_loop(11)
16532 exprtk_loop(12) exprtk_loop(13)
16533 exprtk_loop(14) exprtk_loop(15)
16534 #endif
16535
16536 vec += lud.batch_size;
16537 }
16538
16539 int i = 0;
16540
16541 switch (lud.remainder)
16542 {
16543 #define case_stmt(N,fall_through) \
16544 case N : r[0] *= vec[i++]; \
16545 fall_through \
16546
16547 #ifndef exprtk_disable_superscalar_unroll
16554 #endif
16556 case_stmt( 1, (void)0;)
16557 }
16558
16559 #undef exprtk_loop
16560 #undef case_stmt
16561
16562 return (r[ 0] * r[ 1] * r[ 2] * r[ 3])
16563 #ifndef exprtk_disable_superscalar_unroll
16564 * (r[ 4] * r[ 5] * r[ 6] * r[ 7])
16565 * (r[ 8] * r[ 9] * r[10] * r[11])
16566 * (r[12] * r[13] * r[14] * r[15])
16567 #endif
16568 ;
16569 }
#define case_stmt(N)
Definition exprtk.hpp:32731
#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:598

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: