skia2/include/private
Mike Klein 4985db413d update skvx scalar-fallback strategy
Turns out Clang's a lot better at auto-vectorizing "obvious" scalar code
into obvious vector code when it's written out the long way, e.g.

     F32x4 x = ...;
     x = { sqrtf(x[0]), sqrtf(x[1]), sqrtf(x[2]), sqrtf(x[3]) };

vectorizes into sqrtps a lot more reliably than our recurse-onto-scalars
strategy, and also better than the other naive approach,

     F32x4 x = ...;
     for (int i = 0; i < 4; i++) { x[i] = sqrtf(x[i]); }

So here I've added a map(V, fn) -> V' using C++14 tricks to let the
compiler handle the expansion of x = { fn(x[0]), fn(x[1]), ...
fn(x[N-1]) } for any N, and implemented most skvx scalar fallback code
using that.

With these now vectorizing well at any N, we can remove any
specializations we'd written for particular N, really tidying up.

Over in the SkVM interpreter, this is a big improvement for ceil and
floor, which were being done 2 floats at a time instead of 8.  They're
now slimmed way down to

   shlq       $6, %r13
   vroundps   $K, (%r12,%r13), %ymm0
   vroundps   $K, 32(%r12,%r13), %ymm1
   jmp        ...

where K is 9 or 10 depending on the op.

I haven't found a scalar function that Clang will vectorize to vcvtps2pd
(the rounding one, not truncating vcvttps2pd), so I've kept lrint()
written the long way, updated to the style I've been using lately with
specializations inline.

Change-Id: Ia97abe3c876008228bf62b1daacd6f6140408fc4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317375
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-09-16 20:37:18 +00:00
..
GrContext_Base.h Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00
GrD3DTypesPriv.h More fixes to get D3D tests running. 2020-04-10 15:19:18 +00:00
GrGLTypesPriv.h Remove use of texture swizzle in GL backend. 2020-08-28 15:22:29 +00:00
GrImageContext.h Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00
GrResourceKey.h Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00
GrSharedEnums.h Remove HairlineAA from the clip-edge types. 2020-06-17 17:43:35 +00:00
GrSingleOwner.h Pass file and line number when asserting single owner 2020-06-01 17:10:40 +00:00
GrTypesPriv.h Add input attachment support to program building. 2020-09-14 19:59:47 +00:00
GrVkTypesPriv.h Add GrContext API to allow updating GrBackendSurfaceMutableState. 2020-06-10 13:15:55 +00:00
SkBitmaskEnum.h Fix modifier key handling in OS X to allow command-keys to work. 2020-07-01 16:07:03 +00:00
SkChecksum.h Revert "Revert "gms for SkParagraph"" 2020-06-02 19:26:04 +00:00
SkColorData.h Reland "Simplify GrRTC::clean APIs" 2020-05-27 14:26:16 +00:00
SkDeque.h Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00
SkEncodedInfo.h Enable ClangTidy check readability-redundant-smartptr-get. 2020-08-16 15:56:48 +00:00
SkFixed.h Remove gendered language 2020-07-28 15:02:41 +00:00
SkFloatBits.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkFloatingPoint.h Move GrWangsFormula::nextlog2 to sk_float_nextlog2 2020-08-19 23:45:12 +00:00
SkHalf.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkIDChangeListener.h Revert "Use spin lock in SkIDChangeListener" 2020-03-04 03:40:11 +00:00
SkImageInfoPriv.h Wsign-conversion for public headers 2020-06-02 12:34:54 +00:00
SkMacros.h Remove SK_REQUIRE_LOCAL_VAR macro. 2020-07-31 02:32:01 +00:00
SkMalloc.h [fuzz] Standardize, document, and backport fuzzing defines. 2020-09-14 13:36:10 +00:00
SkMutex.h Remove SK_REQUIRE_LOCAL_VAR macro. 2020-07-31 02:32:01 +00:00
SkNoncopyable.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkNx_neon.h Remove SkTMin and SkTMax 2020-02-07 18:40:09 +00:00
SkNx_sse.h update SkNx allTrue/anyTrue 2020-09-02 17:11:45 +00:00
SkNx.h Remove SkTMin and SkTMax 2020-02-07 18:40:09 +00:00
SkOnce.h experimental support for go/fibers 2019-10-28 16:48:55 +00:00
SkOpts_spi.h Enable ClangTidy check llvm-namespace-comment. 2020-08-06 19:07:52 +00:00
SkPathRef.h Move convexity enum out of public 2020-08-30 13:04:22 +00:00
SkSafe32.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkSafe_math.h Guard against buggy ucrt\math.h. 2016-11-28 15:40:23 +00:00
SkSemaphore.h Reland "Cache hb_face." 2020-05-19 17:42:14 +00:00
SkShadowFlags.h Remove deprecated drawShadow interfaces 2018-02-28 19:07:29 +00:00
SkSLSampleUsage.h Enable ClangTidy check llvm-namespace-comment. 2020-08-06 19:07:52 +00:00
SkSpinlock.h Add thread safety annotations. 2019-05-10 13:40:38 +00:00
SkTArray.h Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00
SkTDArray.h Add arc methods to path builder 2020-08-03 15:50:01 +00:00
SkTemplates.h constify GrAtlasTextOp::Geometry 2020-07-21 16:56:27 +00:00
SkTFitsIn.h Add support for MSVC run-time checks (and control flow guard) 2019-02-04 20:55:24 +00:00
SkTHash.h remove unused mutate() apis 2020-03-16 20:44:36 +00:00
SkThreadAnnotations.h Add a condition to prevent a thread annotation meant for blaze from showing up to emscripten 2020-02-28 17:57:20 +00:00
SkThreadID.h Mark SkGetThreadID SK_SPI in debug. 2020-07-07 21:50:55 +00:00
SkTLogic.h update skstd 2020-04-30 15:05:43 +00:00
SkTo.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
SkVx.h update skvx scalar-fallback strategy 2020-09-16 20:37:18 +00:00
SkWeakRefCnt.h Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00