mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-26 05:40:33 +01:00
bitview: Implement SetFieldU64 for all BitViewMutable
There's no reason why we need to keep overriding this. There's also probably not a good reason why this trait exists at all but that's a problem for another day. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35190>
This commit is contained in:
parent
6ec69e5a07
commit
f10c42fcc1
6 changed files with 1 additions and 34 deletions
|
|
@ -246,7 +246,7 @@ pub trait SetFieldU64 {
|
|||
fn set_field_u64(&mut self, range: Range<usize>, val: u64);
|
||||
}
|
||||
|
||||
impl<'a, BS: BitMutViewable + ?Sized> SetFieldU64 for BitMutView<'a, BS> {
|
||||
impl<'a, BS: BitMutViewable> SetFieldU64 for BS {
|
||||
fn set_field_u64(&mut self, range: Range<usize>, val: u64) {
|
||||
let bits = range.end - range.start;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ use crate::legalize::{
|
|||
};
|
||||
use bitview::{
|
||||
BitMutView, BitMutViewable, BitView, BitViewable, SetBit, SetField,
|
||||
SetFieldU64,
|
||||
};
|
||||
|
||||
use rustc_hash::FxHashMap;
|
||||
|
|
@ -212,12 +211,6 @@ impl BitMutViewable for SM20Encoder<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
impl SetFieldU64 for SM20Encoder<'_> {
|
||||
fn set_field_u64(&mut self, range: Range<usize>, val: u64) {
|
||||
BitMutView::new(&mut self.inst).set_field_u64(range, val);
|
||||
}
|
||||
}
|
||||
|
||||
impl SM20Encoder<'_> {
|
||||
fn set_opcode(&mut self, unit: SM20Unit, opcode: u8) {
|
||||
self.set_field(0..3, unit as u8);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ use crate::legalize::{
|
|||
};
|
||||
use bitview::{
|
||||
BitMutView, BitMutViewable, BitView, BitViewable, SetBit, SetField,
|
||||
SetFieldU64,
|
||||
};
|
||||
|
||||
use rustc_hash::FxHashMap;
|
||||
|
|
@ -177,12 +176,6 @@ impl BitMutViewable for SM32Encoder<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
impl SetFieldU64 for SM32Encoder<'_> {
|
||||
fn set_field_u64(&mut self, range: Range<usize>, val: u64) {
|
||||
BitMutView::new(&mut self.inst).set_field_u64(range, val);
|
||||
}
|
||||
}
|
||||
|
||||
impl SM32Encoder<'_> {
|
||||
fn set_opcode(&mut self, opcode: u16, functional_unit: u8) {
|
||||
self.set_field(52..64, opcode);
|
||||
|
|
|
|||
|
|
@ -200,12 +200,6 @@ impl BitMutViewable for SM50Encoder<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
impl SetFieldU64 for SM50Encoder<'_> {
|
||||
fn set_field_u64(&mut self, range: Range<usize>, val: u64) {
|
||||
BitMutView::new(&mut self.inst).set_field_u64(range, val);
|
||||
}
|
||||
}
|
||||
|
||||
fn zero_reg() -> RegRef {
|
||||
RegRef::new(RegFile::GPR, 255, 1)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,12 +40,6 @@ impl BitMutViewable for SM70Encoder<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
impl SetFieldU64 for SM70Encoder<'_> {
|
||||
fn set_field_u64(&mut self, range: Range<usize>, val: u64) {
|
||||
BitMutView::new(&mut self.inst).set_field_u64(range, val);
|
||||
}
|
||||
}
|
||||
|
||||
impl SM70Encoder<'_> {
|
||||
/// Maximum encodable UGPR
|
||||
///
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ extern crate nvidia_headers;
|
|||
use crate::ir::{ShaderInfo, ShaderIoInfo, ShaderModel, ShaderStageInfo};
|
||||
use bitview::{
|
||||
BitMutView, BitMutViewable, BitView, BitViewable, SetBit, SetField,
|
||||
SetFieldU64,
|
||||
};
|
||||
use nak_bindings::*;
|
||||
use nvidia_headers::classes::cla097::sph::*;
|
||||
|
|
@ -91,12 +90,6 @@ impl BitMutViewable for ShaderProgramHeader {
|
|||
}
|
||||
}
|
||||
|
||||
impl SetFieldU64 for ShaderProgramHeader {
|
||||
fn set_field_u64(&mut self, range: Range<usize>, val: u64) {
|
||||
BitMutView::new(&mut self.data).set_field_u64(range, val);
|
||||
}
|
||||
}
|
||||
|
||||
impl ShaderProgramHeader {
|
||||
pub fn new(shader_type: ShaderType, sm: u8) -> Self {
|
||||
let mut res = Self {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue