Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: src/core/SkOpts.cpp

Issue 2260823002: Use ARMv8 CRC32 instructions for SkOpts::hash(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gyp/opts.gypi ('k') | src/opts/SkChecksum_opts.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCpu.h" 8 #include "SkCpu.h"
9 #include "SkHalf.h" 9 #include "SkHalf.h"
10 #include "SkOnce.h" 10 #include "SkOnce.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 DEFINE_DEFAULT(hash_fn); 75 DEFINE_DEFAULT(hash_fn);
76 #undef DEFINE_DEFAULT 76 #undef DEFINE_DEFAULT
77 77
78 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp. 78 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp.
79 void Init_ssse3(); 79 void Init_ssse3();
80 void Init_sse41(); 80 void Init_sse41();
81 void Init_sse42(); 81 void Init_sse42();
82 void Init_avx(); 82 void Init_avx();
83 void Init_avx2() {} 83 void Init_avx2() {}
84 void Init_crc32();
84 85
85 static void init() { 86 static void init() {
86 #if defined(SK_CPU_X86) && !defined(SK_BUILD_NO_OPTS) 87 #if !defined(SK_BUILD_NO_OPTS)
88 #if defined(SK_CPU_X86)
87 if (SkCpu::Supports(SkCpu::SSSE3)) { Init_ssse3(); } 89 if (SkCpu::Supports(SkCpu::SSSE3)) { Init_ssse3(); }
88 if (SkCpu::Supports(SkCpu::SSE41)) { Init_sse41(); } 90 if (SkCpu::Supports(SkCpu::SSE41)) { Init_sse41(); }
89 if (SkCpu::Supports(SkCpu::SSE42)) { Init_sse42(); } 91 if (SkCpu::Supports(SkCpu::SSE42)) { Init_sse42(); }
90 if (SkCpu::Supports(SkCpu::AVX )) { Init_avx(); } 92 if (SkCpu::Supports(SkCpu::AVX )) { Init_avx(); }
91 if (SkCpu::Supports(SkCpu::AVX2 )) { Init_avx2(); } 93 if (SkCpu::Supports(SkCpu::AVX2 )) { Init_avx2(); }
94
95 #elif defined(SK_CPU_ARM64)
96 if (SkCpu::Supports(SkCpu::CRC32)) { Init_crc32(); }
97
92 #endif 98 #endif
99 #endif
93 } 100 }
94 101
95 void Init() { 102 void Init() {
96 static SkOnce once; 103 static SkOnce once;
97 once(init); 104 once(init);
98 } 105 }
99 } // namespace SkOpts 106 } // namespace SkOpts
OLDNEW
« no previous file with comments | « gyp/opts.gypi ('k') | src/opts/SkChecksum_opts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698