aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/jumper/SkJumper.cpp
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-08-03 22:12:32 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-04 05:19:38 +0000
commit5910ed347a638ded8cd4c06dbfda086695df1112 (patch)
treec17a722b06451d269cd4a867e1959998bcfa718d /src/jumper/SkJumper.cpp
parent0e914eb7259557a74b15f8a433df287ef4e5a077 (diff)
15-bit lowp is dead, long live 8-bit lowp
Change-Id: Icc4b06094aeba3af99b534746f66286d776ef78a Reviewed-on: https://skia-review.googlesource.com/30920 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/jumper/SkJumper.cpp')
-rw-r--r--src/jumper/SkJumper.cpp107
1 files changed, 29 insertions, 78 deletions
diff --git a/src/jumper/SkJumper.cpp b/src/jumper/SkJumper.cpp
index 84cdc20f68..20fbce5625 100644
--- a/src/jumper/SkJumper.cpp
+++ b/src/jumper/SkJumper.cpp
@@ -69,7 +69,7 @@ using StartPipelineFn = void(size_t,size_t,size_t,size_t, void**,K*);
#define ASM(name, suffix) _sk_##name##_##suffix
#endif
-// Some stages have low-precision (~15 bit) versions from SkJumper_stages_lowp.cpp.
+// Some stages have 8-bit versions from SkJumper_stages_8bit.cpp.
#define LOWP_STAGES(M) \
M(black_color) M(white_color) M(uniform_color) \
M(set_rgb) \
@@ -124,8 +124,6 @@ extern "C" {
ASM(start_pipeline,avx ),
ASM(start_pipeline,sse41 ),
ASM(start_pipeline,sse2 ),
- ASM(start_pipeline,hsw_lowp ),
- ASM(start_pipeline,ssse3_lowp),
ASM(start_pipeline,hsw_8bit ),
ASM(start_pipeline,sse41_8bit),
ASM(start_pipeline,sse2_8bit );
@@ -134,8 +132,6 @@ extern "C" {
ASM(just_return,avx),
ASM(just_return,sse41),
ASM(just_return,sse2),
- ASM(just_return,hsw_lowp ),
- ASM(just_return,ssse3_lowp),
ASM(just_return,hsw_8bit ),
ASM(just_return,sse41_8bit),
ASM(just_return,sse2_8bit );
@@ -153,12 +149,6 @@ extern "C" {
SK_RASTER_PIPELINE_STAGES(M)
#undef M
- #define M(st) StageFn ASM(st,hsw_lowp);
- LOWP_STAGES(M)
- #undef M
- #define M(st) StageFn ASM(st,ssse3_lowp);
- LOWP_STAGES(M)
- #undef M
#define M(st) StageFn ASM(st,hsw_8bit);
LOWP_STAGES(M)
#undef M
@@ -188,44 +178,26 @@ extern "C" {
#if !__has_feature(memory_sanitizer) && (defined(__x86_64__) || defined(_M_X64))
template <SkRasterPipeline::StockStage st>
- static constexpr StageFn* hsw_lowp() { return nullptr; }
+ static constexpr StageFn* hsw_8bit() { return nullptr; }
+
+ template <SkRasterPipeline::StockStage st>
+ static constexpr StageFn* sse41_8bit() { return nullptr; }
template <SkRasterPipeline::StockStage st>
- static constexpr StageFn* ssse3_lowp() { return nullptr; }
+ static constexpr StageFn* sse2_8bit() { return nullptr; }
#define M(st) \
- template <> constexpr StageFn* hsw_lowp<SkRasterPipeline::st>() { \
- return ASM(st,hsw_lowp); \
+ template <> constexpr StageFn* hsw_8bit<SkRasterPipeline::st>() { \
+ return ASM(st,hsw_8bit); \
} \
- template <> constexpr StageFn* ssse3_lowp<SkRasterPipeline::st>() { \
- return ASM(st,ssse3_lowp); \
+ template <> constexpr StageFn* sse41_8bit<SkRasterPipeline::st>() { \
+ return ASM(st,sse41_8bit); \
+ } \
+ template <> constexpr StageFn* sse2_8bit<SkRasterPipeline::st>() { \
+ return ASM(st,sse2_8bit); \
}
LOWP_STAGES(M)
#undef M
-
- #if !defined(SK_JUMPER_LEGACY_LOWP)
- template <SkRasterPipeline::StockStage st>
- static constexpr StageFn* hsw_8bit() { return nullptr; }
-
- template <SkRasterPipeline::StockStage st>
- static constexpr StageFn* sse41_8bit() { return nullptr; }
-
- template <SkRasterPipeline::StockStage st>
- static constexpr StageFn* sse2_8bit() { return nullptr; }
-
- #define M(st) \
- template <> constexpr StageFn* hsw_8bit<SkRasterPipeline::st>() { \
- return ASM(st,hsw_8bit); \
- } \
- template <> constexpr StageFn* sse41_8bit<SkRasterPipeline::st>() { \
- return ASM(st,sse41_8bit); \
- } \
- template <> constexpr StageFn* sse2_8bit<SkRasterPipeline::st>() { \
- return ASM(st,sse2_8bit); \
- }
- LOWP_STAGES(M)
- #undef M
- #endif
#endif
// Engines comprise everything we need to run SkRasterPipelines.
@@ -336,51 +308,30 @@ static SkJumper_Engine choose_engine() {
static SkJumper_Engine choose_lowp() {
#if !__has_feature(memory_sanitizer) && (defined(__x86_64__) || defined(_M_X64))
- #if !defined(SK_JUMPER_LEGACY_LOWP)
- if (1 && SkCpu::Supports(SkCpu::HSW)) {
- return {
- #define M(st) hsw_8bit<SkRasterPipeline::st>(),
- { SK_RASTER_PIPELINE_STAGES(M) },
- ASM(start_pipeline,hsw_8bit),
- ASM(just_return ,hsw_8bit)
- #undef M
- };
- }
- if (1 && SkCpu::Supports(SkCpu::SSE41)) {
- return {
- #define M(st) sse41_8bit<SkRasterPipeline::st>(),
- { SK_RASTER_PIPELINE_STAGES(M) },
- ASM(start_pipeline,sse41_8bit),
- ASM(just_return ,sse41_8bit)
- #undef M
- };
- }
- if (1 && SkCpu::Supports(SkCpu::SSE2)) {
- return {
- #define M(st) sse2_8bit<SkRasterPipeline::st>(),
- { SK_RASTER_PIPELINE_STAGES(M) },
- ASM(start_pipeline,sse2_8bit),
- ASM(just_return ,sse2_8bit)
- #undef M
- };
- }
- #endif
-
if (1 && SkCpu::Supports(SkCpu::HSW)) {
return {
- #define M(st) hsw_lowp<SkRasterPipeline::st>(),
+ #define M(st) hsw_8bit<SkRasterPipeline::st>(),
+ { SK_RASTER_PIPELINE_STAGES(M) },
+ ASM(start_pipeline,hsw_8bit),
+ ASM(just_return ,hsw_8bit)
+ #undef M
+ };
+ }
+ if (1 && SkCpu::Supports(SkCpu::SSE41)) {
+ return {
+ #define M(st) sse41_8bit<SkRasterPipeline::st>(),
{ SK_RASTER_PIPELINE_STAGES(M) },
- ASM(start_pipeline,hsw_lowp),
- ASM(just_return ,hsw_lowp)
+ ASM(start_pipeline,sse41_8bit),
+ ASM(just_return ,sse41_8bit)
#undef M
};
}
- if (1 && SkCpu::Supports(SkCpu::SSSE3)) {
+ if (1 && SkCpu::Supports(SkCpu::SSE2)) {
return {
- #define M(st) ssse3_lowp<SkRasterPipeline::st>(),
+ #define M(st) sse2_8bit<SkRasterPipeline::st>(),
{ SK_RASTER_PIPELINE_STAGES(M) },
- ASM(start_pipeline,ssse3_lowp),
- ASM(just_return ,ssse3_lowp)
+ ASM(start_pipeline,sse2_8bit),
+ ASM(just_return ,sse2_8bit)
#undef M
};
}