aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-01-10 14:41:19 -0500
committerGravatar Mike Klein <mtklein@chromium.org>2017-01-10 20:06:28 +0000
commitfdb124adfcb9cacf9eea50f6f554b2a955bbacc6 (patch)
tree854b8a6d4b51e3e1998e1a7d3544870714db9d2f /src
parentc7adce1193a005a71aa4f181dc098f75c24910d4 (diff)
SkSplicer: no need to set_k() manually.
set_k() is simulating the effect of loading a pointer constant into the register used to pass the 4th function argument. An easier way to do this is to pass that pointer constant as the 4th function argument... duh. Change-Id: I5604d6bbadd86eaaa82f8c4391080f6489b1927f Reviewed-on: https://skia-review.googlesource.com/6843 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/splicer/SkSplicer.cpp20
-rw-r--r--src/splicer/SkSplicer_stages.cpp2
2 files changed, 3 insertions, 19 deletions
diff --git a/src/splicer/SkSplicer.cpp b/src/splicer/SkSplicer.cpp
index 9fcb99c0fb..f1a8c8930c 100644
--- a/src/splicer/SkSplicer.cpp
+++ b/src/splicer/SkSplicer.cpp
@@ -43,14 +43,6 @@ namespace {
#if defined(__aarch64__)
static constexpr int kStride = 4;
- static void set_k(SkWStream* buf, const SkSplicer_constants* k) {
- uint16_t parts[4];
- memcpy(parts, &k, 8);
- splice(buf, 0xd2f00000 | (parts[3] << 5) | 0x3); // move 16-bit intermediate << 48 into x3
- splice(buf, 0xf2c00000 | (parts[2] << 5) | 0x3); // merge 16-bit intermediate << 32 into x3
- splice(buf, 0xf2a00000 | (parts[1] << 5) | 0x3); // merge 16-bit intermediate << 16 into x3
- splice(buf, 0xf2800000 | (parts[0] << 5) | 0x3); // merge 16-bit intermediate << 0 into x3
- }
static void set_ctx(SkWStream* buf, void* ctx) {
uint16_t parts[4];
memcpy(parts, &ctx, 8);
@@ -72,11 +64,6 @@ namespace {
}
#else
static constexpr int kStride = 8;
- static void set_k(SkWStream* buf, const SkSplicer_constants* k) {
- static const uint8_t movabsq_rcx[] = { 0x48, 0xb9 };
- splice(buf, movabsq_rcx); // movabsq <next 8 bytes>, %rcx
- splice(buf, k);
- }
static void set_ctx(SkWStream* buf, void* ctx) {
static const uint8_t movabsq_rdx[] = { 0x48, 0xba };
splice(buf, movabsq_rdx); // movabsq <next 8 bytes>, %rdx
@@ -156,9 +143,6 @@ namespace {
SkDynamicMemoryWStream buf;
- // Put the address of kConstants in rcx/x3, Stage argument 4 "k".
- set_k(&buf, &kConstants);
-
// Our loop is the equivalent of this C++ code:
// do {
// ... run spliced stages...
@@ -229,8 +213,8 @@ namespace {
size_t body = n/kStride*kStride; // Largest multiple of kStride (4 or 8) <= n.
if (fSpliced && body) { // Can we run fSpliced for at least one kStride?
// TODO: At some point we will want to pass in y...
- using Fn = void(size_t x, size_t limit);
- ((Fn*)fSpliced)(x, x+body);
+ using Fn = void(size_t x, size_t limit, void* ctx, const SkSplicer_constants* k);
+ ((Fn*)fSpliced)(x, x+body, nullptr, &kConstants);
// Fall through to fBackup for any n<kStride last pixels.
x += body;
diff --git a/src/splicer/SkSplicer_stages.cpp b/src/splicer/SkSplicer_stages.cpp
index af8bce9cb2..e3a19ea5a8 100644
--- a/src/splicer/SkSplicer_stages.cpp
+++ b/src/splicer/SkSplicer_stages.cpp
@@ -69,7 +69,7 @@ using Stage = void(size_t x, size_t limit, void* ctx, K* k, F,F,F,F, F,F,F,F);
// x: rdi/x0 x and limit work to drive the loop, see loop_start in SkSplicer.cpp.
// limit: rsi/x1
// ctx: rdx/x2 Look for set_ctx in SkSplicer.cpp to see how this works.
-// k: rcx/x3 Look for set_k in SkSplicer.cpp to see how this works.
+// k: rcx/x3
// vectors: ymm0-ymm7/v0-v7