1 /*
2 * Copyright 2018 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "skcms_public.h" // NO_G3_REWRITE
9 #include "skcms_internals.h" // NO_G3_REWRITE
10 #include "skcms_Transform.h" // NO_G3_REWRITE
11 #include <assert.h>
12 #include <float.h>
13 #include <limits.h>
14 #include <stdlib.h>
15 #include <string.h>
16
17 #if defined(__ARM_NEON)
18 #include <arm_neon.h>
19 #elif defined(__SSE__)
20 #include <immintrin.h>
21
22 #if defined(__clang__)
23 // That #include <immintrin.h> is usually enough, but Clang's headers
24 // avoid #including the whole kitchen sink when _MSC_VER is defined,
25 // because lots of programs on Windows would include that and it'd be
26 // a lot slower. But we want all those headers included, so we can use
27 // their features (after making runtime checks).
28 #include <smmintrin.h>
29 #include <avxintrin.h>
30 #include <avx2intrin.h>
31 #include <avx512fintrin.h>
32 #include <avx512dqintrin.h>
33 #endif
34 #endif
35
36 namespace skcms_private {
37 namespace skx {
38
39 #if defined(SKCMS_DISABLE_SKX)
40
run_program(const Op * program,const void ** contexts,ptrdiff_t programSize,const char * src,char * dst,int n,const size_t src_bpp,const size_t dst_bpp)41 void run_program(const Op* program, const void** contexts, ptrdiff_t programSize,
42 const char* src, char* dst, int n,
43 const size_t src_bpp, const size_t dst_bpp) {
44 skcms_private::baseline::run_program(program, contexts, programSize,
45 src, dst, n, src_bpp, dst_bpp);
46 }
47
48 #else
49
50 #define USING_AVX512F
51 #define N 16
52 template <typename T> using V = skcms_private::Vec<N,T>;
53 #include "Transform_inl.h"
54
55 #endif
56
57 } // namespace skx
58 } // namespace skcms_private
59