aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/jumper
Commit message (Collapse)AuthorAge
...
* clamp to [0,1] in all gradient tilersGravatar Mike Klein2017-10-05
| | | | | | | | | | | | | | | | | Today gradient mirror and repeat don't explicitly clamp. They work fine for normal float values, but blow up with inputs like infinity and NaN, and those aren't hard to construct with a combination of a funky matrix and some squaring for xy -> radius. So explicitly clamp in each of the three matrix tilers. This should fix the fuzz at the associated bug. Bug: skia:7093 Change-Id: Idd44e3c7a1ed95e2b1ace8eb953b62eddeb4e00e Reviewed-on: https://skia-review.googlesource.com/55702 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* reformat hard-to-read preprocessor in SkJumper.cppGravatar Mike Klein2017-10-05
| | | | | | | Change-Id: I9a140e342e7b12b1cbb09503ca8fc03016717784 Reviewed-on: https://skia-review.googlesource.com/55701 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* add _skx stagesGravatar Mike Klein2017-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | This just makes sure all the plumbing is in place to use the Skylake Xeon subset of AVX-512 instructions. So far, - no Windows - no lowp - nothing explicitly making use of AVX-512 registers or instructions This initial pass should run essentially identically to the _hsw AVX2 code we've been using previously. Clang _does_ use AVX-512-only instructions to implement some of the higher-level concepts we've coded, but it's really a pretty subtle difference. Next steps will bump N from 8 to 16 and start threading through an AVX-512-friendly mask instead of tail. I'll also want to take a harder look at how we do blending like if_then_else()... the default codegen here doesn't really take advantage of AVX-512 the way I'd like here. CQ_INCLUDE_TRYBOTS=skia.primary:Test-Debian9-Clang-GCE-CPU-AVX512-x86_64-Debug Change-Id: I6c9442488a449ea4770617bb22b2669859cc92e2 Reviewed-on: https://skia-review.googlesource.com/54062 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
* Move context types into STAGE() macros.Gravatar Mike Klein2017-09-28
| | | | | | | | | | | | This is something I came up with while writing _lowp.cpp. This should all be a logical no-op, but there are some code generation changes. I'm not exactly sure why. Change-Id: Iaad36b5298b37fe26ebd375a147a48852f98e1e4 Reviewed-on: https://skia-review.googlesource.com/52003 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
* Always zero vectors in start_pipeline().Gravatar Mike Klein2017-09-28
| | | | | | | | | | | | | | | | | The lowp start_pipeline() always zeros, and with floats we always zero when compiled as part of Skia, so this just makes the offline float consistent with the others. It's getting confusing to think about which code zeros and which doesn't, and it'd be nicer to be able to rely on zeros. This should change code generation only to the start_pipelines in the .S files. Change-Id: I1178b83c01e609e40dc7912d8d56df8e36eb339d Reviewed-on: https://skia-review.googlesource.com/52001 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Also mask t itself in mask_2pt_conical_degenerates.Gravatar Mike Klein2017-09-28
| | | | | | | | | | | | | | | | | | We look at t to create a mask in mask_2pt_conical_degenerates to be applied later to the colors after the normal gradient stages have run. But if t itself is NaN, that will wreak havoc in the normal gradient stages. So in addition to building the mask to kill off degenerate colors, let's also set degenerate t to zero, which should be a safe value. This fixes the fuzz mentioned in this bug. BUG=skia:7078 Change-Id: I8301450c707bdbf941abd0339959f9e60d46d955 Reviewed-on: https://skia-review.googlesource.com/52763 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* remove __attribute__((disable_tail_calls))Gravatar Mike Klein2017-09-27
| | | | | | | | | | | | This is a no-op in terms of generated code. There is no longer a tail call here to be disabled, not since we changed start_pipeline() to operate in 2D. Change-Id: Ife92590eb059e28e4a84e3729180c7410a93b410 Reviewed-on: https://skia-review.googlesource.com/52020 Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* rename kStride NGravatar Mike Klein2017-09-27
| | | | | | | | | | This is a no-op refactor to make SkJumper_stages.cpp and SkJumper_stages_lowp.cpp more similar. Change-Id: Icb5dd415d105fbdc58ce0b9b63058c0a66ed4a13 Reviewed-on: https://skia-review.googlesource.com/52000 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Fold clamp_{x,y} into the gathers.Gravatar Mike Klein2017-09-22
| | | | | | | | | | | | | | | | | | | All three image tile modes go through exclusive_clamp() and then a gather today, so we can move the work of exclusive_clamp() into eac gather_ stage, eliminating the need for clamp_{x,y} stages. Luckily, we've got a convenient place to bottleneck this, ptr_and_ix(), which works out the pointer and vector of indices to load for gathers. This deletes SkRasterPipeline_repeat_tiling unit test, which now no longer exactly makes sense. It tests that repeat_x does that clamp, but that's now done automatically outside that stage. Change-Id: I24637ef60921bec7aa00082984c0c6a49dd86ca9 Reviewed-on: https://skia-review.googlesource.com/50260 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* count total non-lowp runsGravatar Mike Klein2017-09-21
| | | | | | | Change-Id: I2e24c990983ea93cbd7983c9c4e88120c2b7f358 Reviewed-on: https://skia-review.googlesource.com/49768 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Retry, Bump stored lowp uniform color to 16-bit storage.Gravatar Mike Klein2017-09-16
| | | | | | | | | | | This makes loading into 16-bit channels more natural in _lowp.cpp. Update a unit test to stop using out-of-range "colors". Change-Id: I494687aac87948b60a40de447aa1527cf7167b2d Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-UBSAN_float_cast_overflow Reviewed-on: https://skia-review.googlesource.com/47580 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Implement some easy _lowp stages.Gravatar Mike Klein2017-09-16
| | | | | | | | | | | | | - load_565 allows 565-src sprite blits - scale_565 / lerp_565 allow subpixel text - luminance_to_alpha is a color filter, and lets us write grey 8 And update CachedDecodingPixelRefTest with a yet more robust color. Change-Id: I8af499c43f0f28093744d9c2993af553e36c9526 Reviewed-on: https://skia-review.googlesource.com/47021 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Revert "Bump stored lowp uniform color to 16-bit storage."Gravatar Mike Klein2017-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d286bfbd96f8b7ccf1cbce74f07d2f3917dbec30. Reason for revert: ../../../src/core/SkRasterPipeline.cpp:98:34: runtime error: 4.87906e+09 is outside the range of representable values of type 'unsigned short' Excellent new bot! Original change's description: > Bump stored lowp uniform color to 16-bit storage. > > This makes loading into 16-bit channels more natural in _lowp.cpp. > > Change-Id: I1ed393873654060ef52f4632d670465528006bbd > Reviewed-on: https://skia-review.googlesource.com/47261 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Mike Klein <mtklein@chromium.org> TBR=mtklein@chromium.org,reed@google.com Change-Id: Ia65645c1261a7b31588c4ddaf2b1b3b327d265b0 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/47540 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* Disable SkJumper assembly in cross builds for now.Gravatar Nico Weber2017-09-16
| | | | | | | | Bug: chromium:762167 Change-Id: Ia23f6dbfc0466aef4ca9d1a5b9ff343d79dc83bb Reviewed-on: https://skia-review.googlesource.com/47460 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Bump stored lowp uniform color to 16-bit storage.Gravatar Mike Klein2017-09-16
| | | | | | | | | This makes loading into 16-bit channels more natural in _lowp.cpp. Change-Id: I1ed393873654060ef52f4632d670465528006bbd Reviewed-on: https://skia-review.googlesource.com/47261 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* centralize SI, Ctx, and load_and_inc()Gravatar Mike Klein2017-09-15
| | | | | | | | | | | | | | | | | We've got independent definitions of SI, LazyCtx/Ctx, and load_and_inc() in _stages.cpp and _lowp.cpp. It's a good time to centralize them, taking _stages.cpp's SI and load_and_inc(), and _lowp's Ctx. SI and load_and_inc() are uninterestingly different. But using _lowp's Ctx will let us get its prettier typed stage definitions into _stages.cpp, but that is not not done here. This is a pure refactor with no generated code changes. Change-Id: I53260b0fdc71a77bf9e3ed6f3df3a2a4cbd2392b Reviewed-on: https://skia-review.googlesource.com/47181 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* make most of SkColorPriv.h privateGravatar Cary Clark2017-09-15
| | | | | | | | | | | | | created new file src/core/SkColorData.h for internal consumption. Note that many of the functions there are unused as well. Bug: skia: 6898 R: reed@google.com Change-Id: I25bfd5a9c21f53558c4ca65a77eb5d322d897c6d Reviewed-on: https://skia-review.googlesource.com/46848 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Mike Reed <reed@google.com>
* clean up SK_JUMPER_LEGACY_8BITGravatar Mike Klein2017-09-15
| | | | | | | Change-Id: I4d4093fcfc839f6e7468b7d9f89bb903186ab68d Reviewed-on: https://skia-review.googlesource.com/46761 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* fix android rollGravatar Mike Klein2017-09-14
| | | | | | | | | | | | | | | | Guarding loads of 8-15 with defined(__AVX2__) should prevent errors like these: external/skia/src/jumper/SkJumper_stages_lowp.cpp:287:46: error: 'memcpy' called with size bigger than buffer case 12: memcpy(&v, ptr, 12*sizeof(T)); break; The loads of 8-15 were of course unreachable, given the &(N-1) == &7. Change-Id: Ifcb5c177c6909e1df55cb564779a4d6610ff7b32 Reviewed-on: https://skia-review.googlesource.com/46521 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* grand unifried lowp stagesGravatar Mike Klein2017-09-14
| | | | | | | | | | | | | | | | | | | | | | | | | I have text_16_AA_FF -> 8888 (forcing RP) faster than head now on my laptop. I'm feeling confident that we can make this perform well. After looking at performance a bit more today, it looks like everything is within what I'd consider comparable in performance, especially on ARM. On x86-64 it looks like big bulk blits get a little slower and small mask blits get a little faster. Quality looks good, and maybe improved for 565. There are fewer platform-specific differences now in _lowp, and I think they're few enough now that we could even consider completing the unification by folding the 8-bit and float code together. Rename "div255()" to "rebias()", slap on a few coats of paint... Guarded for Chrome with SK_JUMPER_LEGACY_LOWP. Change-Id: I36309c07cf736f3cb31952cca66030ad56026318 Reviewed-on: https://skia-review.googlesource.com/45982 Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* update SkJumper stages to clang 5Gravatar Mike Klein2017-09-08
| | | | | | | | | | | | | | | | | | | | To continue building stages, update Clang and update your GN args: $ brew update $ brew upgrade llvm $ find . | grep args.gn | xargs sed -ie 's/clang-4.0/clang-5.0/g' Some interesting codegen changes I noticed: - ARMv7: generally better register assignment, tighter code - ARMv7: dropped the 128-bit alignment hint when loading and storing dst "registers", unclear why. - HSW: now clearing the destination register before vgatherdps, to break a dependency on the previous value Change-Id: I4f804a4cbfcde530fad5ed535438174e852a9593 Reviewed-on: https://skia-review.googlesource.com/44241 Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* clean up SK_JUMPER_LEGACY_X86_8BITGravatar Mike Klein2017-09-06
| | | | | | | Change-Id: I26c22c085efd70b65de927a9a8a041d03c170f2a Reviewed-on: https://skia-review.googlesource.com/42760 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* merge 0,1,2,3,... and 0.5fGravatar Mike Klein2017-09-05
| | | | | | | | | | Because floats are fun, the compiler cannot merge x + 0.5f + [0,1,2,3,4...] into x + [0.5,1.5,2.5,3.5,4.5,...]. But we can. Change-Id: I03b46c1ea0653877f35f6c888f29371b5f73d813 Reviewed-on: https://skia-review.googlesource.com/42480 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* add 8bit stages for load/store 565Gravatar Mike Reed2017-08-31
| | | | | | | | | | | approx 2.5x faster on arm64 for sprite 8888 --> 565 blits Bug: skia: Change-Id: I524f993fee16196385dc07cbec39ef378b1301e5 Reviewed-on: https://skia-review.googlesource.com/41162 Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* 32-bit x86 8-bit stagesGravatar Mike Klein2017-08-30
| | | | | | | | | | | Shouldn't be anything tricky here. Guarded by SK_JUMPER_LEGACY_X86_8BIT for (Win) layout tests. Change-Id: I7580c7c18d1721f1301904c049ea2e59e9bda5d9 Reviewed-on: https://skia-review.googlesource.com/40692 Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* remove 8-bit Params structGravatar Mike Klein2017-08-30
| | | | | | | | | | | | | I'm not sure why I wrote this to use a Params struct originally, but we should have plenty of registers in _8bit to pass everything directly and avoid the stack. Even once we enable the 8-bit pipeline on 32-bit x86, we'll have 4 general purpose registers and 4 vector registers to use, precisely what we're using here. Change-Id: I3e51ab73186edcdcb8bfaa6cc99d9516db7c032a Reviewed-on: https://skia-review.googlesource.com/40771 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* improve ARMv7 8-bit codegenGravatar Mike Klein2017-08-30
| | | | | | | | | | | | | | We need to make two changes to keep all values in registers: 1) pass raw U8 values instead of V structs that wrap them 2) switch to aapcs-vfp, which allows exactly 8x U8 arguments Code generation goes from ridiculous looking to lovely. Change-Id: Ibd53bdd86345b59bd987a1f79205645d80c5cbc3 Reviewed-on: https://skia-review.googlesource.com/40021 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* fast NEON divide-by-255Gravatar Mike Klein2017-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | We can approximate (xy + 127) / 255 with (xy + 255) / 256. On ARM this divide-by-255 is a single instruction, one of the two we use today to do a perfect divide-by-255 (#if 0). This cuts div-255 in half, or a full mul-div-255 by a third. The U16(255) constant can even be created in a single instruction without hitting memory, which is as good as it gets. Here's a nice little example: 0000000000000000 <sk_premul_8bit>: 0: f8408404 ldr x4, [x0], #8 // Load the next stage. 4: 2e23c000 umull v0.8h, v0.8b, v3.8b // r = r * a 8: 6f02e6b0 movi v16.2d, #0xff00ff00ff00ff // create U16(255) c: 2e23c021 umull v1.8h, v1.8b, v3.8b // g = g * a 10: 2e23c042 umull v2.8h, v2.8b, v3.8b // b = b * a 14: 0e304000 addhn v0.8b, v0.8h, v16.8h // r = div255(r) 18: 0e304021 addhn v1.8b, v1.8h, v16.8h // g = div255(g) 1c: 0e304042 addhn v2.8b, v2.8h, v16.8h // b = div255(b) 20: d61f0080 br x4 // JUMP! Change-Id: I4224ed3844abf6c67d9e42b67444a60f4aee8f08 Reviewed-on: https://skia-review.googlesource.com/40121 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* no more need for a constants pointerGravatar Mike Klein2017-08-29
| | | | | | | | | | | | | | | The only reason we were keeping SkJumper_constants around is that it was hard to get float/integer iota vectors on arm64 without relocations. Now that we're compiling arm64 normally as part of Skia, we don't have to worry about relocations. This means we can kill the struct and stop passing around that pointer. Change-Id: I013c6a735947f3db2bc87f2bfa38b7520d2e2fce Reviewed-on: https://skia-review.googlesource.com/40200 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
* better NEON 8-bit stagesGravatar Mike Klein2017-08-29
| | | | | | | | | | | | | | | | Our interlaced approach works pretty well for x86, but on ARM we're a lot better off deinterlacing in loads and reinterlacing in stores. This leaves the stages mostly looking like the float stages, and cuts out some awkward parts from the code generation. Diffs are all invisible. Performance is noticeably better for some blend modes like Overlay. Change-Id: Ie599e823602bfd14552de78df44a621aea66e1a2 Reviewed-on: https://skia-review.googlesource.com/40100 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* use NEON 8-bit stages on ARMv7 tooGravatar Mike Klein2017-08-29
| | | | | | | | | | | | | | | | | We don't really use anything very ARMv8 specific in the 8-bit NEON stages, so we can just naturally extend what we're doing to ARMv7 too. Note that unlike the float stages, we're not requiring VFPv4 either, just NEON. VFPv4 is for FMA and F16<->F32 conversion, both of which are unnecessary for the integer pipeline. GMs and perf improvement are similar to the previous ARMv8 change. Change-Id: Id618801ea1920564c1deee144a640a4133c4505f Reviewed-on: https://skia-review.googlesource.com/39840 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
* Revert "Revert "8-bit jumper on armv8""Gravatar Mike Klein2017-08-29
| | | | | | | | | | | | | | | | | This reverts commit 6d13575108299951ecdfba6d85c915fcec2bc028. Now with guards for "errors" like this: external/skia/src/jumper/SkJumper_stages_8bit.cpp:240:50: error: 'memcpy' called with size bigger than buffer case 12: memcpy(&v, src, 12*sizeof(T)); break; This code is unreachable and generally removed by Clang's optimizer anyway... as far as I can tell the code generation diff is arbitrary. Change-Id: I6216567caaa6166f71258bd25343a09e93892a10 Reviewed-on: https://skia-review.googlesource.com/39961 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "8-bit jumper on armv8"Gravatar Derek Sollenberger2017-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 08133583d5e1cdfdcc41b4bb078fcfb64137f058. Reason for revert: Blocking Android Autoroller on compile error. Original change's description: > 8-bit jumper on armv8 > > The GM diffs are all minor and what you'd expect. > > I did a quick performance sanity check, which also looks fine. > > $ out/ok bench rp filter:search=Modulate > [blendmode_rect_Modulate] 30.2ms @0 32ms @95 32ms @100 > [blendmode_mask_Modulate] 12.6ms @0 12.6ms @95 14.5ms @100 > ~~~> > [blendmode_rect_Modulate] 11.2ms @0 11.7ms @95 12.4ms @100 > [blendmode_mask_Modulate] 10.5ms @0 23.6ms @95 23.9ms @100 > > This isn't even really the fastest we can make 8-bit go on ARMv8; > it's actually much more natural to work de-interlaced there. Lots > of room to follow up. > > Change-Id: I86b1099f6742bcb0b8b4fa153e85eaba9567cbf7 > Reviewed-on: https://skia-review.googlesource.com/39740 > Reviewed-by: Florin Malita <fmalita@chromium.org> > Commit-Queue: Mike Klein <mtklein@chromium.org> TBR=mtklein@chromium.org,herb@google.com,fmalita@chromium.org,reed@google.com Change-Id: I71425d8b7fbb66be5cb50025871dd81358111da4 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/39980 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Derek Sollenberger <djsollen@google.com>
* 8-bit jumper on armv8Gravatar Mike Klein2017-08-28
| | | | | | | | | | | | | | | | | | | | | | The GM diffs are all minor and what you'd expect. I did a quick performance sanity check, which also looks fine. $ out/ok bench rp filter:search=Modulate [blendmode_rect_Modulate] 30.2ms @0 32ms @95 32ms @100 [blendmode_mask_Modulate] 12.6ms @0 12.6ms @95 14.5ms @100 ~~~> [blendmode_rect_Modulate] 11.2ms @0 11.7ms @95 12.4ms @100 [blendmode_mask_Modulate] 10.5ms @0 23.6ms @95 23.9ms @100 This isn't even really the fastest we can make 8-bit go on ARMv8; it's actually much more natural to work de-interlaced there. Lots of room to follow up. Change-Id: I86b1099f6742bcb0b8b4fa153e85eaba9567cbf7 Reviewed-on: https://skia-review.googlesource.com/39740 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* -Fast bot fixes for AVX+ codeGravatar Mike Klein2017-08-28
| | | | | | | | | | | | | | | | | | | 1) Replace a couple commas with semicolons. 2) Make sure to zero a couple vectors. 1) has no effect on code generation. 2) does add a bunch of self-vxorps, but they're cheap and we already do the equivalent for <AVX SSE code, and they're in not very performance-critical routines. We could circle back and guard these with !defined(JUMPER_IS_OFFLINE) if we really need the vectors to start uninitialized for speed. CQ_INCLUDE_TRYBOTS=skia.primary:Build-Debian9-Clang-x86_64-Release-Fast Change-Id: I1a13f3eb28d664dbc345d71c3adbc62be5ff7c45 Reviewed-on: https://skia-review.googlesource.com/39661 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* remove aarch64 offline compilationGravatar Mike Klein2017-08-28
| | | | | | | | | | | | | | | The baseline compiled into Skia is now pretty much identical. Minor diffs due to the offline code using -ffp-contract=fast, and the baseline not. Explicit calls to fma() are still FMAs, but we're no longer letting the compiler uncover FMAs we didn't explicitly call out. If this goes well, we should be able to turn on the 8-bit pipeline. Change-Id: I8f73157cfce7373574c20f6435fe86b46477afa9 Reviewed-on: https://skia-review.googlesource.com/39520 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* split up JUMPER defineGravatar Mike Klein2017-08-28
| | | | | | | | | | | | | | | | | | | | | | | | | Whether JUMPER is defined is starting to get a little overloaded: - are we compiling offline (defined) or as part of Skia (!defined)? - are we using Clang vector extensions (defined) or scalars (!defined)? This splits JUMPER into these two separate concerns: - JUMPER_IS_OFFLINE - JUMPER_IS_SCALAR, JUMPER_IS_NEON, JUMPER_IS_AVX2, etc. The upshot is that we'll now use Clang vector extensions when available for our "portable" baseline. On x86-64 and ARMv8 compiled by Clang, we're guaranteed to pick up SSE2 and NEON respectively. Our -Fast bot should even get all the way to AVX2. Another CL will do some refactoring in SkJumper to remove the redundant copies of guaranteed vector code on x86-64 and ARMv8. I didn't want to do that here yet to demonstrate that there is zero effect on the .S files from this CL. Change-Id: Ib5e8f00b35e8721b2cc7180e294840ffaf9dddce Reviewed-on: https://skia-review.googlesource.com/39500 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* rework plus blend modeGravatar Mike Klein2017-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The most interesting parts of this are how plus interacts with partial coverage. Plus needs its clamp to happen after the lerp. Luckily, some of its math folds away: d' = clamp[ d*(1-c) + (s+d)*c ] == clamp[ d - dc + sc + dc ] == clamp[ d + sc ] What's nice there is that coverage can be folded into the src term. This suggests that we can re-write the plus stage to clamp internally (and thus, be viable for 8-bit) if we always pre-scale with coverage. We don't have a way to pre-scale with 565 coverage until now, but it's only a step or two away from there. We can use the alternate formulation we derived for alpha for lerp_565, calculating the alpha coverage from red, green, and blue coverages _and_ the values of src and dst alpha. While we already pre-scale srcover today for 8-bit or constant coverage, we cannot do the same for 565. When evaluating the expression d' = s + (1-a)d we need the a term to be pre-scaled with red's coverage when calculating dr', with blue's when calculating db', etc. Essentially we need to carry around a bunch of extra values, and we've got no way to do that. So instead, we'll just carefully pre-scale plus with any coverage, and keep post-lerping srcover when we have 565 coverage. Change-Id: I7a7a52eec7d482e1b98bb8a01ea0a3d5e67bef65 Reviewed-on: https://skia-review.googlesource.com/38300 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Remove SK_SUPPORT_LEGACY_RP_BLENDS-guarded codeGravatar Florin Malita2017-08-24
| | | | | | | | | | The flag is no longer used. Change-Id: I39156ef5683538263c2302f2fe3ba779e55dbc47 Reviewed-on: https://skia-review.googlesource.com/38360 Commit-Queue: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* merge object files before parsing into assemblyGravatar Mike Klein2017-08-24
| | | | | | | | | | | | | This extra ld pass can merge all our many redundant constants, both within an instruction set and across them. This should save a bunch of code size on x86-64, with no other impact. It cuts 12K off my local build of ok. Change-Id: Ib2bb4adf88564aca45e55ee53dcf6584265c7dbe Reviewed-on: https://skia-review.googlesource.com/37940 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Document missing 8bit blend stagesGravatar Florin Malita2017-08-23
| | | | | | | Change-Id: Id626f954fe45546a015a1bd423f19cca5f8967a9 Reviewed-on: https://skia-review.googlesource.com/37861 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* ColorBurn/ColorDodge stage tweaksGravatar Florin Malita2017-08-23
| | | | | | | | | | | | | | | | | | | Minor speedup. Before: 10212.01 ? blendmode_rect_ColorBurn 8888 9216.78 ? blendmode_rect_ColorDodge 8888 After: 9635.44 ? blendmode_rect_ColorBurn 8888 8820.22 ? blendmode_rect_ColorDodge 8888 Change-Id: I9e8a9aa21e2370de3174c31821fb0676260d2643 Reviewed-on: https://skia-review.googlesource.com/37620 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* remove disabled mask load and store codeGravatar Mike Klein2017-08-22
| | | | | | | | | | Things ran slower when we attempted to turn it on, and we've already removed the analog in SkJumper_stages.cpp. Change-Id: I61afa38990bf54d1bff2b1902f09a14df4e17da9 Reviewed-on: https://skia-review.googlesource.com/37080 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* rename confusing lowp guardGravatar Mike Klein2017-08-15
| | | | | | | Change-Id: I346429015e5f902b0a35663e140bb9a025c4220e Reviewed-on: https://skia-review.googlesource.com/34680 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Lowp overlay, hardlight stagesGravatar Florin Malita2017-08-14
| | | | | | | | | | | | | | | | | | | | Before: micros bench 7669.09 ? blendmode_rect_HardLight 8888 8707.13 ? blendmode_rect_Overlay 8888 After: micros bench 6679.60 ? blendmode_rect_HardLight 8888 6789.57 ? blendmode_rect_Overlay 8888 Change-Id: I52f389253fa07dafe18e572af550af7387264a16 Reviewed-on: https://skia-review.googlesource.com/34280 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@google.com>
* we never define BLEND_MODEGravatar Mike Klein2017-08-14
| | | | | | | | | Change-Id: I88f3e56971e9844ab2ff74edb0718e6b6e9c6559 Reviewed-on: https://skia-review.googlesource.com/34260 Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Simplify difference and exclusion.Gravatar Mike Klein2017-08-14
| | | | | | | | | | | | | | | | | | | | | | | We can fold through some math in these two modes. $ out/ok bench:samples=100 rp filter:search="Difference|Exclusion" serial Before: [blendmode_rect_Exclusion] 4.94ms @0 6.13ms @99 6.25ms @100 [blendmode_mask_Exclusion] 10.9ms @0 12.8ms @99 12.9ms @100 [blendmode_rect_Difference] 5.56ms @0 6.79ms @99 6.8ms @100 [blendmode_mask_Difference] 11.4ms @0 13.8ms @99 14.1ms @100 After: [blendmode_rect_Exclusion] 3.5ms @0 4.12ms @99 4.59ms @100 [blendmode_mask_Exclusion] 9.27ms @0 11.2ms @99 11.6ms @100 [blendmode_rect_Difference] 5.37ms @0 6.58ms @99 6.6ms @100 [blendmode_mask_Difference] 11ms @0 12.1ms @99 12.6ms @100 Change-Id: I03f32368244d4f979cfee83723fd78dfbc7d5fc1 Reviewed-on: https://skia-review.googlesource.com/33980 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* lowp: lighten, difference, exclusionGravatar Florin Malita2017-08-14
| | | | | | | Change-Id: I5773cf831c7e41a932bee1f2c6830085fb7db025 Reviewed-on: https://skia-review.googlesource.com/33764 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@google.com>
* Guard lowp changesGravatar Florin Malita2017-08-11
| | | | | | | | | | Chromium uses the lowp code, we have to stage the changes. TBR= Change-Id: I45e97a51eca285c9afc71926bbf736a03d0d146c Reviewed-on: https://skia-review.googlesource.com/33765 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Lowp darken stageGravatar Florin Malita2017-08-11
| | | | | | | Change-Id: I4bf618ad8728541fcef3fc1c6aa5b3ca106d50dc Reviewed-on: https://skia-review.googlesource.com/33583 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>