From 07344a5386b70f682b16b40bc6eb83acf76d6921 Mon Sep 17 00:00:00 2001 From: mtklein Date: Mon, 14 Sep 2015 13:14:31 -0700 Subject: Revert of SkPx: new approach to fixed-point SIMD (patchset #9 id:160001 of https://codereview.chromium.org/1317233005/ ) Reason for revert: http://build.chromium.org/p/client.skia.compile/builders/Build-Mac10.8-Clang-Arm7-Debug-Android/builds/4627 Original issue's description: > SkPx: new approach to fixed-point SIMD > > SkPx is like Sk4px, except each platform implementation of SkPx can declare > a different sweet spot of N pixels, with extra loads and stores to handle the > ragged edge of 0 > In this case, _sse's sweet spot remains 4 pixels. _neon jumps up to 8 so > we can now use NEON's transposing loads and stores, and _none is just 1. > This makes operations involving alpha considerably more efficient on NEON, > as alpha is its own distinct 8x8 bit plane that's easy to toss around. > > This incorporates a few other improvements I've been wanting: > - no requirement that we're dealing with SkPMColor. SkColor works too. > - no anonymous namespace hack to differentiate implementations. > > Codegen and perf look good on Clang/x86-64 and GCC/ARMv7. > The NEON code looks very similar to the old NEON code, as intended. > No .skp or GM diffs on my laptop. Don't expect any. > > I intend this to replace Sk4px. Plan after landing: > - port SkXfermode_opts.h > - port Color32 in SkBlitRow_D32.cpp (and move to SkBlitRow_opts.h like other > SkOpts code) > - delete all Sk4px-related code > - clean up evolutionary dead ends in SkNx (Sk16b, Sk16h, Sk4i, Sk4d, etc.) > leaving Sk2f, Sk4f (and Sk2s, Sk4s). > - find a machine with AVX2 to work on, write SkPx_avx2.h handling 8 pixels > at a time. > > In the end we'll have Sk4f for float pixels, SkPx for fixed-point pixels. > > BUG=skia:4117 > > Committed: https://skia.googlesource.com/skia/+/82c93b45ed6ac0b628adb8375389c202d1f586f9 TBR=mtklein@google.com,msarett@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4117 Review URL: https://codereview.chromium.org/1336423002 --- src/core/SkPx.h | 89 --------------------------------------------------------- 1 file changed, 89 deletions(-) delete mode 100644 src/core/SkPx.h (limited to 'src/core') diff --git a/src/core/SkPx.h b/src/core/SkPx.h deleted file mode 100644 index a4b1978e63..0000000000 --- a/src/core/SkPx.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2015 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef SkPx_DEFINED -#define SkPx_DEFINED - -#include "SkTypes.h" -#include "SkColorPriv.h" - -// We'll include one of src/opts/SkPx_{sse,neon,none}.h to define a type SkPx. -// -// SkPx represents up to SkPx::N 8888 pixels. It's agnostic to whether these -// are SkColors or SkPMColors; it only assumes that alpha is the high byte. -static_assert(SK_A32_SHIFT == 24, "For both SkColor and SkPMColor, alpha is always the high byte."); -// -// SkPx::Alpha represents up to SkPx::N 8-bit values, usually coverage or alpha. -// SkPx::Wide represents up to SkPx::N pixels with 16 bits per component. -// -// SkPx supports the following methods: -// static SkPx Dup(uint32_t); -// static SkPx LoadN(const uint32_t*); -// static SkPx Load(int n, const uint32_t*); // where 0 a -// Wide widenLo() const; // argb -> 0a0r0g0b -// Wide widenHi() const; // argb -> a0r0g0b0 -// Wide widenLoHi() const; // argb -> aarrggbb -// -// SkPx operator+(const SkPx&) const; -// SkPx operator-(const SkPx&) const; -// SkPx saturatedAdd(const SkPx&) const; -// -// Wide operator*(const Alpha&) const; // argb * A -> (a*A)(r*A)(g*A)(b*A) -// -// // Fast approximate (px*a+127)/255. -// // Never off by more than 1, and always correct when px or a is 0 or 255. -// // We use the approximation (px*a+px)/256. -// SkPx approxMulDiv255(const Alpha&) const; -// -// SkPx addAlpha(const Alpha&) const; // argb + A -> (a+A)rgb -// -// SkPx::Alpha supports the following methods: -// static Alpha Dup(uint8_t); -// static Alpha LoadN(const uint8_t*); -// static Alpha Load(int n, const uint8_t*); // where 0 255-a -// -// SkPx::Wide supports the following methods: -// Wide operator+(const Wide&); -// Wide operator-(const Wide&); -// Wide operator<<(int bits); -// Wide operator>>(int bits); -// -// // Return the high byte of each component of (*this + o.widenLo()). -// SkPx addNarrowHi(const SkPx& o); -// -// Methods left unwritten, but certainly to come: -// SkPx SkPx::operator<(const SkPx&) const; -// SkPx SkPx::thenElse(const SkPx& then, const SkPx& else) const; -// Wide Wide::operator<(const Wide&) const; -// Wide Wide::thenElse(const Wide& then, const Wide& else) const; -// -// SkPx Wide::div255() const; // Rounds, think (*this + 127) / 255. -// -// The different implementations of SkPx have complete freedom to choose -// SkPx::N and how they represent SkPx, SkPx::Alpha, and SkPx::Wide. -// -// All observable math must remain identical. - -#if defined(SKNX_NO_SIMD) - #include "../opts/SkPx_none.h" -#else - #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 - #include "../opts/SkPx_sse.h" - #elif defined(SK_ARM_HAS_NEON) - #include "../opts/SkPx_neon.h" - #else - #include "../opts/SkPx_none.h" - #endif -#endif - -#endif//SkPx_DEFINED -- cgit v1.2.3