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

Issue 2133413002: try to speed-up maprect + round2i + contains (Closed)

Created:
4 years, 5 months ago by reed1
Modified:
4 years, 5 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

try to speed-up maprect + round2i + contains We call roundOut in a few places. If we can get SkNx::Ceil we could efficiently implement that as well. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2133413002 CQ_INCLUDE_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Committed: https://skia.googlesource.com/skia/+/b42b785d1cbc98bd34aceae338060831b974f9c5

Patch Set 1 #

Patch Set 2 : fix debug build #

Patch Set 3 : add unittest #

Patch Set 4 : rebase #

Total comments: 3

Patch Set 5 : fix prev rebase #

Total comments: 3

Patch Set 6 : un-move SkCpu.h #

Patch Set 7 : and un-move it in gyp #

Total comments: 3

Patch Set 8 : add dox #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+147 lines, -1139 lines) Patch
M bench/RectBench.cpp View 1 2 3 4 1 chunk +90 lines, -0 lines 0 comments Download
M gyp/core.gypi View 1 2 3 4 5 6 2 chunks +1 line, -1 line 0 comments Download
M gyp/tools.gyp View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M include/core/SkRect.h View 1 2 3 4 5 6 7 2 chunks +23 lines, -1 line 0 comments Download
A + include/private/SkNx.h View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
A + include/private/SkNx_neon.h View 1 2 0 chunks +-1 lines, --1 lines 0 comments Download
A + include/private/SkNx_sse.h View 1 2 0 chunks +-1 lines, --1 lines 1 comment Download
D src/core/SkNx.h View 1 2 1 chunk +0 lines, -310 lines 0 comments Download
D src/opts/SkNx_neon.h View 1 2 1 chunk +0 lines, -453 lines 0 comments Download
D src/opts/SkNx_sse.h View 1 2 3 4 5 1 chunk +0 lines, -374 lines 0 comments Download
M tests/RectTest.cpp View 1 2 1 chunk +32 lines, -0 lines 0 comments Download

Messages

Total messages: 56 (32 generated)
reed1
I can't get the Sk4i <= guy to compile :(
4 years, 5 months ago (2016-07-10 01:08:39 UTC) #5
reed1
Pretty cool: Sk4f rd = (src + Sk4f(0.5)).floor(); This generates 1 instruction on INTEL!!! roundps
4 years, 5 months ago (2016-07-10 01:19:54 UTC) #10
commit-bot: I haz the power
There were warnings when CQ was processing your CL: * CQ_EXTRA_TRYBOTS flag is deprecated and ...
4 years, 5 months ago (2016-07-10 16:01:50 UTC) #16
reed1
To inline round2i() I need to move SkNx.h (and its dependencies) into include/private ...
4 years, 5 months ago (2016-07-10 16:04:55 UTC) #17
msarett
https://codereview.chromium.org/2133413002/diff/60001/include/core/SkRect.h File include/core/SkRect.h (right): https://codereview.chromium.org/2133413002/diff/60001/include/core/SkRect.h#newcode874 include/core/SkRect.h:874: SkIRect round2i() const { On Intel this disassembles to ...
4 years, 5 months ago (2016-07-11 12:50:06 UTC) #21
reed1
On 2016/07/11 12:50:06, msarett wrote: > https://codereview.chromium.org/2133413002/diff/60001/include/core/SkRect.h > File include/core/SkRect.h (right): > > https://codereview.chromium.org/2133413002/diff/60001/include/core/SkRect.h#newcode874 > ...
4 years, 5 months ago (2016-07-11 12:54:24 UTC) #22
mtklein
https://codereview.chromium.org/2133413002/diff/60001/include/core/SkRect.h File include/core/SkRect.h (right): https://codereview.chromium.org/2133413002/diff/60001/include/core/SkRect.h#newcode876 include/core/SkRect.h:876: Sk4s rd = (Sk4s::Load(&fLeft) + Sk4s(0.5)).floor(); On 2016/07/11 12:50:06, ...
4 years, 5 months ago (2016-07-11 13:39:13 UTC) #23
reed1
On 2016/07/11 12:54:24, reed1 wrote: > On 2016/07/11 12:50:06, msarett wrote: > > https://codereview.chromium.org/2133413002/diff/60001/include/core/SkRect.h > ...
4 years, 5 months ago (2016-07-11 13:53:30 UTC) #24
commit-bot: I haz the power
There were warnings when CQ was processing your CL: * CQ_EXTRA_TRYBOTS flag is deprecated and ...
4 years, 5 months ago (2016-07-11 13:53:50 UTC) #27
reed1
ptal
4 years, 5 months ago (2016-07-11 13:54:05 UTC) #28
commit-bot: I haz the power
There were warnings when CQ was processing your CL: * CQ_EXTRA_TRYBOTS flag is deprecated and ...
4 years, 5 months ago (2016-07-11 14:00:55 UTC) #29
mtklein
https://codereview.chromium.org/2133413002/diff/80001/gyp/core.gypi File gyp/core.gypi (right): https://codereview.chromium.org/2133413002/diff/80001/gyp/core.gypi#newcode421 gyp/core.gypi:421: '<(skia_include_path)/private/SkCpu.h', I think at head you should find now ...
4 years, 5 months ago (2016-07-11 17:00:54 UTC) #33
mtklein
https://codereview.chromium.org/2133413002/diff/80001/include/core/SkRect.h File include/core/SkRect.h (right): https://codereview.chromium.org/2133413002/diff/80001/include/core/SkRect.h#newcode876 include/core/SkRect.h:876: Sk4s rd = (Sk4s::Load(&fLeft) + Sk4s(0.5)).floor(); I can see ...
4 years, 5 months ago (2016-07-11 17:28:34 UTC) #34
reed1
I will try un-moving SkCpu.h https://codereview.chromium.org/2133413002/diff/80001/include/core/SkRect.h File include/core/SkRect.h (right): https://codereview.chromium.org/2133413002/diff/80001/include/core/SkRect.h#newcode876 include/core/SkRect.h:876: Sk4s rd = (Sk4s::Load(&fLeft) ...
4 years, 5 months ago (2016-07-11 19:03:54 UTC) #35
reed1
correct, no need to move SkCpu.h -- ptal
4 years, 5 months ago (2016-07-11 19:32:56 UTC) #38
mtklein
> For coordinates (cpu and gpu), we need a direction that is invariant for all ...
4 years, 5 months ago (2016-07-11 19:42:56 UTC) #41
mtklein
lgtm https://codereview.chromium.org/2133413002/diff/120001/include/core/SkRect.h File include/core/SkRect.h (right): https://codereview.chromium.org/2133413002/diff/120001/include/core/SkRect.h#newcode877 include/core/SkRect.h:877: SkNx_cast<int32_t>(rd).store(&dst.fLeft); SkIRect dst; SkNx_cast<int32_t>(this->round2s()).store(&dst.fLeft); return dst; ? https://codereview.chromium.org/2133413002/diff/120001/include/core/SkRect.h#newcode883 ...
4 years, 5 months ago (2016-07-11 19:43:18 UTC) #42
reed1
https://codereview.chromium.org/2133413002/diff/120001/include/core/SkRect.h File include/core/SkRect.h (right): https://codereview.chromium.org/2133413002/diff/120001/include/core/SkRect.h#newcode877 include/core/SkRect.h:877: SkNx_cast<int32_t>(rd).store(&dst.fLeft); On 2016/07/11 19:43:18, mtklein wrote: > SkIRect dst; ...
4 years, 5 months ago (2016-07-11 19:46:31 UTC) #43
reed1
add dox
4 years, 5 months ago (2016-07-11 19:55:41 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2133413002/140001
4 years, 5 months ago (2016-07-11 20:14:52 UTC) #50
commit-bot: I haz the power
Committed patchset #8 (id:140001) as https://skia.googlesource.com/skia/+/b42b785d1cbc98bd34aceae338060831b974f9c5
4 years, 5 months ago (2016-07-11 20:17:40 UTC) #52
msarett
A revert of this CL (patchset #8 id:140001) has been created in https://codereview.chromium.org/2136343002/ by msarett@google.com. ...
4 years, 5 months ago (2016-07-11 21:56:01 UTC) #53
bungeman-skia
https://codereview.chromium.org/2133413002/diff/140001/include/private/SkNx_sse.h File include/private/SkNx_sse.h (right): https://codereview.chromium.org/2133413002/diff/140001/include/private/SkNx_sse.h#newcode285 include/private/SkNx_sse.h:285: auto flip = _mm_set1_epi8(char(0x80)); Heh, maybe something like the ...
4 years, 5 months ago (2016-07-11 22:07:49 UTC) #55
mtklein
4 years, 5 months ago (2016-07-11 22:24:58 UTC) #56
Message was sent while issue was closed.
On 2016/07/11 22:07:49, bungeman-skia wrote:
>
https://codereview.chromium.org/2133413002/diff/140001/include/private/SkNx_s...
> File include/private/SkNx_sse.h (right):
> 
>
https://codereview.chromium.org/2133413002/diff/140001/include/private/SkNx_s...
> include/private/SkNx_sse.h:285: auto flip = _mm_set1_epi8(char(0x80));
> Heh, maybe something like the following would keep msvc happy? Too bad
> _mm_set1_epi8 takes char instead of 'signed char' or int8_t or something sane.
> 
> #include <climits>
> 
> #if CHAR_MAX == UCHAR_MAX
>         auto flip = _mm_set1_epi8(char(0x80));
> #else
>         auto flip = _mm_set1_epi8(char(-0x80));
> #endif

It's been enough previously to just declare a value on the stack.  Have a look
at SkNx<8,uint16_t>::Min():

        const uint16_t top = 0x8000; // Keep this separate from _mm_set1_epi16
or MSVC will whine.
        const __m128i top_8x = _mm_set1_epi16(top);

Powered by Google App Engine
This is Rietveld 408576698