From 9e4234cdbe6824feb91e17a1f892793dc0ae15ba Mon Sep 17 00:00:00 2001 From: nmzik Date: Thu, 22 Oct 2026 00:30:39 +0200 Subject: [PATCH] shader: extract the V_CVT_F32_UBYTE source byte with one bit-field extract --- .../shader/recompiler/frontend/translate/Convert.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/graphics/shader/recompiler/frontend/translate/Convert.cpp b/src/graphics/shader/recompiler/frontend/translate/Convert.cpp index 33253384f..ee4fc9b0c 100644 --- a/src/graphics/shader/recompiler/frontend/translate/Convert.cpp +++ b/src/graphics/shader/recompiler/frontend/translate/Convert.cpp @@ -8,9 +8,8 @@ IR::F32 Translator::SelectF32(IR::U1 condition, IR::F32 true_value, IR::F32 fals void Translator::V_CVT_F32_UBYTE(const Decoder::Instruction& inst, uint32_t byte_index) { const auto source = ReadU32(SourceAt(inst, 0)); - const auto byte = - ir.BitwiseAnd(ir.ShiftRightLogical(source, IR::U32(IR::Value(byte_index * 8u))), - IR::U32(IR::Value(0xffu))); + const auto byte = ir.Emit(IR::ValueOpcode::BitFieldUExtract, + {source, IR::Value(byte_index * 8u), IR::Value(8u)}); WriteOperand(DestinationOperand(inst), ir.Emit(IR::ValueOpcode::ConvertF32U32, {byte})); }