| 626 | } |
| 627 | |
| 628 | void ERET() |
| 629 | { |
| 630 | #ifdef ENABLE_VTUNE |
| 631 | // Allow to stop vtune in a predictable way to compare runs |
| 632 | // Of course, the limit will depend on the game. |
| 633 | const u32 million = 1000 * 1000; |
| 634 | static u32 vtune = 0; |
| 635 | vtune++; |
| 636 | |
| 637 | // quick_exit vs exit: quick_exit won't call static storage destructor (OS will manage). It helps |
| 638 | // avoiding the race condition between threads destruction. |
| 639 | if (vtune > 30 * million) |
| 640 | { |
| 641 | Console.WriteLn("VTUNE: quick_exit"); |
| 642 | std::quick_exit(EXIT_SUCCESS); |
| 643 | } |
| 644 | else if (!(vtune % million)) |
| 645 | { |
| 646 | Console.WriteLn("VTUNE: ERET was called %uM times", vtune / million); |
| 647 | } |
| 648 | |
| 649 | #endif |
| 650 | |
| 651 | if (cpuRegs.CP0.n.Status.b.ERL) |
| 652 | { |
| 653 | cpuRegs.pc = cpuRegs.CP0.n.ErrorEPC; |
| 654 | cpuRegs.CP0.n.Status.b.ERL = 0; |
| 655 | } |
| 656 | else |
| 657 | { |
| 658 | cpuRegs.pc = cpuRegs.CP0.n.EPC; |
| 659 | cpuRegs.CP0.n.Status.b.EXL = 0; |
| 660 | } |
| 661 | cpuUpdateOperationMode(); |
| 662 | cpuSetNextEventDelta(4); |
| 663 | intSetBranch(); |
| 664 | } |
| 665 | |
| 666 | void DI() |
| 667 | { |
nothing calls this directly
no test coverage detected