Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > Re: x86/x64 JIT...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 7 Topic 4637 of 4710
Post > Topic >>

Re: x86/x64 JIT assembler for C++

by Phil Carmody <thefatphil_demunged@[EMAIL PROTECTED] > Apr 30, 2008 at 01:13 PM

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
 




 7 Posts in Topic:
x86/x64 JIT assembler for C++
herumi <spamtrap@[EMAI  2008-04-29 18:27:11 
Re: x86/x64 JIT assembler for C++
"Alexei A. Frounze&q  2008-04-29 22:58:05 
Re: x86/x64 JIT assembler for C++
herumi <spamtrap@[EMAI  2008-04-30 01:11:48 
Re: x86/x64 JIT assembler for C++
Phil Carmody <thefatph  2008-04-30 13:13:00 
Re: x86/x64 JIT assembler for C++
"Wolfgang Kern"  2008-05-01 10:46:05 
Re: x86/x64 JIT assembler for C++
herumi <spamtrap@[EMA  2008-04-30 18:16:58 
Re: x86/x64 JIT assembler for C++
"Alexei A. Frounze&q  2008-04-30 20:16:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 6 20:22:03 CDT 2008.