From c3b66566760dd44eaeed9e4df13687dc3ee69bd9 Mon Sep 17 00:00:00 2001 From: Mathias Fröhlich Date: Thu, 9 Jun 2016 06:35:34 +0200 Subject: mesa/gallium: Move u_bit_scan{,64} from gallium to util. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The functions are also useful for mesa. Introduce src/util/bitscan.{h,c}. Move ffs function implementations from src/mesa/main/imports.{h,c}. Move bit scan related functions from src/gallium/auxiliary/util/u_math.h. Merge platform handling with what is available from within mesa. v2: Try to fix MSVC compile. Reviewed-by: Brian Paul Tested-by: Brian Paul Signed-off-by: Mathias Fröhlich --- src/mesa/main/imports.h | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'src/mesa/main/imports.h') diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index d96d666e15f..4ff5941487f 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -42,6 +42,7 @@ #include "compiler.h" #include "glheader.h" #include "errors.h" +#include "util/bitscan.h" #ifdef __cplusplus extern "C" { @@ -324,22 +325,6 @@ extern void _mesa_exec_free( void *addr ); -#ifndef FFS_DEFINED -#define FFS_DEFINED 1 -#ifdef HAVE___BUILTIN_FFS -#define ffs __builtin_ffs -#else -extern int ffs(int i); -#endif - -#ifdef HAVE___BUILTIN_FFSLL -#define ffsll __builtin_ffsll -#else -extern int ffsll(long long int i); -#endif -#endif /* FFS_DEFINED */ - - #ifdef HAVE___BUILTIN_POPCOUNT #define _mesa_bitcount(i) __builtin_popcount(i) #else -- cgit v1.2.3