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 #endif 30 #elif defined(__loongarch_sx) 31 #include <lsxintrin.h> 32 #endif 33 34 namespace skcms_private { 35 namespace baseline { 36 37 #if defined(SKCMS_PORTABLE) 38 // Build skcms in a portable scalar configuration. 39 #define N 1 40 template <typename T> using V = T; 41 #else 42 // Build skcms with basic four-line SIMD support. (SSE on Intel, or Neon on ARM) 43 #define N 4 44 template <typename T> using V = skcms_private::Vec<N,T>; 45 #endif 46 47 #include "Transform_inl.h" 48 49 } // namespace baseline 50 } // namespace skcms_private 51