diff options
author | 2017-02-13 19:00:09 -0500 | |
---|---|---|
committer | 2017-02-13 19:53:48 +0000 | |
commit | d2d6d726fa3e401da73befa649266bc5589da7e5 (patch) | |
tree | a59ba00e4c1a7c11a15d4a45d4fae80daf82dcf4 /src/splicer/SkSplicer.cpp | |
parent | 73eae9810314c49205fe58f541e8e49a987da1ee (diff) |
Fix stack alignment in Windows before_loop/after_loop.
This should land as a no-op, as nothing using the stack yet.
It will allow us to land the SSE2 code, which does spill in to_srgb.
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Debug,Test-Win10-MSVC-Golo-GPU-GT610-x86_64-Release
Change-Id: Ie8000d50a85d56ad6229736d79f3a947f06a808c
Reviewed-on: https://skia-review.googlesource.com/8389
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Diffstat (limited to 'src/splicer/SkSplicer.cpp')
-rw-r--r-- | src/splicer/SkSplicer.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/splicer/SkSplicer.cpp b/src/splicer/SkSplicer.cpp index c0d4350978..b3336cccab 100644 --- a/src/splicer/SkSplicer.cpp +++ b/src/splicer/SkSplicer.cpp @@ -123,10 +123,11 @@ namespace { #if defined(_MSC_VER) // Adapt from MS ABI to System V ABI used by stages. static void before_loop(SkWStream* buf) { + // On the way into this adapter the stack is 16-byte aligned plus an 8-byte return address. + // We need to leave the stack the same way: at an odd 8-byte alignment. static const uint8_t ms_to_system_v[] = { 0x56, // push %rsi - 0x57, // push %rdi - 0x48,0x81,0xec,0xa8,0x00,0x00,0x00, // sub $0xa8,%rsp + 0x48,0x81,0xec,0xa0,0x00,0x00,0x00, // sub $0xa0,%rsp 0x44,0x0f,0x29,0xbc,0x24,0x90,0x00,0x00,0x00, // movaps %xmm15,0x90(%rsp) 0x44,0x0f,0x29,0xb4,0x24,0x80,0x00,0x00,0x00, // movaps %xmm14,0x80(%rsp) 0x44,0x0f,0x29,0x6c,0x24,0x70, // movaps %xmm13,0x70(%rsp) @@ -137,6 +138,7 @@ namespace { 0x44,0x0f,0x29,0x44,0x24,0x20, // movaps %xmm8,0x20(%rsp) 0x0f,0x29,0x7c,0x24,0x10, // movaps %xmm7,0x10(%rsp) 0x0f,0x29,0x34,0x24, // movaps %xmm6,(%rsp) + 0x57, // push %rdi 0x48,0x89,0xcf, // mov %rcx,%rdi 0x48,0x89,0xd6, // mov %rdx,%rsi 0x4c,0x89,0xc2, // mov %r8,%rdx @@ -147,6 +149,7 @@ namespace { static void after_loop(SkWStream* buf) { static const uint8_t system_v_to_ms[] = { // TODO: vzeroupper here? + 0x5f, // pop %rdi 0x0f,0x28,0x34,0x24, // movaps (%rsp),%xmm6 0x0f,0x28,0x7c,0x24,0x10, // movaps 0x10(%rsp),%xmm7 0x44,0x0f,0x28,0x44,0x24,0x20, // movaps 0x20(%rsp),%xmm8 @@ -157,8 +160,7 @@ namespace { 0x44,0x0f,0x28,0x6c,0x24,0x70, // movaps 0x70(%rsp),%xmm13 0x44,0x0f,0x28,0xb4,0x24,0x80,0x00,0x00,0x00, // movaps 0x80(%rsp),%xmm14 0x44,0x0f,0x28,0xbc,0x24,0x90,0x00,0x00,0x00, // movaps 0x90(%rsp),%xmm15 - 0x48,0x81,0xc4,0xa8,0x00,0x00,0x00, // add $0xa8,%rsp - 0x5f, // pop %rdi + 0x48,0x81,0xc4,0xa0,0x00,0x00,0x00, // add $0xa0,%rsp 0x5e, // pop %rsi }; splice(buf, system_v_to_ms); |