From 217c0a489b6927fe708e0cfa6d6261f891e328ff Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 29 Jul 2024 10:09:32 -0500 Subject: [PATCH] nak: Move the QMD code back into the main nak crate I only ever pulled it out because I also pulled out the test runner. Now that the test runner lives inside NAK, this can, too. Part-of: --- src/nouveau/compiler/meson.build | 24 ++++--------------- src/nouveau/compiler/nak/lib.rs | 1 + .../compiler/{nak_qmd/lib.rs => nak/qmd.rs} | 10 ++++---- 3 files changed, 10 insertions(+), 25 deletions(-) rename src/nouveau/compiler/{nak_qmd/lib.rs => nak/qmd.rs} (99%) diff --git a/src/nouveau/compiler/meson.build b/src/nouveau/compiler/meson.build index 213beb276ef..01f1637bc07 100644 --- a/src/nouveau/compiler/meson.build +++ b/src/nouveau/compiler/meson.build @@ -158,22 +158,6 @@ _libnak_ir_proc_rs = rust.proc_macro( dependencies : [dep_syn], ) -_libnak_qmd_rs = static_library( - 'nak_qmd_rs', - files('nak_qmd/lib.rs'), - gnu_symbol_visibility : 'hidden', - rust_abi : 'c', - rust_args : nak_rust_args, - dependencies : [ - dep_paste, - idep_nvidia_headers_rs, - ], - link_with: [ - _libbitview_rs, - _libnak_bindings_rs, - ], -) - _libnak_rs = static_library( 'nak_rs', files('nak/lib.rs'), @@ -184,11 +168,14 @@ _libnak_rs = static_library( # Otherwise, rustc trips up on -pthread '-Clink-arg=-Wno-unused-command-line-argument', ], - link_with: [ + dependencies : [ + dep_paste, + idep_nvidia_headers_rs, + ], + link_with : [ _libbitview_rs, _libnak_bindings_rs, _libnak_ir_proc_rs, - _libnak_qmd_rs, ], ) @@ -209,7 +196,6 @@ if with_tests and get_option('b_sanitize') == 'none' idep_nouveau_ws, idep_compiler.partial_dependency(link_args : true, links : true), idep_mesautil.partial_dependency(link_args : true, links : true), - idep_nvidia_headers_rs, idep_nv_push_rs, ], link_with: [ diff --git a/src/nouveau/compiler/nak/lib.rs b/src/nouveau/compiler/nak/lib.rs index d9942fd2bd2..3126aabaeb9 100644 --- a/src/nouveau/compiler/nak/lib.rs +++ b/src/nouveau/compiler/nak/lib.rs @@ -24,6 +24,7 @@ mod opt_lop; mod opt_out; mod opt_prmt; mod opt_uniform_instrs; +mod qmd; mod repair_ssa; mod sm50; mod sm70; diff --git a/src/nouveau/compiler/nak_qmd/lib.rs b/src/nouveau/compiler/nak/qmd.rs similarity index 99% rename from src/nouveau/compiler/nak_qmd/lib.rs rename to src/nouveau/compiler/nak/qmd.rs index 7d0350bc4d4..5ef70982634 100644 --- a/src/nouveau/compiler/nak_qmd/lib.rs +++ b/src/nouveau/compiler/nak/qmd.rs @@ -1,9 +1,7 @@ // Copyright © 2024 Collabora, Ltd. // SPDX-License-Identifier: MIT -extern crate bitview; extern crate nvidia_headers; -extern crate paste; use nak_bindings::*; use nvidia_headers::classes::{cla0c0, clc0c0, clc3c0, clc6c0}; @@ -163,7 +161,7 @@ macro_rules! qmd_impl_set_register_count { } mod qmd_0_6 { - use crate::*; + use crate::qmd::*; use nvidia_headers::classes::cla0c0::qmd as cla0c0; #[repr(transparent)] @@ -208,7 +206,7 @@ mod qmd_0_6 { use qmd_0_6::Qmd0_6; mod qmd_2_1 { - use crate::*; + use crate::qmd::*; use nvidia_headers::classes::clc0c0::qmd as clc0c0; #[repr(transparent)] @@ -276,7 +274,7 @@ macro_rules! qmd_impl_set_smem_size_bounded { } mod qmd_2_2 { - use crate::*; + use crate::qmd::*; use nvidia_headers::classes::clc3c0::qmd as clc3c0; #[repr(transparent)] @@ -304,7 +302,7 @@ mod qmd_2_2 { use qmd_2_2::Qmd2_2; mod qmd_3_0 { - use crate::*; + use crate::qmd::*; use nvidia_headers::classes::clc6c0::qmd as clc6c0; #[repr(transparent)]