Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Issue 1884683002: SkFloatConvert (Closed)

Created:
4 years, 8 months ago by mtklein_C
Modified:
4 years, 8 months ago
Reviewers:
herb_g, f(malita), reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

SkFloatConvert This is SkFloatToHalf and SkHalfToFloat plus a little bit of state to know whether we have fast f16<->f32 instructions at runtime. On my laptop with f16c instructions, xferu64_srcover_bw_N_alpha_f16 runtime drops from 1.99ms to 1.09ms. Here's the new disassembly: +0x90 movups (%rdx), %xmm1 +0x93 movq (%rsi), %xmm2 +0x97 vcvtph2ps %xmm2, %xmm2 +0x9c movaps %xmm1, %xmm3 +0x9f shufps $255, %xmm3, %xmm3 +0xa3 movaps %xmm0, %xmm4 +0xa6 subps %xmm3, %xmm4 +0xa9 mulps %xmm2, %xmm4 +0xac addps %xmm1, %xmm4 +0xaf vcvtps2ph $0, %xmm4, %xmm4 +0xb5 movq %xmm4, (%rsi) +0xb9 addq $16, %rdx +0xbd addq $8, %rsi +0xc1 decl %ecx +0xc3 jne +0x90 BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1884683002

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -0 lines) Patch
M src/core/SkHalf.h View 2 chunks +32 lines, -0 lines 0 comments Download
M src/core/SkOpts.h View 1 chunk +2 lines, -0 lines 1 comment Download
M src/core/SkOpts.cpp View 2 chunks +6 lines, -0 lines 0 comments Download
M src/core/SkXfermodeU64.cpp View 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (6 generated)
herb_g
I like this a lot. Can we do this with other features like floor(round)?
4 years, 8 months ago (2016-04-12 18:27:03 UTC) #5
mtklein
On 2016/04/12 at 18:27:03, herb wrote: > I like this a lot. Can we do ...
4 years, 8 months ago (2016-04-12 18:34:34 UTC) #6
reed1
api lgtm https://codereview.chromium.org/1884683002/diff/1/src/core/SkOpts.h File src/core/SkOpts.h (right): https://codereview.chromium.org/1884683002/diff/1/src/core/SkOpts.h#newcode24 src/core/SkOpts.h:24: extern bool has_f16c; nit: gHas_f16c -- just ...
4 years, 8 months ago (2016-04-12 18:47:26 UTC) #8
reed1
awesome speedup!
4 years, 8 months ago (2016-04-12 18:47:54 UTC) #10
f(malita)
4 years, 8 months ago (2016-04-12 22:51:52 UTC) #11
LGTM!

On 2016/04/12 18:34:34, mtklein wrote:
> vcvtps2ph

They must be face-rolling on the keyboard for mnemonics these days.

Powered by Google App Engine
This is Rietveld 408576698