diff --git a/src/nouveau/compiler/nak_encode_sm75.rs b/src/nouveau/compiler/nak_encode_sm75.rs index 8e739ac54fc..26a6ecea5bc 100644 --- a/src/nouveau/compiler/nak_encode_sm75.rs +++ b/src/nouveau/compiler/nak_encode_sm75.rs @@ -837,7 +837,7 @@ impl SM75Instr { 0x16, Some(op.dst), ALUSrc::from_src(&op.srcs[0]), - ALUSrc::Imm32(op.selection.inner()), + ALUSrc::from_src(&op.selection), ALUSrc::from_src(&op.srcs[1]), ); } diff --git a/src/nouveau/compiler/nak_from_nir.rs b/src/nouveau/compiler/nak_from_nir.rs index 4edeae15774..d5399c69514 100644 --- a/src/nouveau/compiler/nak_from_nir.rs +++ b/src/nouveau/compiler/nak_from_nir.rs @@ -699,27 +699,30 @@ impl<'a> ShaderFromNir<'a> { }); let dst = b.alloc_ssa(RegFile::GPR, 1); + + let selection = PrmtSelectionEval::from([ + PrmtSelection { + src: PrmtSrc::Byte5, + sign_extend: false, + }, + PrmtSelection { + src: PrmtSrc::Byte4, + sign_extend: false, + }, + PrmtSelection { + src: PrmtSrc::Byte1, + sign_extend: false, + }, + PrmtSelection { + src: PrmtSrc::Byte0, + sign_extend: false, + }, + ]); + b.push_op(OpPrmt { dst: dst.into(), srcs: [low.into(), high.into()], - selection: PrmtSelectionEval::from([ - PrmtSelection { - src: PrmtSrc::Byte5, - sign_extend: false, - }, - PrmtSelection { - src: PrmtSrc::Byte4, - sign_extend: false, - }, - PrmtSelection { - src: PrmtSrc::Byte1, - sign_extend: false, - }, - PrmtSelection { - src: PrmtSrc::Byte0, - sign_extend: false, - }, - ]), + selection: Src::new_imm_u32(selection.inner()), }); dst } diff --git a/src/nouveau/compiler/nak_ir.rs b/src/nouveau/compiler/nak_ir.rs index 5333c9e496f..ca77a54dac8 100644 --- a/src/nouveau/compiler/nak_ir.rs +++ b/src/nouveau/compiler/nak_ir.rs @@ -2584,22 +2584,15 @@ pub struct OpPrmt { #[src_type(ALU)] pub srcs: [Src; 2], - pub selection: PrmtSelectionEval, + pub selection: Src, } impl fmt::Display for OpPrmt { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let sel: [PrmtSelection; 4] = self.selection.into(); write!( f, - "PRMT {}, {} [{:?}, {:?}, {:?}, {:?}], {}", - self.dst, - self.srcs[0], - sel[0].src, - sel[1].src, - sel[2].src, - sel[3].src, - self.srcs[1], + "PRMT {}, {} [{}], {}", + self.dst, self.srcs[0], self.selection, self.srcs[1], ) } }