const uint32_t op1 = bits(machInst, 10, 8);
const uint32_t op2 = bits(machInst, 7, 0);
if (op1 != 0) {
- return new WarnUnimplemented("cps", machInst);
+ const bool enable = bits(machInst, 10, 9) == 0x2;
+ const uint32_t mods = bits(machInst, 8, 0) |
+ ((enable ? 1 : 0) << 9);
+ return new Cps(machInst, mods);
} else if ((op2 & 0xf0) == 0xf0) {
return new WarnUnimplemented("dbg", machInst);
} else {
if (opBits == 2) {
return new Setend(machInst, bits(machInst, 3));
} else if (opBits == 3) {
- return new WarnUnimplemented("cps", machInst);
+ const bool enable = (bits(machInst, 4) == 0);
+ const uint32_t mods = (bits(machInst, 2, 0) << 5) |
+ ((enable ? 1 : 0) << 9);
+ return new Cps(machInst, mods);
}
}
case 0x9:
if (bits((uint32_t)rn, 0) == 1 && op2 == 0) {
return new Setend(machInst, bits(machInst, 9));
} else if (bits((uint32_t)rn, 0) == 0 && bits(op2, 1) == 0) {
- return new WarnUnimplemented("cps", machInst);
+ const bool enable = bits(machInst, 19, 18) == 0x2;
+ const uint32_t mods = bits(machInst, 4, 0) |
+ (bits(machInst, 8, 6) << 5) |
+ (bits(machInst, 17) << 8) |
+ ((enable ? 1 : 0) << 9);
+ return new Cps(machInst, mods);
}
} else if (bits(op1, 6, 5) == 0x1) {
return new WarnUnimplemented(