Information about inline assembler

Source: Internet
Author: User

Inline assemblyIt refers to directly adding assembly code to the source code, so that the compiled assembly code contains embedded assembly code to achieve code optimization.

Sometimes Programmers think that the performance of compiled assembly code is certainly better than that of compiled assembly code,

However, if the compiler optimization option is enabled, the optimized assembly code generated by the compiler generally outweighs the compiled assembly code,

This is a tragedy.

 

Note that,Restrained assembly is not cross-platformSo programmers need to write different inline assembly code based on different platforms to achieve cross-platform purposes.

 

The following documents are collected about the restrained compilation.

1.GCC compiling environment.

English:

Http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html#s2

Chinese:

Http://blog.csdn.net/wuyao721/article/details/3573598

 

2.Ms vc ++ EnvironmentCompiled in an restrained manner.

Http://msdn.microsoft.com/en-us/library/4ks26t93 (V = vs.71). aspx

However, the tragedy is that vs currently does not support restrained compilation under intel x64 architecture,

However, there are some alternative methods:

Http://mariusbancila.ro/blog/2010/10/17/no-more-inline-asm-in-vc-on-x64/

 

3. for assembly languages,Intel and at&tThere are different assembly syntaxes.

Syntax differences:

Http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html#s3

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.