1
0
Fork 0
forked from suyu/suyu

Apply suggestions from code review

Co-Authored-By: Mat M. <mathew1800@gmail.com>
This commit is contained in:
Nguyen Dac Nam 2020-03-13 15:35:15 +07:00 committed by GitHub
parent 70ff82f72d
commit 325977c0c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,14 +44,14 @@ u32 ShaderIR::DecodeBfe(NodeBlock& bb, u32 pc) {
Node v1 = Node v1 =
SignedOperation(OperationCode::ILogicalShiftRight, is_signed, op_a, Immediate(s)); SignedOperation(OperationCode::ILogicalShiftRight, is_signed, op_a, Immediate(s));
if (mask != 0) { if (mask != 0) {
v1 = SignedOperation(OperationCode::IBitwiseAnd, is_signed, v1, Immediate(mask)); v1 = SignedOperation(OperationCode::IBitwiseAnd, is_signed, std::move(v1), Immediate(mask));
} }
Node v2 = op_a; Node v2 = op_a;
if (mask != 0) { if (mask != 0) {
v2 = SignedOperation(OperationCode::IBitwiseAnd, is_signed, op_a, Immediate(mask)); v2 = SignedOperation(OperationCode::IBitwiseAnd, is_signed, std::move(v2), Immediate(mask));
} }
v2 = SignedOperation(OperationCode::ILogicalShiftLeft, is_signed, v2, Immediate(s)); v2 = SignedOperation(OperationCode::ILogicalShiftLeft, is_signed, std::move(v2), Immediate(s));
return SignedOperation(OperationCode::IBitwiseOr, is_signed, v1, v2); return SignedOperation(OperationCode::IBitwiseOr, is_signed, std::move(v1), std::move(v2));
}; };
op_a = swap(1, 0x55555555U); op_a = swap(1, 0x55555555U);
op_a = swap(2, 0x33333333U); op_a = swap(2, 0x33333333U);
@ -66,7 +66,7 @@ u32 ShaderIR::DecodeBfe(NodeBlock& bb, u32 pc) {
Immediate(8), Immediate(8)); Immediate(8), Immediate(8));
const auto result = const auto result =
SignedOperation(OperationCode::IBitfieldExtract, is_signed, op_a, offset, bits); SignedOperation(OperationCode::IBitfieldExtract, is_signed, op_a, offset, bits);
SetRegister(bb, instr.gpr0, result); SetRegister(bb, instr.gpr0, std::move(result));
return pc; return pc;
} }