| 9773 | } |
| 9774 | |
| 9775 | void doTestSet(U32 instruction, U32 value1, U32 value2, bool isSet) { |
| 9776 | for (U32 ed = 0; ed < 8; ed++) { |
| 9777 | Reg* e; |
| 9778 | |
| 9779 | U8 rm = ed | 0xC0; |
| 9780 | |
| 9781 | // cmp ed, value2 |
| 9782 | newInstructionWithRM(0x81, 0xf8 | (ed % 4), 0); |
| 9783 | if (cpu->big) { |
| 9784 | pushCode32(value2); |
| 9785 | } else { |
| 9786 | pushCode16(value2); |
| 9787 | } |
| 9788 | pushCode8(0x0F); |
| 9789 | pushCode8(instruction & 0xFF); |
| 9790 | pushCode8(rm); |
| 9791 | |
| 9792 | e = &cpu->reg[ed % 4]; |
| 9793 | e->u32 = value1; |
| 9794 | runTestCPU(); |
| 9795 | |
| 9796 | if (isSet) { |
| 9797 | if (ed > 3) { |
| 9798 | assertTrue(e->u32 == ((value1 & 0xffff00ff) | 0x00000100)); |
| 9799 | } else { |
| 9800 | assertTrue(e->u32 == ((value1 & 0xffffff00) | 0x00000001)); |
| 9801 | } |
| 9802 | } else { |
| 9803 | if (ed > 3) { |
| 9804 | assertTrue(e->u32 == (value1 & 0xffff00ff)); |
| 9805 | } else { |
| 9806 | assertTrue(e->u32 == (value1 & 0xffffff00)); |
| 9807 | } |
| 9808 | } |
| 9809 | } |
| 9810 | } |
| 9811 | |
| 9812 | void doTestSet(U32 instruction, bool isNotFlag, U32 flags, U32 cmpValueThatTriggersFlag, U32 cmpValueThatDoesNotTriggerFlag) { |
| 9813 | for (U32 setFlags = 0; setFlags < 3; setFlags++) { |
no test coverage detected