New issue 12 by bmar...@gmail.com: Enhancement: a way to access the
Reg8/Reg16 part of a Reg32
http://code.google.com/p/jitasm/issues/detail?id=12
It would be nice to have a way of extracting the low byte/word/dword from a
Reg; or, given a Reg8 variable to get the associated Reg32. It could prove
useful in code like this:
Reg32 r;
/* do some stuff with the generic Reg32 */
...
movzx(r, as_reg8(r)); /* zero extend low byte */
For now I hacked Reg32 (and the others) to include:
explicit Reg32(const Opd &r) :
Opd32(RegID::CreatePhysicalRegID(r.reg_.type, (PhysicalRegID) r.reg_.id)) {}
Reg8 r8() { Reg8 r(*this); return r; }
Reg16 r16() { Reg16 r(*this); return r; }
This allows me to write: movzx(r, r.r8());
But I'd still like a proper way to do it (the Opd argument to the
constructor is unsafe and I'm also abusing CreatePhysicalRegID).
Comment #1 on issue 12 by hikaruk...@gmail.com: Enhancement: a way to
access the Reg8/Reg16 part of a Reg32
http://code.google.com/p/jitasm/issues/detail?id=12
(No comment was entered for this change.)