Re: MSVC hook function prologue

2009-09-08 Thread Stefan Dösinger
Ok, Alexandre hasn't changed his opinion, the function attrib is ok with him. I attached another version of the patch, this time adding some testcases. Two more questions though: *) How can I skip the tests if msvc_prologue is not available because as doesn't support the swap suffix? I think it

Re: MSVC hook function prologue

2009-09-07 Thread Ross Ridge
Paolo Bonzini writes: >The naked attribute has been proposed and bashed to death multiple >times on the GCC list too. No, not really. It's been proposed a few times, but the discussion never gets anywhere because the i386 maintainers quickly put their foot down and end it. That hasn't stopped ot

Re: MSVC hook function prologue

2009-09-07 Thread Paolo Bonzini
On 09/06/2009 11:15 AM, Stefan Dösinger wrote: Am Saturday 05 September 2009 17:08:19 schrieb Ross Ridge: If this patch is essentially only for one application, maybe the idea of implementing a more generally useful naked attribute would be the way to go. I implemented a naked attribute in my p

Re: MSVC hook function prologue

2009-09-06 Thread Andreas Schwab
Stefan Dösinger writes: > Index: gcc/doc/extend.texi > === > --- gcc/doc/extend.texi (revision 151419) > +++ gcc/doc/extend.texi (working copy) > @@ -2672,6 +2672,14 @@ when targeting Windows. On all other systems, the >

Re: MSVC hook function prologue

2009-09-06 Thread Stefan Dösinger
Am Saturday 05 September 2009 17:08:19 schrieb Ross Ridge: > If this patch is essentially only for one application, maybe the idea > of implementing a more generally useful naked attribute would be the > way to go. I implemented a naked attribute in my private sources to > do something similar, al

Re: MSVC hook function prologue

2009-09-05 Thread Ross Ridge
Paolo Bonzini writes: >Are there non-Microsoft DLLs that expect to be hooked this way? If >so, I think the patch is interesting for gcc independent of whether it >is useful for Wine. Stefan Dösinger writes: >I haven't seen any so far. ... If this patch is essentially only for one application, ma

Re: MSVC hook function prologue

2009-09-05 Thread Stefan Dösinger
Are there non-Microsoft DLLs that expect to be hooked this way? If so, I think the patch is interesting for gcc independent of whether it is useful for Wine. I haven't seen any so far. Its certainly possible some server apps have the 2 byte nop at the beginning of functions for a similar hot-

Re: MSVC hook function prologue

2009-09-05 Thread Paolo Bonzini
On Fri, Sep 4, 2009 at 16:35, Stefan Dösinger wrote: > Am Friday 04 September 2009 14:49:42 schrieb Stefan Dösinger: >> I attached another version of the patch - I restarted the compile, so I >> still don't know if it fully works. > Seems to be working - gcc compiles fine, my test function has the

Re: MSVC hook function prologue

2009-09-04 Thread Stefan Dösinger
Am Friday 04 September 2009 14:49:42 schrieb Stefan Dösinger: > I attached another version of the patch - I restarted the compile, so I > still don't know if it fully works. Seems to be working - gcc compiles fine, my test function has the right starting bytes. Wine compiles and runs, and Steam su

Re: MSVC hook function prologue

2009-09-04 Thread Stefan Dösinger
Am Friday 04 September 2009 14:23:39 schrieb Paolo Bonzini: > The parallel is implicit in define_insn, so it is not different. It > does not make any harm I guess, but it looks "weird" to a more familiar > eye. :-) Ok, I removed it again :-) > +#ifdef HAVE_AS_IX86_SWAP > + { "msvc_prologue", 0,

Re: MSVC hook function prologue

2009-09-04 Thread Paolo Bonzini
Yes, you need this: [(set (match_operand:SI 0 "register_operand" "=r") (match_operand:SI 1 "register_operand" "r")) (unspec_volatile [(const_int 0)] UNSPECV_VSWAPMOV)] That works, thanks! I just found the "=r" and "r" stuff myself almost at the same time your mail arriv

Re: MSVC hook function prologue

2009-09-04 Thread Stefan Dösinger
Am Friday 04 September 2009 13:47:20 schrieb Paolo Bonzini: > > I guess the error isn't about the const_int 0, but about operand 0. Any > > ideas? > > Yes, you need this: > > [(set (match_operand:SI 0 "register_operand" "=r") >(match_operand:SI 1 "register_operand" "r")) > (u

Re: MSVC hook function prologue

2009-09-04 Thread Paolo Bonzini
I guess the error isn't about the const_int 0, but about operand 0. Any ideas? Yes, you need this: [(set (match_operand:SI 0 "register_operand" "=r") (match_operand:SI 1 "register_operand" "r")) (unspec_volatile [(const_int 0)] UNSPECV_VSWAPMOV)] Paolo

Re: MSVC hook function prologue

2009-09-04 Thread Stefan Dösinger
Am Thursday 03 September 2009 00:04:43 schrieb Paolo Bonzini: > (define_insn "vswapmov" > [(set (match_operand 0 "register_operand" "0") >(match_operand 1 "register_operand" "1") > (unspec_volatile [] UNSPECV_VSWAPMOV)] I ran into a problem with this: build/genattrtab doesn't like the emp

Re: MSVC hook function prologue

2009-09-03 Thread Paolo Bonzini
I don't know, I was just reworking Stefan's patch. He didn't include function names (-p) in the patch so I don't know what function this is part of. It was ix86_handle_abi_attribute. I'm usually using git, and don't like cvs and svn too much. It seems svn diff doesn't support a -p option here. M

Re: MSVC hook function prologue

2009-09-03 Thread Stefan Dösinger
Am Thursday 03 September 2009 00:04:43 schrieb Paolo Bonzini: >> *) The stack alignment code + msvc_prologue is used by Wine on osx though. >> ... > I don't think this would prevent the patch from getting the patch in. Ok, I'll read the patch contribution guidelines again and hope for the best. I

Re: MSVC hook function prologue

2009-09-02 Thread Paolo Bonzini
On 09/03/2009 12:27 AM, Kai Tietz wrote: 2009/9/3 Paolo Bonzini: if (TARGET_64BIT ? !is_attribute_p ("msvc_prologue", name)) : is_attribute_p ("msvc_prologue", name)) { warning (OPT_Wattributes, "%qE attribute not available for " "%d-bit", name, TARGE

Re: MSVC hook function prologue

2009-09-02 Thread Kai Tietz
2009/9/3 Paolo Bonzini : >   if (TARGET_64BIT >       ? !is_attribute_p ("msvc_prologue", name)) >       : is_attribute_p ("msvc_prologue", name)) >     { >       warning (OPT_Wattributes, "%qE attribute not available for " >                "%d-bit", name, TARGET_64BIT ? 64 : 32); >       *no_add_a

Re: MSVC hook function prologue

2009-09-02 Thread Paolo Bonzini
Currently I still have these problems: *) There is apparently some plugin framework in the works. Can this functionality implemented as a plugin? No, plugins do not affect the backend. *) The stack alignment code + msvc_prologue is used by Wine on osx though. Currently I pop %ebp after the 5 b

MSVC hook function prologue

2009-09-02 Thread Stefan Dösinger
Hello, After a rather long break due to other work I tried to revive my work on support for the function prologue used in Win32 API functions on Windows - a function prologue that some apps running in Wine expect. This thread from January explains what I am trying to do: http://gcc.gnu.org/ml/gc