gl_shader_decompiler: Implement POPC (#1203)

* Implement POPC

* implement invert
This commit is contained in:
Laku 2018-08-31 04:32:58 +03:00 committed by bunnei
parent d6accf96ff
commit 915ab81ec2
2 changed files with 19 additions and 0 deletions

View file

@ -1363,6 +1363,15 @@ private:
"((" + op_a + " << " + shift + ") + " + op_b + ')', 1, 1);
break;
}
case OpCode::Id::POPC_C:
case OpCode::Id::POPC_R:
case OpCode::Id::POPC_IMM: {
if (instr.popc.invert) {
op_b = "~(" + op_b + ')';
}
regs.SetRegisterToInteger(instr.gpr0, true, 0, "bitCount(" + op_b + ')', 1, 1);
break;
}
case OpCode::Id::SEL_C:
case OpCode::Id::SEL_R:
case OpCode::Id::SEL_IMM: {