aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-02-22 14:04:38 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-22 20:04:32 +0000
commit91ad074312b1439cc102179e0c9c1daec16aa21d (patch)
tree07abf036da6e4f0bfff13ba6548ebf9d51009f9e /src
parentd9e82256e8591e7da1e2afde1e4c6c49c48ddc96 (diff)
SkJumper: add mode to help prioritize porting
Change-Id: I57c9fa4ce3ef70ddd8a98b0a5843d1f5108fe6e8 Reviewed-on: https://skia-review.googlesource.com/8857 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/jumper/SkJumper.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/jumper/SkJumper.cpp b/src/jumper/SkJumper.cpp
index cdcbb891f0..18a5f0275f 100644
--- a/src/jumper/SkJumper.cpp
+++ b/src/jumper/SkJumper.cpp
@@ -7,8 +7,23 @@
#include "SkCpu.h"
#include "SkJumper.h"
+#include "SkOnce.h"
#include "SkRasterPipeline.h"
#include "SkTemplates.h"
+#include <atomic>
+
+// A debugging mode that helps prioritize porting stages to SkJumper.
+#if 0
+ #define M(st) {0},
+ static std::atomic<int> gMissing[] = { SK_RASTER_PIPELINE_STAGES(M) };
+ #undef M
+
+ #define M(st) #st,
+ static const char* gNames[] = { SK_RASTER_PIPELINE_STAGES(M) };
+ #undef M
+
+ #define WHATS_NEXT
+#endif
// We'll use __has_feature(memory_sanitizer) to detect MSAN.
// SkJumper_generated.S is not compiled with MSAN, so MSAN would yell really loud.
@@ -145,7 +160,11 @@ extern "C" {
#elif defined(__x86_64__) || defined(_M_X64)
static StageFn* lookup_hsw(SkRasterPipeline::StockStage st) {
switch (st) {
- default: return nullptr;
+ default:
+ #ifdef WHATS_NEXT
+ gMissing[st]++;
+ #endif
+ return nullptr;
#define M(st) case SkRasterPipeline::st: return ASM(st,hsw);
STAGES(M)
#undef M
@@ -153,7 +172,11 @@ extern "C" {
}
static StageFn* lookup_sse41(SkRasterPipeline::StockStage st) {
switch (st) {
- default: return nullptr;
+ default:
+ #ifdef WHATS_NEXT
+ gMissing[st]++;
+ #endif
+ return nullptr;
#define M(st) case SkRasterPipeline::st: return ASM(st,sse41);
STAGES(M)
#undef M
@@ -179,6 +202,17 @@ static StageFn* lookup_portable(SkRasterPipeline::StockStage st) {
}
bool SkRasterPipeline::run_with_jumper(size_t x, size_t n) const {
+#ifdef WHATS_NEXT
+ static SkOnce once;
+ once([] {
+ atexit([] {
+ for (int i = 0; i < (int)SK_ARRAY_COUNT(gMissing); i++) {
+ SkDebugf("%10d %s\n", gMissing[i].load(), gNames[i]);
+ }
+ });
+ });
+#endif
+
SkAutoSTMalloc<64, void*> program(2*fStages.size() + 1);
const size_t limit = x+n;