port skx opts to old style

Change-Id: I364365455cc3580f38ddd189f00050ea9e2238a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294565
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
This commit is contained in:
Mike Klein 2020-06-05 08:52:17 -05:00 committed by Skia Commit-Bot
parent aa10dfeec9
commit 6f56f2ed3f
3 changed files with 12 additions and 65 deletions

View File

@ -272,7 +272,6 @@ skia_core_sources = [
"$_src/core/SkOSFile.h",
"$_src/core/SkOpts.cpp",
"$_src/core/SkOpts.h",
"$_src/core/SkOpts_skx.cpp",
"$_src/core/SkOrderedReadBuffer.h",
"$_src/core/SkOverdrawCanvas.cpp",
"$_src/core/SkPaint.cpp",

View File

@ -1,63 +0,0 @@
/*
* Copyright 2020 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "src/core/SkOpts.h"
#if defined(SK_CPU_X86)
// Turn on SKX feature set.
#if defined(__clang__)
#pragma clang attribute push(__attribute__((target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl"))), apply_to=function)
#elif defined(__GNUC__)
#pragma GCC push_options
#pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")
#endif
// Let our code in *_opts.h know we want SKX features.
#undef SK_CPU_SSE_LEVEL
#define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SKX
#if defined(__clang__) && defined(_MSC_VER)
// clang-cl's immintrin.h is bizarrely annoying, not including the
// various foointrin.h unless the __FOO__ flag is also defined (i.e.
// you used command-line flags to set the features instead of attributes).
// MSVC itself doesn't work this way, nor does non-_MSC_VER clang. :/
#define __SSE__ 1
#define __SSE2__ 1
#define __SSE3__ 1
#define __SSSE3__ 1
#define __SSE4_1__ 1
#define __SSE4_2__ 1
#define __AVX__ 1
#define __F16C__ 1
#define __AVX2__ 1
#define __FMA__ 1
#define __AVX512F__ 1
#define __AVX512DQ__ 1
#define __AVX512CD__ 1
#define __AVX512BW__ 1
#define __AVX512VL__ 1
#endif
#define SK_OPTS_NS skx
#include "src/opts/SkBlitRow_opts.h"
#include "src/opts/SkVM_opts.h"
namespace SkOpts {
void Init_skx() {
blit_row_s32a_opaque = SK_OPTS_NS::blit_row_s32a_opaque;
interpret_skvm = SK_OPTS_NS::interpret_skvm;
}
}
#if defined(__clang__)
#pragma clang attribute pop
#elif defined(__GNUC__)
#pragma GCC pop_options
#endif
#endif//defined(SK_CPU_X86)

View File

@ -5,4 +5,15 @@
* found in the LICENSE file.
*/
// Intentionally empty, to be filled in.
#include "src/core/SkOpts.h"
#define SK_OPTS_NS skx
#include "src/opts/SkBlitRow_opts.h"
#include "src/opts/SkVM_opts.h"
namespace SkOpts {
void Init_skx() {
blit_row_s32a_opaque = SK_OPTS_NS::blit_row_s32a_opaque;
interpret_skvm = SK_OPTS_NS::interpret_skvm;
}
}