Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
skcms_TransformHsw.cc
Go to the documentation of this file.
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
36namespace skcms_private {
37namespace hsw {
38
39#if defined(SKCMS_DISABLE_HSW)
40
41void 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_AVX
51#define USING_AVX_F16C
52#define USING_AVX2
53#define N 8
54template <typename T> using V = skcms_private::Vec<N,T>;
55
56#include "Transform_inl.h"
57
58#endif
59
60} // namespace hsw
61} // namespace skcms_private
T __attribute__((ext_vector_type(N))) V
void 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)
void 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)