NDK : Build X86 binary for Intel Atom platform

Abstract

This paper introduces detailed methods for building binary for the Intel Atom platform using the Android Native Development Kit (NDK) and optimizing performance.

Build

Same with NDK build for ARM based platform, for Intel Atom platform, it needs same directory structure, Android.mk and Application.mk too. Differences between them are just some flags.

Different flags for Intel Atom

      Application.mk  :  
           APP_ABI := x86
      Android.mk :
           LOCAL_CFLAGS +=  -march=i686 -mtune=atom -mstackrealign -msse3 -mfpmath=sse -m32
      For Android.mk, ARM related flags should be deleted.
      
      Intel official link : http://software.intel.com/en-us/articles/creating-and-porting-ndk-based-android-apps-for-ia/ external

Optimizing

  1. Porting NEON* Instructions to SSE.
  2. Use Inline instead of Frequently Used Short.
  3. Use Float instead of Double.
  4. Multi-thread coding.
  5. Use compiler flags.
    1. Compiler Flags
      1. -march=cpu-type : Generate instructions for the machine type cpu-type
      2. -mtune=cpu-type : Tune to cpu-type everything applicable about the generated code, except for the ABI and the set of available instructions.For example, if GCC is configured for i686 then -mtune=atom generates code that is tuned for atom but still runs on i686 machines.
      3. -msse3 : Enable the use of instructions in the SSE3.
      4. -mfpmath=sse : Generate floating-point arithmetic for selected see unit.
      5. -m32 : The -m32 option sets int, long, and pointer types to 32 bits, and generates code that runs on any i386 system.
    2. For more flags, please refer to http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html external.

Others

X86 project for OS engine is added into svn(both trunk and V3.7C), you can refer to it and also with the NDK documents, which locate at $NDK_PATH/docs.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值