[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a3_Q15hKT=gyupb0FrPX1xV3tEBpVaYy1LF0kMUj2u8hw@mail.gmail.com>
Date: Tue, 15 Oct 2019 09:19:04 +0200
From: Arnd Bergmann <arnd@...db.de>
To: "S, Shirish" <sshankar@....com>
Cc: Nick Desaulniers <ndesaulniers@...gle.com>,
"Wentland, Harry" <Harry.Wentland@....com>,
"Deucher, Alexander" <Alexander.Deucher@....com>,
"yshuiv7@...il.com" <yshuiv7@...il.com>,
"andrew.cooper3@...rix.com" <andrew.cooper3@...rix.com>,
clang-built-linux <clang-built-linux@...glegroups.com>,
Matthias Kaehlcke <mka@...gle.com>,
"S, Shirish" <Shirish.S@....com>,
"Zhou, David(ChunMing)" <David1.Zhou@....com>,
"Koenig, Christian" <Christian.Koenig@....com>,
amd-gfx list <amd-gfx@...ts.freedesktop.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: AMDGPU and 16B stack alignment
On Tue, Oct 15, 2019 at 9:08 AM S, Shirish <sshankar@....com> wrote:
> On 10/15/2019 3:52 AM, Nick Desaulniers wrote:
> My gcc build fails with below errors:
>
> dcn_calcs.c:1:0: error: -mpreferred-stack-boundary=3 is not between 4 and 12
>
> dcn_calc_math.c:1:0: error: -mpreferred-stack-boundary=3 is not between 4 and 12
>
> While GPF observed on clang builds seem to be fixed.
Ok, so it seems that gcc insists on having at least 2^4 bytes stack
alignment when
SSE is enabled on x86-64, but does not actually rely on that for
correct operation
unless it's using sse2. So -msse always has to be paired with
-mpreferred-stack-boundary=3.
For clang, it sounds like the opposite is true: when passing 16 byte
stack alignment
and having sse/sse2 enabled, it requires the incoming stack to be 16
byte aligned,
but passing 8 byte alignment makes it do the right thing.
So, should we just always pass $(call cc-option, -mpreferred-stack-boundary=4)
to get the desired outcome on both?
Arnd
Powered by blists - more mailing lists