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 7 of 7 Topic 4637 of 4729
Post > Topic >>

Re: x86/x64 JIT assembler for C++

by "Alexei A. Frounze" <spamtrap@[EMAIL PROTECTED] > Apr 30, 2008 at 08:16 PM

On Apr 30, 6:16 pm, herumi  <spamt...@[EMAIL PROTECTED]
> wrote:
> Hi Phil,
>
> >I notice that for code alignment you use a sequence of
> >individual nops. Might the following be useful?
>
> Thank you for your advice.
> I had tried to add the optimized nop when I was implementing align()
> before.
>
> But the best way to optimize nop is different according to type of
> CPU,
> then detection of the type is necessary.
>
> Though I can write the code, I don't think the function should be in
> xbyak.h.
> I intend to make xbyak_util.h(for example) and add the function in the
> header.
>
> cf.
>  "Software Optimization Guide for AMD64
Processors"http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_do...
> 4.12 Code Padding with Operand-Size Override and NOP
>
> 90
> 66 90
> 66 66 90
> 66 66 66 90
> 66 66 90 66 90

These should work, but some of them are multiple instructions.

> "Intel 64 and IA-32 Architectures Optimization Reference Manual"
> 3.5.1.8 Using
NOPshttp://download.intel.com/design/PentiumII/manuals/24512701.pdf
>
> 90                ; xchg, eax, eax

This is a true NOP.

> 89 C0             ; mov eax, eax

^^^ this one isn't a true NOP in 64-bit mode because of extension to
64 bits.

> 8D 40 00          ; lea eax, [eax + 0x00]

Nor is this one for the same reason.

As far as I can tell by looking at both intel and AMD processor
manuals, 0F 1F + ModRM is a common true multi-byte NOP. It's
availability depends on CPUID, though.

Alex
 




 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 Thu Jul 24 14:52:37 CDT 2008.