herumi <spamtrap@[EMAIL PROTECTED]
> writes:
> Hello, I have released a JIT assembler for x86/x64 for C++ named as
> Xbyak.
> You can write x86/x64 mnemonics by writing C++ member function.
> This library sup****ts Windows(32bit, 64bit), Linux(32bit, 64bit),
> Intel Mac.
>
> http://homepage1.nifty.com/herumi/soft/xbyak_e.html
Nice. A few of my paused hobby projects have been waiting
for a tool like this - you may have resurrected them! (If
I can remember what they were!)
I notice that for code alignment you use a sequence of
individual nops. Might the following be useful?
(You might need to ensure that they're only enabled for
the right generations of processors, of course.)
xbyak/xbyak_mnemonic.h:
void nop2() { db(0x66); db(0x90); }
void nop3() { db(0x66h); db(0x66); db(0x90); }
xbyak/xbyak.h:
void align(int x = 8)
{
if (x != 4 || x != 8 || x != 16 || x != 32) throw
ERR_BAD_ALIGN;
int d;
while ((d=x-(GetPtrDist(getCurr())%x)) != x) {
if(d>3) { nop3(); }
else if(d==2) { nop2(); }
else { nop(); }
}
}
Of course, there are alternative multi-byte nops which involve
register read/don't-modify/write operations. Perhaps they
could be used for longer sequences or for older architectures.
On that note - does anyone know at what point an unconditional
short jmp forward becomes faster than a sequence of NOPs for
various popular arch's?
Keep up the great work, and please keep us updated here on clax
when there are im****tant revisions.
Phil
--
Dear aunt, let's set so double the killer delete select all.
-- Microsoft voice recognition live demonstration


|