skcpu: sse4.1 floor, f16c f16<->f32
authormtklein <mtklein@chromium.org>
Tue, 19 Apr 2016 21:21:30 +0000 (14:21 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 19 Apr 2016 21:21:30 +0000 (14:21 -0700)
commit244a65350e52c9438931ecdc05a4913f29d343bc
tree365112cb2ee18cac57ddc23b7be6df57ae76d846
parent51dece33e8b9e3914b0b90086f4b2e97c17333dd
skcpu: sse4.1 floor, f16c f16<->f32

  -  floor with roundps is about 4.5x faster when available
  -  f16 srcover_n is similar to but a little faster than the version in https://codereview.chromium.org/1884683002.  This new one fuses the dst load/stores into the f16<->f32 conversions:

+0x180     movups              (%r15), %xmm1
+0x184     vcvtph2ps           (%rbx), %xmm2
+0x189     movaps              %xmm1, %xmm3
+0x18c     shufps              $255, %xmm3, %xmm3
+0x190     movaps              %xmm0, %xmm4
+0x193     subps               %xmm3, %xmm4
+0x196     mulps               %xmm2, %xmm4
+0x199     addps               %xmm1, %xmm4
+0x19c     vcvtps2ph           $0, %xmm4, (%rbx)
+0x1a2     addq                $16, %r15
+0x1a6     addq                $8, %rbx
+0x1aa     decl                %r14d
+0x1ad     jne                 +0x180

If we decide to land this it'd be a good idea to convert most or all users of SkFloatToHalf_01 and SkHalfToFloat_01 over to the pointer-based versions.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1891513002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Committed: https://skia.googlesource.com/skia/+/cbe3c1af987d622ea67ef560d855b41bb14a0ce9

Committed: https://skia.googlesource.com/skia/+/3faf74b8364491ca806f523fbb1d8a97be592663

Review URL: https://codereview.chromium.org/1891513002
src/core/SkHalf.h
src/core/SkXfermodeF16.cpp
src/opts/SkNx_sse.h