nak: Move bitset to compiler crate
This commit intorduces src/compiler/rust crate, which will have different modules that help to write a backend compiler in Rust. Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30443>
This commit is contained in:

committed by
Marge Bot

parent
6bba7b685e
commit
05bf03c3db
@@ -70,3 +70,7 @@ if with_gallium
|
||||
subdir('glsl')
|
||||
endif
|
||||
subdir('isaspec')
|
||||
|
||||
if with_nouveau_vk
|
||||
subdir('rust')
|
||||
endif
|
||||
|
1
src/compiler/rust/.rustfmt.toml
Normal file
1
src/compiler/rust/.rustfmt.toml
Normal file
@@ -0,0 +1 @@
|
||||
max_width = 80
|
4
src/compiler/rust/lib.rs
Normal file
4
src/compiler/rust/lib.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
// Copyright © 2024 Igalia S.L.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pub mod bitset;
|
23
src/compiler/rust/meson.build
Normal file
23
src/compiler/rust/meson.build
Normal file
@@ -0,0 +1,23 @@
|
||||
# Copyright © 2024 Igalia S.L.
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
_compiler_rs_sources = [
|
||||
'bitset.rs',
|
||||
]
|
||||
|
||||
_compiler_rs_sources = structured_sources([
|
||||
# lib.rs has to go first
|
||||
'lib.rs',
|
||||
_compiler_rs_sources,
|
||||
])
|
||||
|
||||
_libcompiler_rs = static_library(
|
||||
'compiler',
|
||||
_compiler_rs_sources,
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
rust_abi : 'rust',
|
||||
)
|
||||
|
||||
idep_compiler_rs = declare_dependency(
|
||||
link_with : _libcompiler_rs,
|
||||
)
|
@@ -143,6 +143,7 @@ _libnak_rs = static_library(
|
||||
],
|
||||
dependencies : [
|
||||
dep_paste,
|
||||
idep_compiler_rs,
|
||||
idep_nvidia_headers_rs,
|
||||
],
|
||||
link_with : [
|
||||
|
@@ -2,10 +2,10 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use crate::api::{GetDebugFlags, DEBUG};
|
||||
use crate::bitset::BitSet;
|
||||
use crate::ir::*;
|
||||
use crate::liveness::{BlockLiveness, Liveness, SimpleLiveness};
|
||||
|
||||
use compiler::bitset::BitSet;
|
||||
use std::cmp::{max, Ordering};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
|
@@ -1,8 +1,7 @@
|
||||
// Copyright © 2023 Collabora, Ltd.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use crate::bitset::BitSet;
|
||||
|
||||
use compiler::bitset::BitSet;
|
||||
use std::collections::HashMap;
|
||||
use std::hash::Hash;
|
||||
use std::ops::{Deref, DerefMut, Index, IndexMut};
|
||||
|
@@ -3,7 +3,6 @@
|
||||
|
||||
mod api;
|
||||
mod assign_regs;
|
||||
mod bitset;
|
||||
mod builder;
|
||||
mod calc_instr_deps;
|
||||
mod cfg;
|
||||
|
@@ -1,9 +1,9 @@
|
||||
// Copyright © 2022 Collabora, Ltd.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use crate::bitset::BitSet;
|
||||
use crate::ir::*;
|
||||
|
||||
use compiler::bitset::BitSet;
|
||||
use std::cell::RefCell;
|
||||
use std::cmp::{max, Ord, Ordering};
|
||||
use std::collections::{hash_set, HashMap, HashSet};
|
||||
|
@@ -2,9 +2,9 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use crate::api::{GetDebugFlags, DEBUG};
|
||||
use crate::bitset::BitSet;
|
||||
use crate::ir::*;
|
||||
|
||||
use compiler::bitset::BitSet;
|
||||
use std::collections::HashMap;
|
||||
|
||||
struct PhiMap {
|
||||
|
@@ -1,10 +1,10 @@
|
||||
// Copyright © 2023 Collabora, Ltd.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use crate::bitset::BitSet;
|
||||
use crate::ir::*;
|
||||
use crate::union_find::UnionFind;
|
||||
|
||||
use compiler::bitset::BitSet;
|
||||
use std::cell::RefCell;
|
||||
use std::collections::HashMap;
|
||||
|
||||
|
@@ -4,12 +4,12 @@
|
||||
#![allow(unstable_name_collisions)]
|
||||
|
||||
use crate::api::{GetDebugFlags, DEBUG};
|
||||
use crate::bitset::BitSet;
|
||||
use crate::ir::*;
|
||||
use crate::liveness::{
|
||||
BlockLiveness, LiveSet, Liveness, NextUseBlockLiveness, NextUseLiveness,
|
||||
};
|
||||
|
||||
use compiler::bitset::BitSet;
|
||||
use std::cell::RefCell;
|
||||
use std::cmp::{max, Ordering, Reverse};
|
||||
use std::collections::{BinaryHeap, HashMap, HashSet};
|
||||
|
Reference in New Issue
Block a user