diff options
author | Mike Klein <mtklein@chromium.org> | 2018-03-07 15:09:17 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-07 15:09:21 +0000 |
commit | 3a4bd34478826c0457a36a8755791faf36a44e5e (patch) | |
tree | 48abeba3dff608e8c73d462e031c124dac905306 /src/jumper/SkJumper.h | |
parent | 22e536e3a1a09405d1c0e6f071717a726d86e8d4 (diff) |
Revert "make SkJumper stages normal Skia code"
This reverts commit 22e536e3a1a09405d1c0e6f071717a726d86e8d4.
Reason for revert: wrong include path :/
Original change's description:
> make SkJumper stages normal Skia code
>
> Enough clients are using Clang now that we can say, use Clang to build
> if you want these software pipeline stages to go fast.
>
> This lets us drop the offline build aspect of SkJumper stages, instead
> building as part of Skia using the SkOpts framework.
>
> I think everything should work, except I've (temporarily) removed
> AVX-512 support. I will put this back in a follow up.
>
> I have had to drop Windows down to __vectorcall and our narrower
> stage calling convention that keeps the d-registers on the stack.
> I tried forcing sysv_abi, but that crashed Clang. :/
>
> Added a TODO to up the same narrower stage calling convention
> for lowp stages... we just *don't* today, for no good reason.
>
> Change-Id: Iaaa792ffe4deab3508d2dc5d0008c163c24b3383
> Reviewed-on: https://skia-review.googlesource.com/110641
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Herb Derby <herb@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
TBR=mtklein@chromium.org,herb@google.com,fmalita@chromium.org
Change-Id: I2bdc709c80cdfa6b13ff24e024b3721bef887f46
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/112741
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/jumper/SkJumper.h')
-rw-r--r-- | src/jumper/SkJumper.h | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/jumper/SkJumper.h b/src/jumper/SkJumper.h index d4c4698048..e7bf9b2403 100644 --- a/src/jumper/SkJumper.h +++ b/src/jumper/SkJumper.h @@ -11,11 +11,34 @@ #include <stddef.h> #include <stdint.h> -// This file contains definitions shared by SkJumper.cpp/SkJumper_stages.cpp -// and the rest of Skia. It is important to keep the interface to SkJumper -// limited and simple to avoid serious ODR violation pitfalls, especially when -// using Microsoft's <math.h> and similar headers with inline-but-not-static -// function definitions. +// This file contains definitions shared by SkJumper.cpp (compiled normally as part of Skia) +// and SkJumper_stages.cpp (compiled into Skia _and_ offline into SkJumper_generated.h). +// Keep it simple! + +// Externally facing functions (start_pipeline) are called a little specially on Windows. +#if defined(JUMPER_IS_OFFLINE) && defined(WIN) && defined(__x86_64__) + #define MAYBE_MSABI __attribute__((ms_abi)) // Use MS' ABI, not System V. +#elif defined(JUMPER_IS_OFFLINE) && defined(WIN) && defined(__i386__) + #define MAYBE_MSABI __attribute__((force_align_arg_pointer)) // Re-align stack 4 -> 16 bytes. +#else + #define MAYBE_MSABI +#endif + +// Any custom ABI to use for all non-externally-facing stage functions. +#if defined(__ARM_NEON) && defined(__arm__) + // This lets us pass vectors more efficiently on 32-bit ARM. + #define ABI __attribute__((pcs("aapcs-vfp"))) +#else + #define ABI +#endif + +// On ARM we expect that you're using Clang if you want SkJumper to be fast. +// If you are, the baseline float stages will use NEON, and lowp stages will +// also be available. (If somehow you're building for ARM not using Clang, +// you'll get scalar baseline stages and no lowp support.) +#if defined(__clang__) && defined(__ARM_NEON) + #define JUMPER_HAS_NEON_LOWP +#endif static const int SkJumper_kMaxStride = 16; @@ -53,7 +76,7 @@ struct SkJumper_DecalTileCtx { }; struct SkJumper_CallbackCtx { - void (*fn)(SkJumper_CallbackCtx* self, int active_pixels/*<= SkJumper_kMaxStride*/); + MAYBE_MSABI void (*fn)(SkJumper_CallbackCtx* self, int active_pixels/*<= SkJumper_kMaxStride*/); // When called, fn() will have our active pixels available in rgba. // When fn() returns, the pipeline will read back those active pixels from read_from. |