Update translate.cpp

This commit is contained in:
DanielSvoboda 2024-07-28 23:38:40 -03:00 committed by GitHub
parent f9cc4ebd65
commit d1f2250a20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -164,6 +164,8 @@ IR::U32F32 Translator::GetSrc(const InstOperand& operand, bool force_flt) {
value = ir.GetVccHi(); value = ir.GetVccHi();
} }
break; break;
case OperandField::M0:
value = m0_value;
default: default:
UNREACHABLE(); UNREACHABLE();
} }
@ -327,7 +329,7 @@ void Translator::SetDst(const InstOperand& operand, const IR::U32F32& value) {
if (operand.output_modifier.multiplier != 0.f) { if (operand.output_modifier.multiplier != 0.f) {
result = ir.FPMul(result, ir.Imm32(operand.output_modifier.multiplier)); result = ir.FPMul(result, ir.Imm32(operand.output_modifier.multiplier));
} }
if (operand.output_modifier.clamp) { if (operand.output_modifier.clamp && value.Type() == IR::Type::F32) {
result = ir.FPSaturate(value); result = ir.FPSaturate(value);
} }
switch (operand.field) { switch (operand.field) {
@ -340,7 +342,7 @@ void Translator::SetDst(const InstOperand& operand, const IR::U32F32& value) {
case OperandField::VccHi: case OperandField::VccHi:
return ir.SetVccHi(result); return ir.SetVccHi(result);
case OperandField::M0: case OperandField::M0:
break; m0_value = result;
default: default:
UNREACHABLE(); UNREACHABLE();
} }