1
0
Fork 0
forked from suyu/suyu

shader_conversion: add conversion I2F for Short

This commit is contained in:
Nguyen Dac Nam 2020-02-19 10:54:37 +07:00 committed by GitHub
parent e545c2322c
commit 556f3a6e9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -83,16 +83,13 @@ u32 ShaderIR::DecodeConversion(NodeBlock& bb, u32 pc) {
const bool input_signed = instr.conversion.is_input_signed; const bool input_signed = instr.conversion.is_input_signed;
if (instr.conversion.src_size == Register::Size::Byte) { if (const u32 offset = instr.conversion.int_src.selector; offset > 0) {
const u32 offset = static_cast<u32>(instr.conversion.int_src.selector) * 8; ASSERT(instr.conversion.src_size == Register::Size::Byte ||
if (offset > 0) { instr.conversion.src_size == Register::Size::Short);
value = SignedOperation(OperationCode::ILogicalShiftRight, input_signed, value = SignedOperation(OperationCode::ILogicalShiftRight, input_signed,
std::move(value), Immediate(offset)); std::move(value), Immediate(offset * 8));
}
} else {
UNIMPLEMENTED_IF(instr.conversion.int_src.selector != 0);
} }
value = ConvertIntegerSize(value, instr.conversion.src_size, input_signed); value = ConvertIntegerSize(value, instr.conversion.src_size, input_signed);
value = GetOperandAbsNegInteger(value, instr.conversion.abs_a, false, input_signed); value = GetOperandAbsNegInteger(value, instr.conversion.abs_a, false, input_signed);
value = SignedOperation(OperationCode::FCastInteger, input_signed, PRECISE, value); value = SignedOperation(OperationCode::FCastInteger, input_signed, PRECISE, value);