implement invert

This commit is contained in:
Laku
2018-08-31 01:55:39 +03:00
parent 9683918928
commit e7487bf220
2 changed files with 7 additions and 0 deletions

View File

@@ -326,6 +326,10 @@ union Instruction {
BitField<49, 1, u64> negate_a;
} alu_integer;
union {
BitField<40, 1, u64> invert;
} popc;
union {
BitField<39, 3, u64> pred;
BitField<42, 1, u64> neg_pred;

View File

@@ -1305,6 +1305,9 @@ private:
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;
}