The patch adds drx support to detect and restore the scratch mask as well as the destination mask state in the AVX-512 scatter emulation sequence.
Adds two more states to the AVX2 gather and the AVX-512 gather state machine making them more robust detecting the emulation sequence.
Fixes a bug where we read register values from mcontext instead of raw_mcontext when restoring it, which matters for example if the register is the stack pointer.
Fixes some bugs in the illustrating comments.
Removes the relevant errors from client.drx-scattergather.
Issue: #2985 (closed)