| 436 | } |
| 437 | |
| 438 | static void ReconstructThreadState(FEXCore::Core::InternalThreadState* Thread, ARM64_NT_CONTEXT& Context) { |
| 439 | const auto& Config = SignalDelegator->GetConfig(); |
| 440 | auto& State = Thread->CurrentFrame->State; |
| 441 | |
| 442 | State.rip = CTX->RestoreRIPFromHostPC(Thread, Context.Pc); |
| 443 | |
| 444 | // Spill all SRA GPRs |
| 445 | for (size_t i = 0; i < Config.SRAGPRCount; i++) { |
| 446 | State.gregs[i] = Context.X[Config.SRAGPRMapping[i]]; |
| 447 | } |
| 448 | |
| 449 | // Spill all SRA FPRs |
| 450 | for (size_t i = 0; i < Config.SRAFPRCount; i++) { |
| 451 | memcpy(State.xmm.sse.data[i], &Context.V[Config.SRAFPRMapping[i]], sizeof(__uint128_t)); |
| 452 | } |
| 453 | |
| 454 | // Spill EFlags |
| 455 | uint32_t EFlags = CTX->ReconstructCompactedEFLAGS(Thread, true, Context.X, Context.Cpsr); |
| 456 | CTX->SetFlagsFromCompactedEFLAGS(Thread, EFlags); |
| 457 | } |
| 458 | |
| 459 | // Reconstructs an x64 context from the input thread's state, packed into a regular ARM64 context following the ARM64EC register mapping |
| 460 | static ARM64_NT_CONTEXT StoreStateToPackedECContext(FEXCore::Core::InternalThreadState* Thread, uint32_t FPCR, uint32_t FPSR) { |
no test coverage detected