shader: extract the V_CVT_F32_UBYTE source byte with one bit-field extract

This commit is contained in:
nmzik
2026-10-22 00:30:39 +02:00
parent ce54aa8d14
commit 9e4234cdbe
@@ -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}));
}