DescriptionSkPMFloat: avoid loads and stores where possible.
A store/load pair like this is a redundant no-op:
store simd_register_a, memory_address
load memory_address, simd_register_a
Everyone seems to be good at removing those when using SSE, but GCC and Clang
are pretty terrible at this for NEON. We end up issuing both redundant
commands, usually to and from the stack. That's slow. Let's not do that.
This CL unions in the native SIMD register type into SkPMFloat, so that we can
assign to and from it directly, which is generating a lot better NEON code. On
my Nexus 5, the benchmarks improve from 36ns to 23ns.
SSE is just as fast either way, but I paralleled the NEON code for consistency.
It's a little terser. And because it needed the platform headers anyway, I
moved all includes into SkPMFloat.h, again only for consistency.
I'd union in Sk4f too to make its conversion methods a little clearer,
but MSVC won't let me (it has a copy constructor... they're apparently not up
to speed with C++11 unrestricted unions).
BUG=skia:
Committed: https://skia.googlesource.com/skia/+/f94fa7112f67af6fc5db19f86d8397307ba17105
Patch Set 1 #
Messages
Total messages: 15 (5 generated)
|