mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 17:30:20 +01:00
nak: Move some legalization helpers from sm50 to common code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34538>
This commit is contained in:
parent
6a4c1ac464
commit
32570924cf
2 changed files with 28 additions and 32 deletions
|
|
@ -292,6 +292,34 @@ pub trait LegalizeBuildHelpers: SSABuilder {
|
|||
*src = val.into();
|
||||
}
|
||||
|
||||
fn copy_alu_src_if_fabs(&mut self, src: &mut Src, src_type: SrcType) {
|
||||
if src.src_mod.has_fabs() {
|
||||
self.copy_alu_src_and_lower_fmod(src, src_type);
|
||||
}
|
||||
}
|
||||
|
||||
fn copy_alu_src_if_i20_overflow(
|
||||
&mut self,
|
||||
src: &mut Src,
|
||||
reg_file: RegFile,
|
||||
src_type: SrcType,
|
||||
) {
|
||||
if src.as_imm_not_i20().is_some() {
|
||||
self.copy_alu_src(src, reg_file, src_type);
|
||||
}
|
||||
}
|
||||
|
||||
fn copy_alu_src_if_f20_overflow(
|
||||
&mut self,
|
||||
src: &mut Src,
|
||||
reg_file: RegFile,
|
||||
src_type: SrcType,
|
||||
) {
|
||||
if src.as_imm_not_f20().is_some() {
|
||||
self.copy_alu_src(src, reg_file, src_type);
|
||||
}
|
||||
}
|
||||
|
||||
fn copy_ssa_ref_if_uniform(&mut self, ssa_ref: &mut SSARef) {
|
||||
for ssa in &mut ssa_ref[..] {
|
||||
if ssa.is_uniform() {
|
||||
|
|
|
|||
|
|
@ -423,38 +423,6 @@ impl SM50Encoder<'_> {
|
|||
// Legalization helpers
|
||||
//
|
||||
|
||||
pub trait SM50LegalizeBuildHelpers: LegalizeBuildHelpers {
|
||||
fn copy_alu_src_if_fabs(&mut self, src: &mut Src, src_type: SrcType) {
|
||||
if src.src_mod.has_fabs() {
|
||||
self.copy_alu_src_and_lower_fmod(src, src_type);
|
||||
}
|
||||
}
|
||||
|
||||
fn copy_alu_src_if_i20_overflow(
|
||||
&mut self,
|
||||
src: &mut Src,
|
||||
reg_file: RegFile,
|
||||
src_type: SrcType,
|
||||
) {
|
||||
if src.as_imm_not_i20().is_some() {
|
||||
self.copy_alu_src(src, reg_file, src_type);
|
||||
}
|
||||
}
|
||||
|
||||
fn copy_alu_src_if_f20_overflow(
|
||||
&mut self,
|
||||
src: &mut Src,
|
||||
reg_file: RegFile,
|
||||
src_type: SrcType,
|
||||
) {
|
||||
if src.as_imm_not_f20().is_some() {
|
||||
self.copy_alu_src(src, reg_file, src_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SM50LegalizeBuildHelpers for LegalizeBuilder<'_> {}
|
||||
|
||||
/// Helper to legalize extended or external instructions
|
||||
///
|
||||
/// These are instructions which reach out external units such as load/store
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue