18#ifndef DT_SYSTEM_SIMD_H
19#define DT_SYSTEM_SIMD_H
31#if defined(__aarch64__)
35#if defined(__x86_64__) || defined(__i386__)
60#ifdef DT_NO_VECTORIZATION
61#define DT_PIXEL_SIMD_CHANNELS 3
63#define DT_PIXEL_SIMD_CHANNELS 4
76#if defined(_OPENMP) && defined(OPENMP_SIMD_) && !defined(DT_NO_SIMD_HINTS)
78#define _DT_Pragma_(x) _Pragma(#x)
79#define _DT_Pragma(x) _DT_Pragma_(x)
80#define for_each_channel(_var, ...) \
81 _DT_Pragma(omp simd __VA_ARGS__) \
82 for (size_t _var = 0; _var < DT_PIXEL_SIMD_CHANNELS; _var++)
83#define for_four_channels(_var, ...) \
84 _DT_Pragma(omp simd __VA_ARGS__) \
85 for (size_t _var = 0; _var < 4; _var++)
87#define for_each_channel(_var, ...) \
88 for (size_t _var = 0; _var < DT_PIXEL_SIMD_CHANNELS; _var++)
89#define for_four_channels(_var, ...) \
90 for (size_t _var = 0; _var < 4; _var++)
101 dt_aligned_pixel_simd_t
out =
value;
102 for(
int c = 0;
c < 4;
c++)
110 dt_aligned_pixel_simd_t
out =
value;
111 for(
int c = 0;
c < 4;
c++)
120 for(
int c = 0; c < 4; c++)
128 dt_aligned_pixel_simd_t
out = base;
129 for(
int c = 0; c < 4; c++)
137 dt_aligned_pixel_simd_t
out;
167#if defined(__x86_64__) || defined(__i386__)
170 dt_aligned_pixel_simd_t
simd;
174#elif defined(__aarch64__)
177 dt_aligned_pixel_simd_t
simd;
181#elif (__clang__+0 > 7) && (__clang__+0 < 10)
190 const dt_aligned_pixel_simd_t
row1,
const dt_aligned_pixel_simd_t
row2)
194 dt_aligned_pixel_simd_t
out =
row0 *
in[0];
return vector dt_simd_set1(valid ?(scaling+NORM_MIN) :NORM_MIN)
dt_store_simd_aligned(out, dt_mat3x4_mul_vec4(vin, dt_colormatrix_row_to_simd(matrix, 0), dt_colormatrix_row_to_simd(matrix, 1), dt_colormatrix_row_to_simd(matrix, 2)))
float *const restrict const size_t k
static const dt_aligned_pixel_simd_t const dt_aligned_pixel_simd_t row1
dt_store_simd(out, value)
static void copy_pixel(float *const __restrict__ out, const float *const __restrict__ in)
DT_ALIGNED_PIXEL float dt_aligned_pixel_t[4]
#define for_each_channel(_var,...)
float dt_aligned_pixel_simd_t __attribute__((vector_size(16), aligned(16)))
Apply one channel's tone curve to each of the three colour channels, or pass the channel through unto...
static void copy_pixel_nontemporal(float *const __restrict__ out, const float *const __restrict__ in)
static const dt_aligned_pixel_simd_t sign
static const dt_aligned_pixel_simd_t const dt_aligned_pixel_simd_t const dt_aligned_pixel_simd_t row2
static const dt_aligned_pixel_simd_t value
static const dt_aligned_pixel_simd_t exponent
static const dt_aligned_pixel_simd_t row0