From c05565ce7b7e139a92a2eb95bdc349fdb1353ec5 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Wed, 12 Mar 2025 16:39:54 -0500 Subject: [PATCH] compiler/rust: Add more NIR intrinsic getters Reviewed-by: Mel Henning Reviewed-by: Benjamin Lee Part-of: --- src/compiler/rust/nir.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/compiler/rust/nir.rs b/src/compiler/rust/nir.rs index fae5c1f31ea..95225c12f7c 100644 --- a/src/compiler/rust/nir.rs +++ b/src/compiler/rust/nir.rs @@ -365,6 +365,22 @@ impl nir_intrinsic_instr { pub fn atomic_op(&self) -> nir_atomic_op { self.get_const_index(NIR_INTRINSIC_ATOMIC_OP) as nir_atomic_op } + + pub fn src_type(&self) -> ALUType { + ALUType(self.get_const_index(NIR_INTRINSIC_SRC_TYPE) as nir_alu_type) + } + + pub fn dest_type(&self) -> ALUType { + ALUType(self.get_const_index(NIR_INTRINSIC_DEST_TYPE) as nir_alu_type) + } + + pub fn rounding_mode(&self) -> nir_rounding_mode { + self.get_const_index(NIR_INTRINSIC_ROUNDING_MODE) as nir_rounding_mode + } + + pub fn saturate(&self) -> bool { + self.get_const_index(NIR_INTRINSIC_SATURATE) != 0 + } } impl nir_intrinsic_info {