Thanks very much! The third comment you mentioned is precisely part of what I need, I've built and tried that branch's drreg on 20.04 ubuntu machine, though it failed to successively build because some invalid type argument, it's implementation is a great help for me. I'll try to pick that up and extend it to support opmask register saving and restoring
I have another question to ask.
Is there a mechanism or feature in DynamoRIO that can implement the following scenario: instructions to be executed in a code cache include (using x86_64 assembly as an example):
```
vptestmb {%k0} %ymm17 %ymm17 -> %k2
vpcmpb {%k2} $0x00 %ymm17 (%rsi)[32byte] -> %k1
vmovdqu64 {%k0} (%rsi)[32byte] -> %ymm19
.....
```
During the construction of this `instrlist`, I want to insert an instruction `kmovq %k{idx}, mem_addr` after each instruction that uses a mask register as the destination operand, to store the current value of `%k{idx}` in a memory location somewhere in the current address space. Then, when the execution flow returns from the code cache to `d_r_dispatch`, I can retrieve the value stored at that memory address in the dispatch.c file or interp.c file, .etc?
I am looking for any available implementations or examples that I can refer to. Thank you extremely much!