nak/legalize: Take a RegFile in copy_alu_src_and_lower_ineg()

Fixes: af6093a712 ("nak/legalize: Add a helper for lowering ineg")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33107>
(cherry picked from commit 328112c6bc7ffe129b6b83619f3c130858e21417)
This commit is contained in:
Faith Ekstrand
2025-04-16 19:06:18 -05:00
committed by Eric Engestrom
parent 9fa9cd870f
commit 0702e54b55
4 changed files with 5 additions and 4 deletions

View File

@@ -1974,7 +1974,7 @@
"description": "nak/legalize: Take a RegFile in copy_alu_src_and_lower_ineg()",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "af6093a71267f6be5392c74491ab68f83ff750d0",
"notes": null

View File

@@ -273,10 +273,11 @@ pub trait LegalizeBuildHelpers: SSABuilder {
fn copy_alu_src_and_lower_ineg(
&mut self,
src: &mut Src,
reg_file: RegFile,
src_type: SrcType,
) {
assert!(src_type == SrcType::I32);
let val = self.alloc_ssa(RegFile::GPR, 1);
let val = self.alloc_ssa(reg_file, 1);
if self.sm() >= 70 {
self.push_op(OpIAdd3 {
srcs: [Src::new_zero(), *src, Src::new_zero()],

View File

@@ -1238,7 +1238,7 @@ impl SM50Op for OpIAdd2 {
swap_srcs_if_not_reg(src0, src1, GPR);
if src0.src_mod.is_ineg() && src1.src_mod.is_ineg() {
assert!(self.carry_out.is_none());
b.copy_alu_src_and_lower_ineg(src0, SrcType::I32);
b.copy_alu_src_and_lower_ineg(src0, GPR, SrcType::I32);
}
b.copy_alu_src_if_not_reg(src0, GPR, SrcType::I32);
if !self.carry_out.is_none() {

View File

@@ -1362,7 +1362,7 @@ impl SM70Op for OpIAdd3 {
if !src0.src_mod.is_none() && !src1.src_mod.is_none() {
assert!(self.overflow[0].is_none());
assert!(self.overflow[1].is_none());
b.copy_alu_src_and_lower_ineg(src0, SrcType::I32);
b.copy_alu_src_and_lower_ineg(src0, gpr, SrcType::I32);
}
b.copy_alu_src_if_not_reg(src0, gpr, SrcType::I32);
b.copy_alu_src_if_both_not_reg(src1, src2, gpr, SrcType::I32);