Rcpp Version 1.1.2
Loading...
Searching...
No Matches
unroll.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RCPP_LOOP_UNROLL_PTR(TARGET, SOURCE)
#define RCPP_LOOP_UNROLL(TARGET, SOURCE)
#define RCPP_LOOP_UNROLL_LHSFUN(TARGET, FUN, SOURCE)

Macro Definition Documentation

◆ RCPP_LOOP_UNROLL

#define RCPP_LOOP_UNROLL ( TARGET,
SOURCE )
Value:
R_xlen_t __trip_count = n >> 2 ; \
R_xlen_t i = 0 ; \
for ( ; __trip_count > 0 ; --__trip_count) { \
TARGET[i] = SOURCE[i] ; i++ ; \
TARGET[i] = SOURCE[i] ; i++ ; \
TARGET[i] = SOURCE[i] ; i++ ; \
TARGET[i] = SOURCE[i] ; i++ ; \
} \
switch (n - i){ \
case 3: \
TARGET[i] = SOURCE[i] ; i++ ; /* fallthrough */ \
case 2: \
TARGET[i] = SOURCE[i] ; i++ ; /* fallthrough */ \
case 1: \
TARGET[i] = SOURCE[i] ; i++ ; /* fallthrough */ \
case 0: \
default: \
{} \
}

Definition at line 47 of file unroll.h.

Referenced by Rcpp::Vector< VECSXP, StoragePolicy >::import_expression(), Rcpp::MatrixColumn< RTYPE >::operator=(), and Rcpp::MatrixColumn< RTYPE >::operator=().

◆ RCPP_LOOP_UNROLL_LHSFUN

#define RCPP_LOOP_UNROLL_LHSFUN ( TARGET,
FUN,
SOURCE )
Value:
R_xlen_t __trip_count = n >> 2 ; \
R_xlen_t i = 0 ; \
for ( ; __trip_count > 0 ; --__trip_count) { \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; \
} \
switch (n - i){ \
case 3: \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; /* fallthrough */ \
case 2: \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; /* fallthrough */ \
case 1: \
TARGET[FUN(i)] = SOURCE[i] ; i++ ; /* fallthrough */ \
case 0: \
default: \
{} \
}

Definition at line 68 of file unroll.h.

Referenced by Rcpp::MatrixRow< RTYPE >::operator=(), and Rcpp::MatrixRow< RTYPE >::operator=().

◆ RCPP_LOOP_UNROLL_PTR

#define RCPP_LOOP_UNROLL_PTR ( TARGET,
SOURCE )
Value:
R_xlen_t __trip_count = n >> 2 ; \
R_xlen_t i = 0 ; \
for ( ; __trip_count > 0 ; --__trip_count) { \
*TARGET++ = SOURCE[i++] ; \
*TARGET++ = SOURCE[i++] ; \
*TARGET++ = SOURCE[i++] ; \
*TARGET++ = SOURCE[i++] ; \
} \
switch (n - i){ \
case 3: \
*TARGET++ = SOURCE[i++] ; \
case 2: \
*TARGET++ = SOURCE[i++] ; \
case 1: \
*TARGET++ = SOURCE[i++] ; \
case 0: \
default: \
{} \
}

Definition at line 25 of file unroll.h.