mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-27 16:02:37 +00:00
shader: extract the V_CVT_F32_UBYTE source byte with one bit-field extract
This commit is contained in:
1 parent
ce54aa8d14
commit
9e4234cdbe
1 file changed
+2
-3
@@ -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) {
|
void Translator::V_CVT_F32_UBYTE(const Decoder::Instruction& inst, uint32_t byte_index) {
|
||||||
const auto source = ReadU32(SourceAt(inst, 0));
|
const auto source = ReadU32(SourceAt(inst, 0));
|
||||||
const auto byte =
|
const auto byte = ir.Emit(IR::ValueOpcode::BitFieldUExtract,
|
||||||
ir.BitwiseAnd(ir.ShiftRightLogical(source, IR::U32(IR::Value(byte_index * 8u))),
|
{source, IR::Value(byte_index * 8u), IR::Value(8u)});
|
||||||
IR::U32(IR::Value(0xffu)));
|
|
||||||
WriteOperand(DestinationOperand(inst), ir.Emit(IR::ValueOpcode::ConvertF32U32, {byte}));
|
WriteOperand(DestinationOperand(inst), ir.Emit(IR::ValueOpcode::ConvertF32U32, {byte}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user