Merge pull request #3437 from namkazt/patch-5

shader_conversion: add conversion I2F for Short
This commit is contained in:
bunnei 2020-02-19 11:27:28 -05:00 committed by GitHub
commit fd4c5463e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -83,14 +83,14 @@ 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 = static_cast<u32>(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, if (instr.conversion.src_size == Register::Size::Short) {
std::move(value), Immediate(offset)); ASSERT(offset == 0 || offset == 2);
} }
} else { value = SignedOperation(OperationCode::ILogicalShiftRight, input_signed,
UNIMPLEMENTED_IF(instr.conversion.int_src.selector != 0); std::move(value), Immediate(offset * 8));
} }
value = ConvertIntegerSize(value, instr.conversion.src_size, input_signed); value = ConvertIntegerSize(value, instr.conversion.src_size, input_signed);