Module: Mesa
Branch: master
Commit: 80825abb5d1a7491035880253ffd531c55acae6b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=80825abb5d1a7491035880253ffd531c55acae6b

Author: Dylan Baker <[email protected]>
Date:   Thu Aug 16 17:20:38 2018 -0700

move u_math to src/util

Currently we have two sets of functions for bit counts, one in gallium
and one in core mesa. The ones in core mesa are header only in many
cases, since they reduce to "#define _mesa_bitcount popcount", but they
provide a fallback implementation. This is important because 32bit msvc
doesn't have popcountll, just popcount; so when nir (for example)
includes the core mesa header it doesn't (and shouldn't) link with core
mesa. To fix this we'll promote the version out of gallium util, then
replace the core mesa uses with the util version, since nir (and other
non-core mesa users) can and do link with mesautils.

Acked-by: Eric Engestrom <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>

---

 src/broadcom/cle/v3d_packet_helpers.h       | 2 +-
 src/gallium/auxiliary/Makefile.sources      | 2 --
 src/gallium/auxiliary/meson.build           | 2 --
 src/gallium/auxiliary/util/u_format.c       | 2 +-
 src/gallium/auxiliary/util/u_format_bptc.c  | 2 +-
 src/gallium/auxiliary/util/u_format_latc.c  | 2 +-
 src/gallium/auxiliary/util/u_format_other.c | 2 +-
 src/gallium/auxiliary/util/u_format_pack.py | 2 +-
 src/gallium/auxiliary/util/u_format_rgtc.c  | 2 +-
 src/gallium/auxiliary/util/u_format_s3tc.c  | 2 +-
 src/gallium/auxiliary/util/u_format_yuv.h   | 2 +-
 src/gallium/auxiliary/util/u_format_zs.c    | 2 +-
 src/util/Makefile.sources                   | 2 ++
 src/util/meson.build                        | 2 ++
 src/{gallium/auxiliary => }/util/u_math.c   | 0
 src/{gallium/auxiliary => }/util/u_math.h   | 2 +-
 16 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/broadcom/cle/v3d_packet_helpers.h 
b/src/broadcom/cle/v3d_packet_helpers.h
index f340b79069..c46089a0e6 100644
--- a/src/broadcom/cle/v3d_packet_helpers.h
+++ b/src/broadcom/cle/v3d_packet_helpers.h
@@ -26,7 +26,7 @@
 #include <stdbool.h>
 #include <assert.h>
 #include <math.h>
-#include <gallium/auxiliary/util/u_math.h>
+#include "util/u_math.h"
 
 #ifdef HAVE_VALGRIND
 #include <valgrind.h>
diff --git a/src/gallium/auxiliary/Makefile.sources 
b/src/gallium/auxiliary/Makefile.sources
index d66fa85f79..33d58dedf2 100644
--- a/src/gallium/auxiliary/Makefile.sources
+++ b/src/gallium/auxiliary/Makefile.sources
@@ -294,8 +294,6 @@ C_SOURCES := \
        util/u_linear.h \
        util/u_log.c \
        util/u_log.h \
-       util/u_math.c \
-       util/u_math.h \
        util/u_memory.h \
        util/u_mm.c \
        util/u_mm.h \
diff --git a/src/gallium/auxiliary/meson.build 
b/src/gallium/auxiliary/meson.build
index be558e07b2..9e3673a53c 100644
--- a/src/gallium/auxiliary/meson.build
+++ b/src/gallium/auxiliary/meson.build
@@ -314,8 +314,6 @@ files_libgallium = files(
   'util/u_linear.h',
   'util/u_log.c',
   'util/u_log.h',
-  'util/u_math.c',
-  'util/u_math.h',
   'util/u_memory.h',
   'util/u_mm.c',
   'util/u_mm.h',
diff --git a/src/gallium/auxiliary/util/u_format.c 
b/src/gallium/auxiliary/util/u_format.c
index 1dd724d9b8..6445f2647c 100644
--- a/src/gallium/auxiliary/util/u_format.c
+++ b/src/gallium/auxiliary/util/u_format.c
@@ -32,11 +32,11 @@
  * @author Jose Fonseca <[email protected]>
  */
 
-#include "u_math.h"
 #include "u_memory.h"
 #include "u_format.h"
 #include "u_format_s3tc.h"
 #include "u_surface.h"
+#include "util/u_math.h"
 
 #include "pipe/p_defines.h"
 
diff --git a/src/gallium/auxiliary/util/u_format_bptc.c 
b/src/gallium/auxiliary/util/u_format_bptc.c
index 87ec4139e0..519a541e38 100644
--- a/src/gallium/auxiliary/util/u_format_bptc.c
+++ b/src/gallium/auxiliary/util/u_format_bptc.c
@@ -23,10 +23,10 @@
  *
  **************************************************************************/
 
-#include "u_math.h"
 #include "u_format.h"
 #include "u_format_bptc.h"
 #include "util/format_srgb.h"
+#include "util/u_math.h"
 
 #define BPTC_BLOCK_DECODE
 #include "../../../mesa/main/texcompress_bptc_tmp.h"
diff --git a/src/gallium/auxiliary/util/u_format_latc.c 
b/src/gallium/auxiliary/util/u_format_latc.c
index 7b2bb00693..f145081d56 100644
--- a/src/gallium/auxiliary/util/u_format_latc.c
+++ b/src/gallium/auxiliary/util/u_format_latc.c
@@ -23,11 +23,11 @@
  **************************************************************************/
 
 #include <stdio.h>
-#include "u_math.h"
 #include "u_format.h"
 #include "u_format_rgtc.h"
 #include "u_format_latc.h"
 #include "util/rgtc.h"
+#include "util/u_math.h"
 
 void
 util_format_latc1_unorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, 
unsigned i, unsigned j)
diff --git a/src/gallium/auxiliary/util/u_format_other.c 
b/src/gallium/auxiliary/util/u_format_other.c
index 025e096a95..213cb9fd94 100644
--- a/src/gallium/auxiliary/util/u_format_other.c
+++ b/src/gallium/auxiliary/util/u_format_other.c
@@ -26,8 +26,8 @@
  **************************************************************************/
 
 
-#include "u_math.h"
 #include "u_format_other.h"
+#include "util/u_math.h"
 #include "util/format_rgb9e5.h"
 #include "util/format_r11g11b10f.h"
 
diff --git a/src/gallium/auxiliary/util/u_format_pack.py 
b/src/gallium/auxiliary/util/u_format_pack.py
index c1307d30c2..62e531716c 100644
--- a/src/gallium/auxiliary/util/u_format_pack.py
+++ b/src/gallium/auxiliary/util/u_format_pack.py
@@ -702,7 +702,7 @@ def is_format_hand_written(format):
 def generate(formats):
     print()
     print('#include "pipe/p_compiler.h"')
-    print('#include "u_math.h"')
+    print('#include "util/u_math.h"')
     print('#include "u_half.h"')
     print('#include "u_format.h"')
     print('#include "u_format_other.h"')
diff --git a/src/gallium/auxiliary/util/u_format_rgtc.c 
b/src/gallium/auxiliary/util/u_format_rgtc.c
index da64b63f77..0b98c01a92 100644
--- a/src/gallium/auxiliary/util/u_format_rgtc.c
+++ b/src/gallium/auxiliary/util/u_format_rgtc.c
@@ -23,9 +23,9 @@
  **************************************************************************/
 
 #include <stdio.h>
-#include "u_math.h"
 #include "u_format.h"
 #include "u_format_rgtc.h"
+#include "util/u_math.h"
 #include "util/rgtc.h"
 
 void
diff --git a/src/gallium/auxiliary/util/u_format_s3tc.c 
b/src/gallium/auxiliary/util/u_format_s3tc.c
index 3f755e5363..69ca62a961 100644
--- a/src/gallium/auxiliary/util/u_format_s3tc.c
+++ b/src/gallium/auxiliary/util/u_format_s3tc.c
@@ -24,10 +24,10 @@
  **************************************************************************/
 
 #include "u_dl.h"
-#include "u_math.h"
 #include "u_format.h"
 #include "u_format_s3tc.h"
 #include "util/format_srgb.h"
+#include "util/u_math.h"
 #include "../../../mesa/main/texcompress_s3tc_tmp.h"
 
 
diff --git a/src/gallium/auxiliary/util/u_format_yuv.h 
b/src/gallium/auxiliary/util/u_format_yuv.h
index d8e67b4594..171cbc928d 100644
--- a/src/gallium/auxiliary/util/u_format_yuv.h
+++ b/src/gallium/auxiliary/util/u_format_yuv.h
@@ -46,7 +46,7 @@
 
 
 #include "pipe/p_compiler.h"
-#include "u_math.h"
+#include "util/u_math.h"
 
 
 /*
diff --git a/src/gallium/auxiliary/util/u_format_zs.c 
b/src/gallium/auxiliary/util/u_format_zs.c
index 69f2f2971f..4ad3a0c647 100644
--- a/src/gallium/auxiliary/util/u_format_zs.c
+++ b/src/gallium/auxiliary/util/u_format_zs.c
@@ -27,8 +27,8 @@
 
 
 #include "u_debug.h"
-#include "u_math.h"
 #include "u_format_zs.h"
+#include "util/u_math.h"
 
 
 /*
diff --git a/src/util/Makefile.sources b/src/util/Makefile.sources
index 531fd833c7..b562d6cd6f 100644
--- a/src/util/Makefile.sources
+++ b/src/util/Makefile.sources
@@ -55,6 +55,8 @@ MESA_UTIL_FILES := \
        u_atomic.h \
        u_dynarray.h \
        u_endian.h \
+       u_math.c \
+       u_math.h \
        u_queue.c \
        u_queue.h \
        u_string.h \
diff --git a/src/util/meson.build b/src/util/meson.build
index a4ff0b92ed..e7ad286123 100644
--- a/src/util/meson.build
+++ b/src/util/meson.build
@@ -85,6 +85,8 @@ files_mesa_util = files(
   'u_thread.h',
   'u_vector.c',
   'u_vector.h',
+  'u_math.c',
+  'u_math.h',
   'vma.c',
   'vma.h',
 )
diff --git a/src/gallium/auxiliary/util/u_math.c b/src/util/u_math.c
similarity index 100%
rename from src/gallium/auxiliary/util/u_math.c
rename to src/util/u_math.c
diff --git a/src/gallium/auxiliary/util/u_math.h b/src/util/u_math.h
similarity index 99%
rename from src/gallium/auxiliary/util/u_math.h
rename to src/util/u_math.h
index 712305c98a..e7dbbe5ca2 100644
--- a/src/gallium/auxiliary/util/u_math.h
+++ b/src/util/u_math.h
@@ -46,7 +46,7 @@
 #include <float.h>
 #include <stdarg.h>
 
-#include "util/bitscan.h"
+#include "bitscan.h"
 
 #ifdef __cplusplus
 extern "C" {

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to