nouveau: move codegen into a standalone library.
authorDave Airlie <airlied@redhat.com>
Sat, 28 May 2022 03:19:21 +0000 (13:19 +1000)
committerMarge Bot <emma+marge@anholt.net>
Fri, 3 Jun 2022 03:57:18 +0000 (03:57 +0000)
This just moves the codegen build into a separate library,
this is just prep work for a future where another drivers wants
to reuse this code.

Acked-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Yusuf Khan<yusisamerican@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16763>

50 files changed:
src/gallium/drivers/nouveau/codegen/meson.build [new file with mode: 0644]
src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir.h
src/gallium/drivers/nouveau/codegen/nv50_ir_bb.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gv100.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gv100.h
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_from_common.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_from_common.h
src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_graph.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_graph.h
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gm107.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gm107.h
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gv100.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gv100.h
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_helper.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_helper.h
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_serialize.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_ssa.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_target.h
src/gallium/drivers/nouveau/codegen/nv50_ir_target_gm107.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_target_gm107.h
src/gallium/drivers/nouveau/codegen/nv50_ir_target_gv100.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_target_gv100.h
src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.h
src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.h
src/gallium/drivers/nouveau/codegen/nv50_ir_util.cpp
src/gallium/drivers/nouveau/meson.build
src/gallium/drivers/nouveau/nouveau_compiler.c
src/gallium/drivers/nouveau/nv50/nv50_compute.c
src/gallium/drivers/nouveau/nv50/nv50_program.c
src/gallium/drivers/nouveau/nv50/nv50_screen.c
src/gallium/drivers/nouveau/nvc0/nvc0_program.c
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
src/gallium/drivers/nouveau/nvc0/nve4_compute.c

diff --git a/src/gallium/drivers/nouveau/codegen/meson.build b/src/gallium/drivers/nouveau/codegen/meson.build
new file mode 100644 (file)
index 0000000..ea0b119
--- /dev/null
@@ -0,0 +1,83 @@
+# Copyright © 2017 Dylan Baker
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+files_libnouveau_codegen = files(
+  'nv50_ir.cpp',
+  'nv50_ir_bb.cpp',
+  'nv50_ir_build_util.cpp',
+  'nv50_ir_build_util.h',
+  'nv50_ir_driver.h',
+  'nv50_ir_emit_nv50.cpp',
+  'nv50_ir_from_common.cpp',
+  'nv50_ir_from_common.h',
+  'nv50_ir_from_nir.cpp',
+  'nv50_ir_from_tgsi.cpp',
+  'nv50_ir_graph.cpp',
+  'nv50_ir_graph.h',
+  'nv50_ir.h',
+  'nv50_ir_inlines.h',
+  'nv50_ir_lowering_helper.cpp',
+  'nv50_ir_lowering_helper.h',
+  'nv50_ir_lowering_nv50.cpp',
+  'nv50_ir_peephole.cpp',
+  'nv50_ir_print.cpp',
+  'nv50_ir_ra.cpp',
+  'nv50_ir_serialize.cpp',
+  'nv50_ir_ssa.cpp',
+  'nv50_ir_target.cpp',
+  'nv50_ir_target.h',
+  'nv50_ir_target_nv50.cpp',
+  'nv50_ir_target_nv50.h',
+  'nv50_ir_util.cpp',
+  'nv50_ir_util.h',
+  'unordered_set.h',
+  'nv50_ir_emit_gv100.cpp',
+  'nv50_ir_emit_gv100.h',
+  'nv50_ir_emit_gk110.cpp',
+  'nv50_ir_emit_gm107.cpp',
+  'nv50_ir_emit_nvc0.cpp',
+  'nv50_ir_lowering_gv100.cpp',
+  'nv50_ir_lowering_gv100.h',
+  'nv50_ir_lowering_gm107.cpp',
+  'nv50_ir_lowering_gm107.h',
+  'nv50_ir_lowering_nvc0.cpp',
+  'nv50_ir_lowering_nvc0.h',
+  'nv50_ir_target_gv100.cpp',
+  'nv50_ir_target_gv100.h',
+  'nv50_ir_target_gm107.cpp',
+  'nv50_ir_target_gm107.h',
+  'nv50_ir_target_nvc0.cpp',
+  'nv50_ir_target_nvc0.h',
+)
+
+libnouveau_codegen = static_library(
+  'nouveau_codegen',
+  files_libnouveau_codegen,
+  include_directories : [
+    inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_mapi, inc_mesa,
+  ],
+  gnu_symbol_visibility : 'hidden',
+  dependencies : [dep_libdrm, idep_mesautil, idep_nir_headers],
+)
+
+idep_nouveau_codegen = declare_dependency(
+  sources : [ 'nv50_ir_driver.h' ],
+  include_directories : [inc_gallium_aux, include_directories('.')],
+)
index 08c7ada..95227a5 100644 (file)
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_target.h"
-#include "codegen/nv50_ir_driver.h"
-
-extern "C" {
-#include "nouveau_debug.h"
-}
+#include "nv50_ir.h"
+#include "nv50_ir_target.h"
+#include "nv50_ir_driver.h"
 
 namespace nv50_ir {
 
index 8e9d5f8..35a8f0a 100644 (file)
 #include <list>
 #include <vector>
 
-#include "codegen/unordered_set.h"
-#include "codegen/nv50_ir_util.h"
-#include "codegen/nv50_ir_graph.h"
+#include "unordered_set.h"
+#include "nv50_ir_util.h"
+#include "nv50_ir_graph.h"
 
-#include "codegen/nv50_ir_driver.h"
+#include "nv50_ir_driver.h"
 
 namespace nv50_ir {
 
@@ -1415,7 +1415,7 @@ protected:
 
 // =============================================================================
 
-#include "codegen/nv50_ir_inlines.h"
+#include "nv50_ir_inlines.h"
 
 } // namespace nv50_ir
 
index 76fee8c..df5b222 100644 (file)
@@ -20,7 +20,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir.h"
+#include "nv50_ir.h"
 
 namespace nv50_ir {
 
index 20ed5cd..8d40f7e 100644 (file)
@@ -20,8 +20,8 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_build_util.h"
+#include "nv50_ir.h"
+#include "nv50_ir_build_util.h"
 
 namespace nv50_ir {
 
index 46354a2..bfba20b 100644 (file)
@@ -20,7 +20,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir_target_nvc0.h"
+#include "nv50_ir_target_nvc0.h"
 
 // CodeEmitter for GK110 encoding of the Fermi/Kepler ISA.
 
index 545477e..0b2ff3b 100644 (file)
@@ -22,8 +22,8 @@
  * Authors: Ben Skeggs <bskeggs@redhat.com>
  */
 
-#include "codegen/nv50_ir_target_gm107.h"
-#include "codegen/nv50_ir_sched_gm107.h"
+#include "nv50_ir_target_gm107.h"
+#include "nv50_ir_sched_gm107.h"
 
 //#define GM107_DEBUG_SCHED_DATA
 
index 382273c..1229579 100644 (file)
@@ -19,8 +19,8 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  */
-#include "codegen/nv50_ir_emit_gv100.h"
-#include "codegen/nv50_ir_sched_gm107.h"
+#include "nv50_ir_emit_gv100.h"
+#include "nv50_ir_sched_gm107.h"
 
 namespace nv50_ir {
 
index d6a903e..388c801 100644 (file)
@@ -21,7 +21,7 @@
  */
 #ifndef __NV50_IR_EMIT_GV100_H__
 #define __NV50_IR_EMIT_GV100_H__
-#include "codegen/nv50_ir_target_gv100.h"
+#include "nv50_ir_target_gv100.h"
 
 namespace nv50_ir {
 
index 1a0c63b..48af3d2 100644 (file)
@@ -20,8 +20,8 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_target_nv50.h"
+#include "nv50_ir.h"
+#include "nv50_ir_target_nv50.h"
 
 namespace nv50_ir {
 
index c55aae3..552234e 100644 (file)
@@ -20,7 +20,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir_target_nvc0.h"
+#include "nv50_ir_target_nvc0.h"
 
 namespace nv50_ir {
 
index 0a70c68..70bcd42 100644 (file)
@@ -20,7 +20,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir_from_common.h"
+#include "nv50_ir_from_common.h"
 
 namespace nv50_ir {
 
index a144ca2..3da3595 100644 (file)
@@ -20,8 +20,8 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_build_util.h"
+#include "nv50_ir.h"
+#include "nv50_ir_build_util.h"
 
 namespace nv50_ir {
 
index 931ee85..9ad7b2f 100644 (file)
 #include "util/u_debug.h"
 #include "util/u_prim.h"
 
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_from_common.h"
-#include "codegen/nv50_ir_lowering_helper.h"
-#include "codegen/nv50_ir_target.h"
-#include "codegen/nv50_ir_util.h"
+#include "nv50_ir.h"
+#include "nv50_ir_from_common.h"
+#include "nv50_ir_lowering_helper.h"
+#include "nv50_ir_target.h"
+#include "nv50_ir_util.h"
 #include "tgsi/tgsi_from_mesa.h"
 
 #if __cplusplus >= 201103L
index a597e82..72035c2 100644 (file)
@@ -27,9 +27,9 @@
 
 #include <set>
 
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_from_common.h"
-#include "codegen/nv50_ir_util.h"
+#include "nv50_ir.h"
+#include "nv50_ir_from_common.h"
+#include "nv50_ir_util.h"
 
 namespace tgsi {
 
index 3f9967a..3b0373e 100644 (file)
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir_graph.h"
+#include "nv50_ir_graph.h"
 #include <limits>
 #include <list>
 #include <stack>
-#include "codegen/nv50_ir.h"
+#include "nv50_ir.h"
 
 namespace nv50_ir {
 
index fc85e78..8ee535c 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef __NV50_IR_GRAPH_H__
 #define __NV50_IR_GRAPH_H__
 
-#include "codegen/nv50_ir_util.h"
+#include "nv50_ir_util.h"
 #include <vector>
 
 namespace nv50_ir {
index 64b47bb..2e6b517 100644 (file)
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_build_util.h"
+#include "nv50_ir.h"
+#include "nv50_ir_build_util.h"
 
-#include "codegen/nv50_ir_target_nvc0.h"
-#include "codegen/nv50_ir_lowering_gm107.h"
+#include "nv50_ir_target_nvc0.h"
+#include "nv50_ir_lowering_gm107.h"
 
 #include <limits>
 
index 2934676..6b053d8 100644 (file)
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  */
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_build_util.h"
+#include "nv50_ir.h"
+#include "nv50_ir_build_util.h"
 
-#include "codegen/nv50_ir_target_nvc0.h"
-#include "codegen/nv50_ir_lowering_gv100.h"
+#include "nv50_ir_target_nvc0.h"
+#include "nv50_ir_lowering_gv100.h"
 
 #include <limits>
 
index d918c6e..cd43d2f 100644 (file)
@@ -21,7 +21,7 @@
  */
 #ifndef __NV50_IR_LOWERING_GV100_H__
 #define __NV50_IR_LOWERING_GV100_H__
-#include "codegen/nv50_ir_lowering_gm107.h"
+#include "nv50_ir_lowering_gm107.h"
 
 namespace nv50_ir {
 
index 02380f1..ed5a804 100644 (file)
@@ -22,7 +22,7 @@
  * Authors: Karol Herbst <kherbst@redhat.com>
  */
 
-#include "codegen/nv50_ir_lowering_helper.h"
+#include "nv50_ir_lowering_helper.h"
 
 namespace nv50_ir {
 
index c59e7cc..abd8410 100644 (file)
@@ -25,8 +25,8 @@
 #ifndef __NV50_IR_LOWERING_HELPER__
 #define __NV50_IR_LOWERING_HELPER__
 
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_build_util.h"
+#include "nv50_ir.h"
+#include "nv50_ir_build_util.h"
 
 namespace nv50_ir {
 
index 2b09855..73e7233 100644 (file)
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_build_util.h"
+#include "nv50_ir.h"
+#include "nv50_ir_build_util.h"
 
-#include "codegen/nv50_ir_target_nv50.h"
+#include "nv50_ir_target_nv50.h"
 
 #define NV50_SU_INFO_SIZE_X   0x00
 #define NV50_SU_INFO_SIZE_Y   0x04
index 6f71a90..2891a1b 100644 (file)
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_build_util.h"
+#include "nv50_ir.h"
+#include "nv50_ir_build_util.h"
 
-#include "codegen/nv50_ir_target_nvc0.h"
-#include "codegen/nv50_ir_lowering_nvc0.h"
+#include "nv50_ir_target_nvc0.h"
+#include "nv50_ir_lowering_nvc0.h"
 
 #include <limits>
 
index a9b3898..9534703 100644 (file)
@@ -20,8 +20,8 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_build_util.h"
+#include "nv50_ir.h"
+#include "nv50_ir_build_util.h"
 
 /* On nvc0, surface info is obtained via the surface binding points passed
  * to the SULD/SUST instructions.
index c440670..a2a33d2 100644 (file)
@@ -20,9 +20,9 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_target.h"
-#include "codegen/nv50_ir_build_util.h"
+#include "nv50_ir.h"
+#include "nv50_ir_target.h"
+#include "nv50_ir_build_util.h"
 
 extern "C" {
 #include "util/u_math.h"
index e0d5284..bee3711 100644 (file)
@@ -20,9 +20,9 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_target.h"
-#include "codegen/nv50_ir_driver.h"
+#include "nv50_ir.h"
+#include "nv50_ir_target.h"
+#include "nv50_ir_driver.h"
 
 #include <inttypes.h>
 
index c40bdb0..92bd5a6 100644 (file)
@@ -20,8 +20,8 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_target.h"
+#include "nv50_ir.h"
+#include "nv50_ir_target.h"
 
 #include <algorithm>
 #include <stack>
index be64ffd..fd3b381 100644 (file)
@@ -1,7 +1,7 @@
 #include "util/blob.h"
-#include "codegen/nv50_ir_driver.h"
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_target.h"
+#include "nv50_ir_driver.h"
+#include "nv50_ir.h"
+#include "nv50_ir_target.h"
 #include "nv50_ir_driver.h"
 #include "tgsi/tgsi_parse.h"
 #include "compiler/nir/nir_serialize.h"
index 3d25ad9..9a69756 100644 (file)
@@ -20,8 +20,8 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_target.h"
+#include "nv50_ir.h"
+#include "nv50_ir_target.h"
 
 namespace nv50_ir {
 
index abbb622..f0eb807 100644 (file)
@@ -20,8 +20,8 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir.h"
-#include "codegen/nv50_ir_target.h"
+#include "nv50_ir.h"
+#include "nv50_ir_target.h"
 
 namespace nv50_ir {
 
@@ -469,7 +469,7 @@ RelocEntry::apply(uint32_t *binary, const RelocInfo *info) const
 } // namespace nv50_ir
 
 
-#include "codegen/nv50_ir_driver.h"
+#include "nv50_ir_driver.h"
 
 extern "C" {
 
index ce84ea3..691479c 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef __NV50_IR_TARGET_H__
 #define __NV50_IR_TARGET_H__
 
-#include "codegen/nv50_ir.h"
+#include "nv50_ir.h"
 
 namespace nv50_ir {
 
index 2e2e407..043aefc 100644 (file)
@@ -21,8 +21,8 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir_target_gm107.h"
-#include "codegen/nv50_ir_lowering_gm107.h"
+#include "nv50_ir_target_gm107.h"
+#include "nv50_ir_lowering_gm107.h"
 
 namespace nv50_ir {
 
index fd969e1..1721376 100644 (file)
@@ -19,9 +19,9 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  */
-#include "codegen/nv50_ir_target_gv100.h"
-#include "codegen/nv50_ir_lowering_gv100.h"
-#include "codegen/nv50_ir_emit_gv100.h"
+#include "nv50_ir_target_gv100.h"
+#include "nv50_ir_lowering_gv100.h"
+#include "nv50_ir_emit_gv100.h"
 
 namespace nv50_ir {
 
index 897e6a2..ff638a4 100644 (file)
@@ -21,7 +21,7 @@
  */
 #ifndef __NV50_IR_TARGET_GV100_H__
 #define __NV50_IR_TARGET_GV100_H__
-#include "codegen/nv50_ir_target_gm107.h"
+#include "nv50_ir_target_gm107.h"
 
 namespace nv50_ir {
 
index b9c3746..cfb7c49 100644 (file)
@@ -20,7 +20,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir_target_nv50.h"
+#include "nv50_ir_target_nv50.h"
 
 namespace nv50_ir {
 
index caf66b2..8797c98 100644 (file)
@@ -20,7 +20,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir_target.h"
+#include "nv50_ir_target.h"
 
 namespace nv50_ir {
 
index cc2657d..da6c37c 100644 (file)
@@ -20,7 +20,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir_target_nvc0.h"
+#include "nv50_ir_target_nvc0.h"
 
 namespace nv50_ir {
 
index 7808164..d49536f 100644 (file)
@@ -20,7 +20,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir_target.h"
+#include "nv50_ir_target.h"
 
 namespace nv50_ir {
 
index dc4ebd5..3e60f88 100644 (file)
@@ -20,7 +20,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "codegen/nv50_ir_util.h"
+#include "nv50_ir_util.h"
 
 namespace nv50_ir {
 
index b2a4819..01f6d4d 100644 (file)
@@ -18,6 +18,8 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
+subdir('codegen')
+
 files_libnouveau = files(
   'nouveau_buffer.c',
   'nouveau_buffer.h',
@@ -122,52 +124,6 @@ files_libnouveau = files(
   'nv50/nv98_video.h',
   'nv50/nv98_video_ppp.c',
   'nv50/nv98_video_vp.c',
-  'codegen/nv50_ir.cpp',
-  'codegen/nv50_ir_bb.cpp',
-  'codegen/nv50_ir_build_util.cpp',
-  'codegen/nv50_ir_build_util.h',
-  'codegen/nv50_ir_driver.h',
-  'codegen/nv50_ir_emit_nv50.cpp',
-  'codegen/nv50_ir_from_common.cpp',
-  'codegen/nv50_ir_from_common.h',
-  'codegen/nv50_ir_from_nir.cpp',
-  'codegen/nv50_ir_from_tgsi.cpp',
-  'codegen/nv50_ir_graph.cpp',
-  'codegen/nv50_ir_graph.h',
-  'codegen/nv50_ir.h',
-  'codegen/nv50_ir_inlines.h',
-  'codegen/nv50_ir_lowering_helper.cpp',
-  'codegen/nv50_ir_lowering_helper.h',
-  'codegen/nv50_ir_lowering_nv50.cpp',
-  'codegen/nv50_ir_peephole.cpp',
-  'codegen/nv50_ir_print.cpp',
-  'codegen/nv50_ir_ra.cpp',
-  'codegen/nv50_ir_serialize.cpp',
-  'codegen/nv50_ir_ssa.cpp',
-  'codegen/nv50_ir_target.cpp',
-  'codegen/nv50_ir_target.h',
-  'codegen/nv50_ir_target_nv50.cpp',
-  'codegen/nv50_ir_target_nv50.h',
-  'codegen/nv50_ir_util.cpp',
-  'codegen/nv50_ir_util.h',
-  'codegen/unordered_set.h',
-  'codegen/nv50_ir_emit_gv100.cpp',
-  'codegen/nv50_ir_emit_gv100.h',
-  'codegen/nv50_ir_emit_gk110.cpp',
-  'codegen/nv50_ir_emit_gm107.cpp',
-  'codegen/nv50_ir_emit_nvc0.cpp',
-  'codegen/nv50_ir_lowering_gv100.cpp',
-  'codegen/nv50_ir_lowering_gv100.h',
-  'codegen/nv50_ir_lowering_gm107.cpp',
-  'codegen/nv50_ir_lowering_gm107.h',
-  'codegen/nv50_ir_lowering_nvc0.cpp',
-  'codegen/nv50_ir_lowering_nvc0.h',
-  'codegen/nv50_ir_target_gv100.cpp',
-  'codegen/nv50_ir_target_gv100.h',
-  'codegen/nv50_ir_target_gm107.cpp',
-  'codegen/nv50_ir_target_gm107.h',
-  'codegen/nv50_ir_target_nvc0.cpp',
-  'codegen/nv50_ir_target_nvc0.h',
   'nvc0/cla0c0qmd.h',
   'nvc0/clc0c0qmd.h',
   'nvc0/clc3c0qmd.h',
@@ -231,21 +187,21 @@ libnouveau = static_library(
     inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_mapi, inc_mesa,
   ],
   gnu_symbol_visibility : 'hidden',
-  dependencies : [dep_libdrm, dep_libdrm_nouveau, idep_mesautil, idep_nir_headers],
+  dependencies : [dep_libdrm, idep_nouveau_codegen, dep_libdrm_nouveau, idep_mesautil, idep_nir_headers],
 )
 
 nouveau_compiler = executable(
   'nouveau_compiler',
   'nouveau_compiler.c',
+  dependencies : [dep_libdrm, dep_libdrm_nouveau, idep_mesautil, idep_nir, idep_nouveau_codegen],
   include_directories : [inc_src, inc_include, inc_gallium, inc_gallium_aux],
-  dependencies : [dep_libdrm, dep_libdrm_nouveau, idep_mesautil, idep_nir],
-  link_with : [libnouveau, libgallium],
+  link_with : [libnouveau_codegen, libnouveau, libgallium],
   build_by_default : with_tools.contains('nouveau'),
   install : with_tools.contains('nouveau'),
 )
 
 driver_nouveau = declare_dependency(
   compile_args : '-DGALLIUM_NOUVEAU',
-  dependencies : idep_nir,
-  link_with : [libnouveauwinsys, libnouveau],
+  dependencies : [idep_nir, idep_nouveau_codegen],
+  link_with : [libnouveauwinsys, libnouveau_codegen, libnouveau],
 )
index cf4b099..9352156 100644 (file)
@@ -25,7 +25,7 @@
 #include "tgsi/tgsi_text.h"
 #include "util/u_debug.h"
 
-#include "codegen/nv50_ir_driver.h"
+#include "nv50_ir_driver.h"
 #include "nv50/nv50_context.h"
 
 /* these headers weren't really meant to be included together */
index feecc9c..8c43dee 100644 (file)
@@ -28,7 +28,7 @@
 #include "nv50/nv50_context.h"
 #include "nv50/nv50_compute.xml.h"
 
-#include "codegen/nv50_ir_driver.h"
+#include "nv50_ir_driver.h"
 
 int
 nv50_screen_compute_setup(struct nv50_screen *screen,
index 7c4cf06..a81b176 100644 (file)
@@ -27,7 +27,7 @@
 #include "nv50/nv50_context.h"
 #include "nv50/nv50_program.h"
 
-#include "codegen/nv50_ir_driver.h"
+#include "nv50_ir_driver.h"
 
 static inline unsigned
 bitcount4(const uint32_t val)
index 28982b0..3187725 100644 (file)
@@ -28,7 +28,7 @@
 #include "util/u_screen.h"
 #include "pipe/p_screen.h"
 
-#include "codegen/nv50_ir_driver.h"
+#include "nv50_ir_driver.h"
 
 #include "nv50/nv50_context.h"
 #include "nv50/nv50_screen.h"
index 93b972a..ff89fb6 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "nvc0/nvc0_context.h"
 
-#include "codegen/nv50_ir_driver.h"
+#include "nv50_ir_driver.h"
 #include "nvc0/nve4_compute.h"
 
 /* NOTE: Using a[0x270] in FP may cause an error even if we're using less than
index bac9495..1a37290 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "nouveau_vp3_video.h"
 
-#include "codegen/nv50_ir_driver.h"
+#include "nv50_ir_driver.h"
 
 #include "nvc0/nvc0_context.h"
 #include "nvc0/nvc0_screen.h"
index 549205e..03a88b8 100644 (file)
@@ -25,7 +25,7 @@
 #include "nvc0/nvc0_context.h"
 #include "nvc0/nve4_compute.h"
 
-#include "codegen/nv50_ir_driver.h"
+#include "nv50_ir_driver.h"
 
 #include "drf.h"
 #include "qmd.h"