aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-01-10 09:24:56 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-10 16:25:10 +0000
commitc0a7a0835905e02ba234ddc4bc2229e7806ba0ef (patch)
tree14abe880a75fa7460f10904ff492d5daf3d8ac15 /bench
parente2609594466336305bedfa61f98510d127a8ec85 (diff)
remove xbyak experiment
SkSplicer is better. CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: I014ec0e9fb00a8a4694d442e672c65402621dc67 Reviewed-on: https://skia-review.googlesource.com/6830 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'bench')
-rw-r--r--bench/SkXbyakBench.cpp79
1 files changed, 0 insertions, 79 deletions
diff --git a/bench/SkXbyakBench.cpp b/bench/SkXbyakBench.cpp
deleted file mode 100644
index 98f795d9f8..0000000000
--- a/bench/SkXbyakBench.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2017 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "Benchmark.h"
-#include "SkHalf.h"
-#include "SkNx.h"
-#include "SkRasterPipeline.h"
-
-static void hand_written(uint64_t* buf, int n) {
- while (n --> 0) {
- Sk4f rgba = SkHalfToFloat_finite_ftz(*buf);
-
- float a = rgba[3],
- scale = a == 0 ? 1 : 1.0f/a;
- rgba *= Sk4f{scale,scale,scale,1};
-
- SkFloatToHalf_finite_ftz(rgba).store(buf++);
- }
-}
-
-class SkXbyakBench : public Benchmark {
-public:
- enum Mode { kHandWritten, kInterpreted, kJITCompiled };
-
- SkXbyakBench(Mode mode) : fMode(mode) {
- memset(fBuf, 0, sizeof(fBuf));
- if (mode == kInterpreted || mode == kJITCompiled) {
- fPtr = &fBuf;
- fP.append(SkRasterPipeline::load_f16, &fPtr);
- fP.append(SkRasterPipeline::unpremul);
- fP.append(SkRasterPipeline::store_f16, &fPtr);
- }
-
- if (mode == kJITCompiled) {
- fFn = fP.compile();
- }
- }
- bool isSuitableFor(Backend backend) override { return backend == kNonRendering_Backend; }
-
- const char* onGetName() override {
- switch(fMode) {
- case kHandWritten: return "SkXbyak_HandWritten";
- case kInterpreted: return "SkXbyak_Interpreted";
- case kJITCompiled: return "SkXbyak_JITCompiled";
- }
- return "";
- }
-
- void onDraw(int loops, SkCanvas*) override {
- switch (fMode) {
- case kHandWritten:
- while (loops --> 0) { hand_written(fBuf, N); }
- break;
- case kInterpreted:
- while (loops --> 0) { fP.run(0,0,N); }
- break;
- case kJITCompiled:
- while (loops --> 0) { fFn(0,0,N); }
- break;
- }
- }
-
-private:
- static const int N = 1024; // TODO: 1023, making the tail jagged
-
- SkRasterPipeline fP;
- Mode fMode;
- uint64_t fBuf[N];
- void* fPtr;
- std::function<void(size_t, size_t, size_t)> fFn;
-};
-
-DEF_BENCH( return new SkXbyakBench(SkXbyakBench::kHandWritten); )
-DEF_BENCH( return new SkXbyakBench(SkXbyakBench::kInterpreted); )
-DEF_BENCH( return new SkXbyakBench(SkXbyakBench::kJITCompiled); )