From 5910ed347a638ded8cd4c06dbfda086695df1112 Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Thu, 3 Aug 2017 22:12:32 -0400 Subject: 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 Commit-Queue: Mike Klein --- src/jumper/SkJumper.cpp | 107 +++++++++++++----------------------------------- 1 file changed, 29 insertions(+), 78 deletions(-) (limited to 'src/jumper/SkJumper.cpp') 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 - static constexpr StageFn* hsw_lowp() { return nullptr; } + static constexpr StageFn* hsw_8bit() { return nullptr; } + + template + static constexpr StageFn* sse41_8bit() { return nullptr; } template - static constexpr StageFn* ssse3_lowp() { return nullptr; } + static constexpr StageFn* sse2_8bit() { return nullptr; } #define M(st) \ - template <> constexpr StageFn* hsw_lowp() { \ - return ASM(st,hsw_lowp); \ + template <> constexpr StageFn* hsw_8bit() { \ + return ASM(st,hsw_8bit); \ } \ - template <> constexpr StageFn* ssse3_lowp() { \ - return ASM(st,ssse3_lowp); \ + template <> constexpr StageFn* sse41_8bit() { \ + return ASM(st,sse41_8bit); \ + } \ + template <> constexpr StageFn* sse2_8bit() { \ + return ASM(st,sse2_8bit); \ } LOWP_STAGES(M) #undef M - - #if !defined(SK_JUMPER_LEGACY_LOWP) - template - static constexpr StageFn* hsw_8bit() { return nullptr; } - - template - static constexpr StageFn* sse41_8bit() { return nullptr; } - - template - static constexpr StageFn* sse2_8bit() { return nullptr; } - - #define M(st) \ - template <> constexpr StageFn* hsw_8bit() { \ - return ASM(st,hsw_8bit); \ - } \ - template <> constexpr StageFn* sse41_8bit() { \ - return ASM(st,sse41_8bit); \ - } \ - template <> constexpr StageFn* sse2_8bit() { \ - 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(), - { 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(), - { 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(), - { 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(), + #define M(st) hsw_8bit(), + { 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(), { 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(), + #define M(st) sse2_8bit(), { 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 }; } -- cgit v1.2.3