Re: [PATCH] x86: Fix detection of GCC -mpreferred-stack-boundary support

2015-07-06 Thread Raymond Jennings
On Mon, 2015-07-06 at 10:59 -0700, Andy Lutomirski wrote: > On Mon, Jul 6, 2015 at 10:40 AM, Ingo Molnar wrote: > > > > * Andy Lutomirski wrote: > > > >> > My reasoning: on modern uarchs there's no penalty for 32-bit > >> > misalignment of > >> > 64-bit variables, only if they cross 64-byte cach

Re: [PATCH] x86: Fix detection of GCC -mpreferred-stack-boundary support

2015-07-06 Thread Andy Lutomirski
On Mon, Jul 6, 2015 at 10:40 AM, Ingo Molnar wrote: > > * Andy Lutomirski wrote: > >> > My reasoning: on modern uarchs there's no penalty for 32-bit misalignment >> > of >> > 64-bit variables, only if they cross 64-byte cache lines, which should be >> > rare >> > with a chance of 1:16. This sma

Re: [PATCH] x86: Fix detection of GCC -mpreferred-stack-boundary support

2015-07-06 Thread Ingo Molnar
* Andy Lutomirski wrote: > > My reasoning: on modern uarchs there's no penalty for 32-bit misalignment > > of > > 64-bit variables, only if they cross 64-byte cache lines, which should be > > rare > > with a chance of 1:16. This small penalty (of at most +1 cycle in some > > circumstances I

Re: [PATCH] x86: Fix detection of GCC -mpreferred-stack-boundary support

2015-07-06 Thread Ingo Molnar
* Linus Torvalds wrote: > On Mon, Jul 6, 2015 at 6:44 AM, Ingo Molnar wrote: > > > > So looking at this I question the choice of -mpreferred-stack-boundary=3. > > Why > > not do -mpreferred-stack-boundary=2? > > It wouldn't make sense anyway - it would only make code worse (if it worked) >

Re: [PATCH] x86: Fix detection of GCC -mpreferred-stack-boundary support

2015-07-06 Thread Linus Torvalds
On Mon, Jul 6, 2015 at 6:44 AM, Ingo Molnar wrote: > > So looking at this I question the choice of -mpreferred-stack-boundary=3. Why > not > do -mpreferred-stack-boundary=2? It wouldn't make sense anyway - it would only make code worse (if it worked) and not any better. The reason the "=3" valu

Re: [PATCH] x86: Fix detection of GCC -mpreferred-stack-boundary support

2015-07-06 Thread Andy Lutomirski
On Mon, Jul 6, 2015 at 6:44 AM, Ingo Molnar wrote: > > * Andy Lutomirski wrote: > >> As per https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383, GCC only >> allows -mpreferred-stack-boundary=3 on x86_64 if -mno-sse is set. >> That means that cc-option will not detect >> -mpreferred-stack-boundary=

Re: [PATCH] x86: Fix detection of GCC -mpreferred-stack-boundary support

2015-07-06 Thread Ingo Molnar
* Andy Lutomirski wrote: > As per https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383, GCC only > allows -mpreferred-stack-boundary=3 on x86_64 if -mno-sse is set. > That means that cc-option will not detect > -mpreferred-stack-boundary=3 support, because we test for it before > setting -mno-sse.

[PATCH] x86: Fix detection of GCC -mpreferred-stack-boundary support

2015-07-05 Thread Andy Lutomirski
As per https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383, GCC only allows -mpreferred-stack-boundary=3 on x86_64 if -mno-sse is set. That means that cc-option will not detect -mpreferred-stack-boundary=3 support, because we test for it before setting -mno-sse. Fix it by reordering the Makefile bi