[Mesa-dev] [PATCH V5] mesa: add SSE optimisation for glDrawElements

Timothy Arceri t_arceri at yahoo.com.au
Fri Nov 7 04:46:55 PST 2014


On Fri, 2014-11-07 at 11:44 +0000, Steven Newbury wrote:
> On Thu, 2014-11-06 at 21:00 -0800, Matt Turner wrote:
> > On Thu, Nov 6, 2014 at 8:56 PM, Siavash Eliasi <
> > siavashserver at gmail.com> wrote:
> > > Then I do recommend removing the "if (cpu_has_sse4_1)" from this 
> > > patch and similar places, because there is no runtime CPU 
> > > dispatching happening for SSE optimized code paths in action and 
> > > just adds extra overhead (unnecessary branches) to the generated 
> > > code.
> > 
> > No. Sorry, I realize I misread your previous question:
> > 
> > > > I guess checking for "cpu_has_sse4_1" is unnecessary if it isn't 
> > > > controllable by user at runtime; because "USE_SSE41" is a 
> > > > compile time check and requires the target machine to be SSE 4.1 
> > > > capable already.
> > 
> > USE_SSE41 is set if the *compiler* supports SSE 4.1. This allows you 
> > to build the code and then use it only on systems that actually 
> > support it.
> > 
> > All of this could have been pretty easily answered by a few greps 
> > though...
> 
> I wonder what difference it would make to have an option to compile 
> out the run-time check code to avoid the additional overhead in cases 
> where the builder *knows* at compile time what the run-time system is? 
> (ie Gentoo)

As long as the check is placed in the right location it shouldn't really
make a noticeable difference. i.e. just outside the hotspot and not
inside it. 

Things that will have more impact is not being able to inline certain
code such as in the latest patchset I sent out. It seems this is another
side effect the way gcc handles intrinsics.




More information about the mesa-dev mailing list