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

Matt Turner mattst88 at gmail.com
Thu Nov 6 17:27:50 PST 2014


On Thu, Nov 6, 2014 at 1:30 AM, Siavash Eliasi <siavashserver at gmail.com> wrote:
> How and when is "cpu_has_sse4_1" true? Is it controllable at runtime through
> setting some environmental variable? or is it set once during startup by
> detecting CPU features?

It's actually a macro, but yes, see the end of
src/mesa/x86/common_x86.c. It's set by using the CPUID instruction to
detect SSE 4.1 capabilities.

      if (ecx & bit_SSE4_1)
         _mesa_x86_cpu_features |= X86_FEATURE_SSE4_1;

> 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.

Right.


More information about the mesa-dev mailing list