Re: gcc feature request / RFC: extra clobbered regs

2015-07-01 Thread H. Peter Anvin
On 07/01/2015 10:43 AM, Jakub Jelinek wrote: > On Wed, Jul 01, 2015 at 01:35:16PM -0400, Vladimir Makarov wrote: >> Actually it raise a question for me. If we describe that a function >> clobbers more than calling convention and then use it as a value (assigning >> a variable or passing as an argu

Re: gcc feature request / RFC: extra clobbered regs

2015-07-01 Thread Andy Lutomirski
On Wed, Jul 1, 2015 at 10:43 AM, Jakub Jelinek wrote: > On Wed, Jul 01, 2015 at 01:35:16PM -0400, Vladimir Makarov wrote: >> Actually it raise a question for me. If we describe that a function >> clobbers more than calling convention and then use it as a value (assigning >> a variable or passing

Re: gcc feature request / RFC: extra clobbered regs

2015-07-01 Thread Vladimir Makarov
On 07/01/2015 01:43 PM, Jakub Jelinek wrote: On Wed, Jul 01, 2015 at 01:35:16PM -0400, Vladimir Makarov wrote: Actually it raise a question for me. If we describe that a function clobbers more than calling convention and then use it as a value (assigning a variable or passing as an argument)

Re: gcc feature request / RFC: extra clobbered regs

2015-07-01 Thread Vladimir Makarov
On 07/01/2015 11:27 AM, Andy Lutomirski wrote: On Wed, Jul 1, 2015 at 8:23 AM, Vladimir Makarov wrote: On 06/30/2015 05:37 PM, Jakub Jelinek wrote: On Tue, Jun 30, 2015 at 02:22:33PM -0700, Andy Lutomirski wrote: I'm working on a massive set of cleanups to Linux's syscall handling. We curr

Re: gcc feature request / RFC: extra clobbered regs

2015-07-01 Thread Jakub Jelinek
On Wed, Jul 01, 2015 at 01:35:16PM -0400, Vladimir Makarov wrote: > Actually it raise a question for me. If we describe that a function > clobbers more than calling convention and then use it as a value (assigning > a variable or passing as an argument) and loosing a track of it and than > call it

Re: gcc feature request / RFC: extra clobbered regs

2015-07-01 Thread Andy Lutomirski
On Wed, Jul 1, 2015 at 10:35 AM, Vladimir Makarov wrote: > Actually it raise a question for me. If we describe that a function > clobbers more than calling convention and then use it as a value (assigning > a variable or passing as an argument) and loosing a track of it and than > call it. How c

Re: gcc feature request / RFC: extra clobbered regs

2015-07-01 Thread Vladimir Makarov
On 07/01/2015 11:31 AM, Jakub Jelinek wrote: On Wed, Jul 01, 2015 at 11:23:17AM -0400, Vladimir Makarov wrote: (I'm not necessarily suggesting that we do this for the syscall bodies themselves. I want to do it for the entry and exit helpers, so we'd still lose the five cycles in the full fast

Re: gcc feature request / RFC: extra clobbered regs

2015-07-01 Thread Jakub Jelinek
On Wed, Jul 01, 2015 at 11:23:17AM -0400, Vladimir Makarov wrote: > >>(I'm not necessarily suggesting that we do this for the syscall bodies > >>themselves. I want to do it for the entry and exit helpers, so we'd > >>still lose the five cycles in the full fast-path case, but we'd do > >>better in

Re: gcc feature request / RFC: extra clobbered regs

2015-07-01 Thread Andy Lutomirski
On Wed, Jul 1, 2015 at 8:23 AM, Vladimir Makarov wrote: > > > On 06/30/2015 05:37 PM, Jakub Jelinek wrote: >> >> On Tue, Jun 30, 2015 at 02:22:33PM -0700, Andy Lutomirski wrote: >>> >>> I'm working on a massive set of cleanups to Linux's syscall handling. >>> We currently have a nasty optimization

Re: gcc feature request / RFC: extra clobbered regs

2015-07-01 Thread Vladimir Makarov
On 06/30/2015 05:37 PM, Jakub Jelinek wrote: On Tue, Jun 30, 2015 at 02:22:33PM -0700, Andy Lutomirski wrote: I'm working on a massive set of cleanups to Linux's syscall handling. We currently have a nasty optimization in which we don't save rbx, rbp, r12, r13, r14, and r15 on x86_64 before ca

Re: gcc feature request / RFC: extra clobbered regs

2015-06-30 Thread Jeff Law
On 06/30/2015 04:02 PM, H. Peter Anvin wrote: On 06/30/2015 02:55 PM, Andy Lutomirski wrote: On Tue, Jun 30, 2015 at 2:52 PM, H. Peter Anvin wrote: On 06/30/2015 02:48 PM, Andy Lutomirski wrote: On Tue, Jun 30, 2015 at 2:41 PM, H. Peter Anvin wrote: On 06/30/2015 02:37 PM, Jakub Jelinek wro

Re: gcc feature request / RFC: extra clobbered regs

2015-06-30 Thread H. Peter Anvin
On 06/30/2015 02:55 PM, Andy Lutomirski wrote: > On Tue, Jun 30, 2015 at 2:52 PM, H. Peter Anvin wrote: >> On 06/30/2015 02:48 PM, Andy Lutomirski wrote: >>> On Tue, Jun 30, 2015 at 2:41 PM, H. Peter Anvin wrote: On 06/30/2015 02:37 PM, Jakub Jelinek wrote: > I'd say the most natural API

Re: gcc feature request / RFC: extra clobbered regs

2015-06-30 Thread Andy Lutomirski
On Tue, Jun 30, 2015 at 2:52 PM, H. Peter Anvin wrote: > On 06/30/2015 02:48 PM, Andy Lutomirski wrote: >> On Tue, Jun 30, 2015 at 2:41 PM, H. Peter Anvin wrote: >>> On 06/30/2015 02:37 PM, Jakub Jelinek wrote: I'd say the most natural API for this would be to allow f{fixed,call-{used,s

Re: gcc feature request / RFC: extra clobbered regs

2015-06-30 Thread H. Peter Anvin
On 06/30/2015 02:48 PM, Andy Lutomirski wrote: > On Tue, Jun 30, 2015 at 2:41 PM, H. Peter Anvin wrote: >> On 06/30/2015 02:37 PM, Jakub Jelinek wrote: >>> I'd say the most natural API for this would be to allow >>> f{fixed,call-{used,saved}}-REG in target attribute. >> >> Either that or >> >>

Re: gcc feature request / RFC: extra clobbered regs

2015-06-30 Thread Andy Lutomirski
On Tue, Jun 30, 2015 at 2:41 PM, H. Peter Anvin wrote: > On 06/30/2015 02:37 PM, Jakub Jelinek wrote: >> I'd say the most natural API for this would be to allow >> f{fixed,call-{used,saved}}-REG in target attribute. > > Either that or > > __attribute__((fixed(rbp,rcx),used(rax,rbx),saved(r

Re: gcc feature request / RFC: extra clobbered regs

2015-06-30 Thread H. Peter Anvin
On 06/30/2015 02:37 PM, Jakub Jelinek wrote: > I'd say the most natural API for this would be to allow > f{fixed,call-{used,saved}}-REG in target attribute. Either that or __attribute__((fixed(rbp,rcx),used(rax,rbx),saved(r11))) ... just to be shorter. Either way, I would consider this

Re: gcc feature request / RFC: extra clobbered regs

2015-06-30 Thread Jakub Jelinek
On Tue, Jun 30, 2015 at 02:22:33PM -0700, Andy Lutomirski wrote: > I'm working on a massive set of cleanups to Linux's syscall handling. > We currently have a nasty optimization in which we don't save rbx, > rbp, r12, r13, r14, and r15 on x86_64 before calling C functions. > This works, but it make

Re: gcc feature request / RFC: extra clobbered regs

2015-06-30 Thread H. Peter Anvin
On 06/30/2015 02:22 PM, Andy Lutomirski wrote: > Hi all- > > I'm working on a massive set of cleanups to Linux's syscall handling. > We currently have a nasty optimization in which we don't save rbx, > rbp, r12, r13, r14, and r15 on x86_64 before calling C functions. > This works, but it makes the

gcc feature request / RFC: extra clobbered regs

2015-06-30 Thread Andy Lutomirski
Hi all- I'm working on a massive set of cleanups to Linux's syscall handling. We currently have a nasty optimization in which we don't save rbx, rbp, r12, r13, r14, and r15 on x86_64 before calling C functions. This works, but it makes the code a huge mess. I'd rather save all regs in asm and the