Re: Help with implementing Wine optimization experiment

2016-08-17 Thread Daniel Santos
I'm stuck on generating a jmp to the epilogue as I can't find any examples of this. This is the summarized version of what I'm doing: rtx msabi_restore_fn, jump_insn; msabi_restore_fn = gen_rtx_SYMBOL_REF (Pmode, "__msabi_restore"); SYMBOL_REF_FLAGS (msabi_restore_fn) |= SYMBOL_FLAG_LOCAL; jump

Re: Help with implementing Wine optimization experiment

2016-08-17 Thread Daniel Santos
On 08/15/2016 05:46 AM, Florian Weimer wrote: On 08/14/2016 08:23 AM, Daniel Santos wrote: ms_abi_push_regs: pop%rax push %rdi push %rsi sub$0xa8,%rsp movaps %xmm6,(%rsp) movaps %xmm7,0x10(%rsp) movaps %xmm8,0x20(%rsp) movaps %xmm9,0x30(%rsp) mova

Re: Help with implementing Wine optimization experiment

2016-08-15 Thread Daniel Santos
On 08/15/2016 05:56 AM, Richard Biener wrote: On Mon, Aug 15, 2016 at 2:16 AM, Jeff Law wrote: On 08/14/2016 01:57 AM, Trevor Saunders wrote: On Sun, Aug 14, 2016 at 01:23:16AM -0500, Daniel Santos wrote: I'm experimenting with ways to optimize wine (x86 target only) and I believe I can shrin

Re: Help with implementing Wine optimization experiment

2016-08-15 Thread Daniel Santos
On 08/15/2016 06:35 AM, André Hentschel wrote: Hi, Thanks for working on this, but I haven't seen some discussion on wine-devel recently. I'm also not an expert on that area, but isn't this risking to break copy protections and hotpatching. Just wanted to remind you about those two things, so t

Re: Help with implementing Wine optimization experiment

2016-08-15 Thread André Hentschel
Am 14.08.2016 um 08:23 schrieb Daniel Santos: > I'm experimenting with ways to optimize wine (x86 target only) and I believe > I can shrink wine's total text size by around 7% by outlining the lengthy > pro- and epilogues required for ms_abi functions making sysv_abi calls. > Theoretically, fewe

Re: Help with implementing Wine optimization experiment

2016-08-15 Thread Richard Biener
On Mon, Aug 15, 2016 at 2:16 AM, Jeff Law wrote: > On 08/14/2016 01:57 AM, Trevor Saunders wrote: >> >> On Sun, Aug 14, 2016 at 01:23:16AM -0500, Daniel Santos wrote: >>> >>> I'm experimenting with ways to optimize wine (x86 target only) and I >>> believe >>> I can shrink wine's total text size by

Re: Help with implementing Wine optimization experiment

2016-08-15 Thread Florian Weimer
On 08/14/2016 08:23 AM, Daniel Santos wrote: ms_abi_push_regs: pop%rax push %rdi push %rsi sub$0xa8,%rsp movaps %xmm6,(%rsp) movaps %xmm7,0x10(%rsp) movaps %xmm8,0x20(%rsp) movaps %xmm9,0x30(%rsp) movaps %xmm10,0x40(%rsp) movaps %xmm11,0x50(%rs

Re: Help with implementing Wine optimization experiment

2016-08-14 Thread Jeff Law
On 08/14/2016 01:57 AM, Trevor Saunders wrote: On Sun, Aug 14, 2016 at 01:23:16AM -0500, Daniel Santos wrote: I'm experimenting with ways to optimize wine (x86 target only) and I believe I can shrink wine's total text size by around 7% by outlining the lengthy pro- and epilogues required for ms_

Re: Help with implementing Wine optimization experiment

2016-08-14 Thread Trevor Saunders
On Sun, Aug 14, 2016 at 01:23:16AM -0500, Daniel Santos wrote: > I'm experimenting with ways to optimize wine (x86 target only) and I believe > I can shrink wine's total text size by around 7% by outlining the lengthy > pro- and epilogues required for ms_abi functions making sysv_abi calls. > Theor

Re: Help with implementing Wine optimization experiment

2016-08-14 Thread Daniel Santos
Just an update. I did discover how the pass functions call back into the target-specific code, it's generated from gcc/config/i386/i386.md. So thread_prologue_and_epilogue_insns() --> gen_prologue() --> ix86_expand_prologue(), which is implemented in i386.c. So that problem is solved, but still