util: Do not use __builtin_clrsb with Intel C++ Compiler.
authorVinson Lee <vlee@freedesktop.org>
Sat, 31 May 2014 02:40:26 +0000 (19:40 -0700)
committerVinson Lee <vlee@freedesktop.org>
Sat, 31 May 2014 02:47:35 +0000 (19:47 -0700)
This patch fixes this build error with icc 14.0.2.

In file included from state_tracker/st_glsl_to_tgsi.cpp(63):
../../src/gallium/auxiliary/util/u_math.h(583): error: identifier "__builtin_clrsb" is undefined
     return 31 - __builtin_clrsb(i);
                 ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
src/gallium/auxiliary/util/u_math.h

index 2ade64af4fec4118d5f261052b54ca6c4a0c23f3..b9ed197d72d0a1a3f9db781f6f8a9f3eada4aa60 100644 (file)
@@ -579,7 +579,7 @@ static INLINE unsigned util_last_bit(unsigned u)
  */
 static INLINE unsigned util_last_bit_signed(int i)
 {
-#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 407)
+#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 407) && !defined(__INTEL_COMPILER)
    return 31 - __builtin_clrsb(i);
 #else
    if (i >= 0)