Re: -freg-struct-return?

2007-02-22 Thread Andi Kleen
> To some degree linux-arch would be a good list for it, but it's closed, > even to monitor. linux-arch is only for architecture code, but yes it serves a similar purpose. But it's very specialized. What is discussed there is unlikely to be of much interest to most people. I was thinking of a

Re: [patch] x86: add -freg-struct-return to CFLAGS

2007-02-22 Thread H. Peter Anvin
+= -pipe -msoft-float -mregparm=3 -freg-struct-return # prevent gcc from keeping the stack 16 byte aligned CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2) Why is this i386 specific? Because virtually all other architectures have it as their ABI default, anyway, and ABI selection should

Re: -freg-struct-return?

2007-02-22 Thread H. Peter Anvin
Jan Engelhardt wrote: On Feb 22 2007 19:36, Andi Kleen wrote: BTW would it make sense to have a special announcement list for such changes? A changelog in the kernel tree would be helpful. A real changelog that is, not that info blob located at /Documentation/Changes. I presume you're

Re: -freg-struct-return?

2007-02-22 Thread Jan Engelhardt
On Feb 22 2007 19:36, Andi Kleen wrote: > >BTW would it make sense to have a special announcement list for such changes? A changelog in the kernel tree would be helpful. A real changelog that is, not that info blob located at /Documentation/Changes. Jan -- - To unsubscribe from this list:

Re: -freg-struct-return?

2007-02-22 Thread H. Peter Anvin
Andi Kleen wrote: On Thu, Feb 22, 2007 at 09:39:04AM -0800, Jeremy Fitzhardinge wrote: H. Peter Anvin wrote: Sometimes returning small structures is really nice. If you can pass them in registers, it's often generates the fastest possible code; much better than using a pointer. Yes, but

Re: [patch] x86: add -freg-struct-return to CFLAGS

2007-02-22 Thread Adrian Bunk
gt; +CFLAGS += -pipe -msoft-float -mregparm=3 -freg-struct-return > > # prevent gcc from keeping the stack 16 byte aligned > CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2) Why is this i386 specific? cu Adrian -- "Is there not promise of rain?" Ling

Re: -freg-struct-return?

2007-02-22 Thread Andi Kleen
On Thu, Feb 22, 2007 at 09:39:04AM -0800, Jeremy Fitzhardinge wrote: > H. Peter Anvin wrote: > > Sometimes returning small structures is really nice. If you can pass > > them in registers, it's often generates the fastest possible code; > > much better than using a pointer. > > Yes, but

Re: -freg-struct-return?

2007-02-22 Thread Jeremy Fitzhardinge
H. Peter Anvin wrote: > Sometimes returning small structures is really nice. If you can pass > them in registers, it's often generates the fastest possible code; > much better than using a pointer. Yes, but specifically, are there any pieces of assembler which return structures? It appears

Re: -freg-struct-return?

2007-02-22 Thread H. Peter Anvin
Andi Kleen wrote: I didn't think we had any that returned structures. Sometimes returning small structures is really nice. If you can pass them in registers, it's often generates the fastest possible code; much better than using a pointer. -hpa - To unsubscribe from this list:

Re: [patch] x86: add -freg-struct-return to CFLAGS

2007-02-22 Thread Arjan van de Ven
> I guess people maintaining external Makefiles without Kbuild > are in for a nasty surprise again though. that 1) shouldn't be needed at all for 2.6 and 2) is fragile as heck no matter, I don't think anyone still is doing that... I sure hope that if anyone still does it that they have no users

Re: [patch] x86: add -freg-struct-return to CFLAGS

2007-02-22 Thread Andi Kleen
On Thu, Feb 22, 2007 at 09:38:22AM +0100, Ingo Molnar wrote: > Subject: [patch] x86: add -freg-struct-return to CFLAGS > From: Ingo Molnar <[EMAIL PROTECTED]> > > Jeremy Fitzhardinge suggested the use of -freg-struct-return, which does > structure-returns (such as when usin

Re: -freg-struct-return?

2007-02-22 Thread Andi Kleen
On Thu, Feb 22, 2007 at 12:09:04AM -0800, Jeremy Fitzhardinge wrote: > Arjan van de Ven wrote: > > Do we know how many gcc bugs this has? (regparm used to have many) > > other than that.. sounds like a win... > > > > The documentation suggests that its the preferred mode of operation, and >

Re: -freg-struct-return?

2007-02-22 Thread Jakub Jelinek
On Thu, Feb 22, 2007 at 12:09:04AM -0800, Jeremy Fitzhardinge wrote: > Arjan van de Ven wrote: > > Do we know how many gcc bugs this has? (regparm used to have many) > > other than that.. sounds like a win... > > > > The documentation suggests that its the preferred mode of operation, and >

[patch] x86: add -freg-struct-return to CFLAGS

2007-02-22 Thread Ingo Molnar
Subject: [patch] x86: add -freg-struct-return to CFLAGS From: Ingo Molnar <[EMAIL PROTECTED]> Jeremy Fitzhardinge suggested the use of -freg-struct-return, which does structure-returns (such as when using pte_t) in registers instead of on the stack. that is indeed so, and this option r

Re: -freg-struct-return?

2007-02-22 Thread Ingo Molnar
* Arjan van de Ven <[EMAIL PROTECTED]> wrote: > > Do we have much assembler which cares about the struct return > > calling convention? If not, it should be a fairly easy test. > > is there an attribute to turn it off? because if so we should just > make that part of "asmlinkage" (not

Re: -freg-struct-return?

2007-02-22 Thread Jeremy Fitzhardinge
" (not that I know much code using structs > in asm) > There doesn't appear to be; just -freg-struct-return and -fpcc-struct-return. J - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordom

Re: -freg-struct-return?

2007-02-22 Thread Arjan van de Ven
> Do we have much assembler which cares about the struct return calling > convention? If not, it should be a fairly easy test. is there an attribute to turn it off? because if so we should just make that part of "asmlinkage" (not that I know much code using structs in asm) -- if you want

Re: -freg-struct-return?

2007-02-22 Thread Jeremy Fitzhardinge
Arjan van de Ven wrote: > Do we know how many gcc bugs this has? (regparm used to have many) > other than that.. sounds like a win... > The documentation suggests that its the preferred mode of operation, and that its the default on platforms where gcc is the primary compiler. So the fact

Re: -freg-struct-return?

2007-02-22 Thread Arjan van de Ven
On Wed, 2007-02-21 at 17:28 -0800, Jeremy Fitzhardinge wrote: > We have a number of functions which return small structures (such as > pte_t). It seems that the kernel is not compiled with > -freg-struct-return, so all these small structures are being returned > via the stack,

Re: -freg-struct-return?

2007-02-22 Thread Arjan van de Ven
On Wed, 2007-02-21 at 17:28 -0800, Jeremy Fitzhardinge wrote: We have a number of functions which return small structures (such as pte_t). It seems that the kernel is not compiled with -freg-struct-return, so all these small structures are being returned via the stack, even though they would

Re: -freg-struct-return?

2007-02-22 Thread Jeremy Fitzhardinge
Arjan van de Ven wrote: Do we know how many gcc bugs this has? (regparm used to have many) other than that.. sounds like a win... The documentation suggests that its the preferred mode of operation, and that its the default on platforms where gcc is the primary compiler. So the fact that

Re: -freg-struct-return?

2007-02-22 Thread Arjan van de Ven
Do we have much assembler which cares about the struct return calling convention? If not, it should be a fairly easy test. is there an attribute to turn it off? because if so we should just make that part of asmlinkage (not that I know much code using structs in asm) -- if you want to

Re: -freg-struct-return?

2007-02-22 Thread Jeremy Fitzhardinge
structs in asm) There doesn't appear to be; just -freg-struct-return and -fpcc-struct-return. J - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read

Re: -freg-struct-return?

2007-02-22 Thread Ingo Molnar
* Arjan van de Ven [EMAIL PROTECTED] wrote: Do we have much assembler which cares about the struct return calling convention? If not, it should be a fairly easy test. is there an attribute to turn it off? because if so we should just make that part of asmlinkage (not that I know

[patch] x86: add -freg-struct-return to CFLAGS

2007-02-22 Thread Ingo Molnar
Subject: [patch] x86: add -freg-struct-return to CFLAGS From: Ingo Molnar [EMAIL PROTECTED] Jeremy Fitzhardinge suggested the use of -freg-struct-return, which does structure-returns (such as when using pte_t) in registers instead of on the stack. that is indeed so, and this option reduced

Re: -freg-struct-return?

2007-02-22 Thread Jakub Jelinek
On Thu, Feb 22, 2007 at 12:09:04AM -0800, Jeremy Fitzhardinge wrote: Arjan van de Ven wrote: Do we know how many gcc bugs this has? (regparm used to have many) other than that.. sounds like a win... The documentation suggests that its the preferred mode of operation, and that its the

Re: -freg-struct-return?

2007-02-22 Thread Andi Kleen
On Thu, Feb 22, 2007 at 12:09:04AM -0800, Jeremy Fitzhardinge wrote: Arjan van de Ven wrote: Do we know how many gcc bugs this has? (regparm used to have many) other than that.. sounds like a win... The documentation suggests that its the preferred mode of operation, and that its the

Re: [patch] x86: add -freg-struct-return to CFLAGS

2007-02-22 Thread Andi Kleen
On Thu, Feb 22, 2007 at 09:38:22AM +0100, Ingo Molnar wrote: Subject: [patch] x86: add -freg-struct-return to CFLAGS From: Ingo Molnar [EMAIL PROTECTED] Jeremy Fitzhardinge suggested the use of -freg-struct-return, which does structure-returns (such as when using pte_t) in registers instead

Re: [patch] x86: add -freg-struct-return to CFLAGS

2007-02-22 Thread Arjan van de Ven
I guess people maintaining external Makefiles without Kbuild are in for a nasty surprise again though. that 1) shouldn't be needed at all for 2.6 and 2) is fragile as heck no matter, I don't think anyone still is doing that... I sure hope that if anyone still does it that they have no users

Re: -freg-struct-return?

2007-02-22 Thread H. Peter Anvin
Andi Kleen wrote: I didn't think we had any that returned structures. Sometimes returning small structures is really nice. If you can pass them in registers, it's often generates the fastest possible code; much better than using a pointer. -hpa - To unsubscribe from this list:

Re: -freg-struct-return?

2007-02-22 Thread Jeremy Fitzhardinge
H. Peter Anvin wrote: Sometimes returning small structures is really nice. If you can pass them in registers, it's often generates the fastest possible code; much better than using a pointer. Yes, but specifically, are there any pieces of assembler which return structures? It appears there

Re: [patch] x86: add -freg-struct-return to CFLAGS

2007-02-22 Thread Adrian Bunk
-mregparm=3 -freg-struct-return # prevent gcc from keeping the stack 16 byte aligned CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2) Why is this i386 specific? cu Adrian -- Is there not promise of rain? Ling Tan asked suddenly out of the darkness. There had been

Re: -freg-struct-return?

2007-02-22 Thread Andi Kleen
On Thu, Feb 22, 2007 at 09:39:04AM -0800, Jeremy Fitzhardinge wrote: H. Peter Anvin wrote: Sometimes returning small structures is really nice. If you can pass them in registers, it's often generates the fastest possible code; much better than using a pointer. Yes, but specifically,

Re: -freg-struct-return?

2007-02-22 Thread H. Peter Anvin
Andi Kleen wrote: On Thu, Feb 22, 2007 at 09:39:04AM -0800, Jeremy Fitzhardinge wrote: H. Peter Anvin wrote: Sometimes returning small structures is really nice. If you can pass them in registers, it's often generates the fastest possible code; much better than using a pointer. Yes, but

Re: -freg-struct-return?

2007-02-22 Thread Jan Engelhardt
On Feb 22 2007 19:36, Andi Kleen wrote: BTW would it make sense to have a special announcement list for such changes? A changelog in the kernel tree would be helpful. A real changelog that is, not that info blob located at /Documentation/Changes. Jan -- - To unsubscribe from this list: send

Re: -freg-struct-return?

2007-02-22 Thread H. Peter Anvin
Jan Engelhardt wrote: On Feb 22 2007 19:36, Andi Kleen wrote: BTW would it make sense to have a special announcement list for such changes? A changelog in the kernel tree would be helpful. A real changelog that is, not that info blob located at /Documentation/Changes. I presume you're

Re: [patch] x86: add -freg-struct-return to CFLAGS

2007-02-22 Thread H. Peter Anvin
+= -pipe -msoft-float -mregparm=3 -freg-struct-return # prevent gcc from keeping the stack 16 byte aligned CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2) Why is this i386 specific? Because virtually all other architectures have it as their ABI default, anyway, and ABI selection should

Re: -freg-struct-return?

2007-02-22 Thread Andi Kleen
To some degree linux-arch would be a good list for it, but it's closed, even to monitor. linux-arch is only for architecture code, but yes it serves a similar purpose. But it's very specialized. What is discussed there is unlikely to be of much interest to most people. I was thinking of a

-freg-struct-return?

2007-02-21 Thread Jeremy Fitzhardinge
We have a number of functions which return small structures (such as pte_t). It seems that the kernel is not compiled with -freg-struct-return, so all these small structures are being returned via the stack, even though they would fit into registers. Is there a reason for this? Would -freg

-freg-struct-return?

2007-02-21 Thread Jeremy Fitzhardinge
We have a number of functions which return small structures (such as pte_t). It seems that the kernel is not compiled with -freg-struct-return, so all these small structures are being returned via the stack, even though they would fit into registers. Is there a reason for this? Would -freg