[Mesa-dev] [prefix=PATCH v3 1/3] util: Add a bitcount.h file and move stuff from both mesa and gallium to it

Ilia Mirkin imirkin at alum.mit.edu
Thu Oct 30 08:15:45 PDT 2014


On Wed, Oct 29, 2014 at 8:25 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
> index 719f980..e4d4126 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
> @@ -23,10 +23,7 @@
>  #include "codegen/nv50_ir.h"
>  #include "codegen/nv50_ir_target.h"
>  #include "codegen/nv50_ir_build_util.h"
> -
> -extern "C" {
> -#include "util/u_math.h"
> -}
> +#include "util/bitcount.h"

u_math.h is needed here. It defines things like cosf/etc whose
availability is normalized by u_math.h.

By the way... is there a reason not to just include util/bitcount.h
from util/u_math.h and avoid all this heartache?

>
>  namespace nv50_ir {
>
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_util.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_util.cpp
> index d26acb3..d6cef37 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_util.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_util.cpp
> @@ -21,6 +21,7 @@
>   */
>
>  #include "codegen/nv50_ir_util.h"
> +#include "util/bitcount.h"
>
>  namespace nv50_ir {
>
> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> index 825e0ba..e1a302f 100644
> --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> @@ -26,6 +26,7 @@
>  #include "util/u_format.h"
>  #include "util/u_format_s3tc.h"
>  #include "pipe/p_screen.h"
> +#include "util/bitcount.h"
>
>  #include "nv50/nv50_context.h"
>  #include "nv50/nv50_screen.h"
> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c b/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
> index c698782..9457661 100644
> --- a/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
> +++ b/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
> @@ -25,6 +25,7 @@
>  #include "pipe/p_defines.h"
>  #include "pipe/p_state.h"
>  #include "util/u_inlines.h"
> +#include "util/bitcount.h"
>
>  #include "nv50/nv50_context.h"
>


More information about the mesa-dev mailing list