[Mesa-dev] [PATCH v1 1/5] meson: compilation flags for sse

Eric Engestrom eric.engestrom at intel.com
Mon Oct 29 09:35:22 UTC 2018


On Monday, 2018-10-29 10:44:28 +0200, Sergii Romantsov wrote:
> Hello,
> >
> > What problem are we solving?
> 
> That we don't get fast paths in rounding.h by default on i686, I think?
> 
> Yes, it adds optimization for rounding.h. On x86_64 msse is enabled by
> default (as example by gcc).
> And additionally helps to fix autotools 32b build (missed linkage with
> m-lib if no optimization).
> 
> This will make the code non-portable from an SSE capable system to a non-sse
> > capable system. That's a pretty old system at this point (Pentium III and
> > Athlon
> > XP)
> 
> As i found in gcc-docs (
> https://gcc.gnu.org/onlinedocs/gcc-4.5.3/gcc/i386-and-x86_002d64-Options.html)
> exactly mentioned systems are supports SSE.
> But in the patch i'm checking if -msse supported by compiler.
> If its incorrect than does it mean that compiler doesn't based on system
> capabilities? And does it mean that adding option -msse4.1 is also enabled
> in wrong way?

No, the issue is that you need to compile it yourself for this logic to
apply, which is not the case for end users: they get pre-built binaries
from their distribution.

In that situation, a distribution packager with a recent CPU would now
build Mesa with SSE used, which would then be unusable by distribution
users with less recent CPUs.

As Dylan mentioned, these "less recent CPUs" that are not sse-capable
are quite old by now, but many distributions still aim to support them,
so if your change were to land in Mesa upstream, these distributions
would have to revert it and carry that patch around.

Something like 11b1afdc92db98e93f2c "i965/tiled_memcpy: inline movntdqa
loads in tiled_to_linear" might work here though?

> 
> I'm cloning gcc to check how it supports 'sse' and if it based on system
> capabilities. Also we may try to add some possibility to check
> cpu-capabilities (around cpuid).
> But if we don't need such optimization, than it will be nice at least to
> fix autotools 32b build (https://patchwork.freedesktop.org/patch/258659/) -
> i will update patch just by linking -lm with mesautil.
> 
> Please, advise.
> 
> On Fri, Oct 26, 2018 at 9:54 PM Dylan Baker <dylan at pnwbakers.com> wrote:
> 
> > Quoting Matt Turner (2018-10-26 10:44:47)
> > > On Fri, Oct 26, 2018 at 3:06 AM Sergii Romantsov
> > > <sergii.romantsov at gmail.com> wrote:
> > > >
> > > > While building of 32bit Mesa gcc doesn't specifies __SSE__ by default.
> > > > So it has to be done manually by flag '-msee'.
> > > > Added support of such specification to build-system.
> > > >
> > > > CC: Dylan Baker <dylan at pnwbakers.com>
> > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108560
> > > > Signed-off-by: Sergii Romantsov <sergii.romantsov at globallogic.com>
> > >
> > > We can't do that.
> > >
> > > Maybe I'm missing some context. What problem are we solving?
> >
> > That we don't get fast paths in rounding.h by default on i686, I think?
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
> 
> 
> -- 
> Sergii Romantsov
> GlobalLogic Inc.
> www.globallogic.com


More information about the mesa-dev mailing list