Open meithecatte opened 1 year ago
agreed on all counts! yaxpeax_core
has a pretty unsatisfactory interface for this that i'd never gotten happy enough with to move over to arch
, but i definitely agree that "this register selects the u64 you're using to represent rcx
" or similar should be something this crate can answer. reading between the lines, that's kind of related to what @i509VCB was getting at over here (agh goodness that's an old issue)
so, that said, i think something more specifically suited to x86 is a great excuse to think about what a good interface would feel like.
things off the top of my head:
ch -> rcx
)ch -> cx
, cx -> ecx
, ecx -> rcx
)ch -> {rcx, ecx, cx, cl}
, maybe include ch
in the list idk)ch -> {cx, cl}
, maybe include ch
in the list idk)ch -> (rcx, 8)
, cl -> (rcx, 0)
)and of course at the minimum, "what is the largest alias?" and "what is the smallest larger alias?" should be const fn
.
I find myself writing some ugly code to answer questions like "which 64-bit GPR is
ch
a part of? which bits?".I would expect
yaxpeax
to provide APIs onRegSpec
for this, though I understand if this is something you want to model inyaxpeax_arch
, with the API design questions this involves.