SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
Optimizing NDK projects
for multiple CPU architectures


       Alexander Weggerle
       Technical Consultant Engineer
       Intel Software and Services Group
Agenda

• Compatibility

• Compiler options

• Code paths

• Differences between ARM and x86

• Publishing




                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Introduction

• Performance critical apps are popular
 • Games
 • Real time multimedia
 • Augmented reality

• Users are sensitive
 • Don’t accept lags
 • Fluid animations
 • Minimal load time

                  Optimization is important


                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Compatibility

             “I want my app to run on all architectures”




• You already done for Java & HTML

• NDK based apps usually just needs a recompilation
          APP_ABI := all

                                                            Application.mk




                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners.
Agenda

• Compatibility

• Compiler options

• Code paths

• Differences between ARM and x86

• Publishing




                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Target compiler options

• NDK-build system Android.mk file evaluated for
  each architecture

• Variable TARGET_ARCH_ABI describes actual
  architecture

  TARGET_ARCH_ABI                                ifeq ($(TARGET_ARCH_ABI),x86)
                                                 LOCAL_CFLAGS     := -mtune=atom -mssse3
  x86                                            endif

  armeabi                                        ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
                                                 LOCAL_CFLAGS     := -march=armv7-a
  armeabi-v7a                                    Endif
  mips                                                                                  Android.mk




                       Copyright© 2012, Intel Corporation. All rights reserved.
                 *Other brands and names are the property of their respective owners.
Recommended Compiler options (x86)

• -mtune=atom
 • Out of Order scheduling

• -march=atom
 • movbe instruction
 • Code is only guaranteed to run on Atom.
   – Might not run on emulator or other CPUs

• -ansi-alias / -restrict / -no-prec-div




                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners.
Agenda

• Compatibility

• Compiler options

• Code paths

• Differences between ARM and x86

• Publishing




                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Multiple Code Paths

• Different reasons for multiple code paths
 • Optimizing for multiple architectures
 • Single Instruction Multiple Data (SIMD)
 • Assembly kernels
 • Memory alignment
 • Instruction set support




                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Multiple Code Paths
Compiler macros
• Directly inside source code

• No runtime overhead

• Works with all build configurations
         #ifdef __i386__
                  strlcat(buf, "__i386__", sizeof(buf));
         #endif
         #ifdef __arm__
                  strlcat(buf, "__arm__", sizeof(buf));
         #endif
         #ifdef _MIPS_ARCH
                  strlcat(buf, "_MIPS_ARCH", sizeof(buf));
         #endif

                                                                                            source.c




                           Copyright© 2012, Intel Corporation. All rights reserved.
                     *Other brands and names are the property of their respective owners.
Multiple Code Paths
Make system
• Make system will select source file depending on
  architecture

• No runtime overhead

       arch_x86.cpp
       const char *getTarget ();


       arch_arm.cpp                             arch.h                                         cpufeaturestest.cpp
       const char *getTarget ();                const char *getTarget ();                      printf(“%s”, getTarget());

       arch_default.cpp
       const char *getTarget ();




                                         Copyright© 2012, Intel Corporation. All rights reserved.
                                   *Other brands and names are the property of their respective owners.
Multiple Code Paths
Cpufeatures API
• Checks for architecture and
  special CPU features

• Uses compiler macros +
  runtime detection internally
 • Small runtime overhead




                           Copyright© 2012, Intel Corporation. All rights reserved.
                     *Other brands and names are the property of their respective owners.
Agenda

• Compatibility

• Compiler options

• Code paths

• Differences between ARM and x86

• Publishing




                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Porting Native (C/C++) Android* Apps to x86

http://software.intel.com/en-us/articles/ndk-android-application-porting-
methodologies/

            Native Apps
• Optimized NDK for Intel Atom based
  devices available on
  http://developer.android.com/sdk/nd
  k/index.html since July’11.
• For most apps, changing the make
  file and a recompile should be
  sufficient to port to Intel Atom
  devices.
• If ARM-specific features are used,
  Intel SSE equivalents should be
  added (build flag)
• Developer recompiles, re-packages
  and publishes.



                                  Copyright© 2012, Intel Corporation. All rights reserved.
                            *Other brands and names are the property of their respective owners.
ARM* NEON to Intel® SSE

• Single Instruction Multiple Data (SIMD)

• Most ARM NEON functions have a 1:1 equivalent in
  Intel® SSE

• Intel provides C++ header file to do the mapping
        // VADD.I8 d0,d0,d0
 int8x8_t    vadd_s8(int8x8_t a, int8x8_t b);
 #ifdef USE_MMX
        #define vadd_s8 _mm_add_pi8   //MMX
 #else
        #define vadd_s8 _mm_add_epi8
 #endif

                                                                                          neonvssse.h


                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners.
Differences between ARM and x86
Alignment
• ARM uses aligned, x86 uses packed memory

  struct TestStruct
                                                                           ARM
  {
     int mVar1;
     long long mVar2;
     int mVar3;
  };
                                                                            x86




• Compiler parameter helps to workaround
  -malign-double




                              Copyright© 2012, Intel Corporation. All rights reserved.
                        *Other brands and names are the property of their respective owners.
Agenda

• Compatibility

• Compiler options

• Code paths

• Differences between ARM and x86

• Publishing




                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Market
Fat binary
• Include all binaries into one apk
                                                libs/armeabi
       Source


                 ndk-build                                                         apkbuilder

                                              libs/armeabi-
                                                    v7a                                         …



                                                    libs/x86




• Device removes incompatible libs at installation

                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Market
Multiple APKs
• Support for different …
 • Texture formats
 • Screen sizes and densities
 • Platform versions
 • CPU architectures

• Saves bandwidth and space while installation




                        Copyright© 2012, Intel Corporation. All rights reserved.
                  *Other brands and names are the property of their respective owners.
Conclusion & Call to action

• NDK provides plenty of mechanisms to
  differentiate between architectures

• Recompile your NDK based app with
  APP_ABI := all




                      Copyright© 2012, Intel Corporation. All rights reserved.
                *Other brands and names are the property of their respective owners.
21
Legal Disclaimer & Optimization Notice

        INFORMATION IN THIS DOCUMENT IS PROVIDED “AS IS”. NO LICENSE, EXPRESS OR IMPLIED, BY
        ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS
        DOCUMENT. INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR
        IMPLIED WARRANTY, RELATING TO THIS INFORMATION INCLUDING LIABILITY OR WARRANTIES
        RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY
        PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.

        Software and workloads used in performance tests may have been optimized for performance only on
        Intel microprocessors. Performance tests, such as SYSmark and MobileMark, are measured using
        specific computer systems, components, software, operations and functions. Any change to any of
        those factors may cause the results to vary. You should consult other information and performance
        tests to assist you in fully evaluating your contemplated purchases, including the performance of that
        product when combined with other products.

        Copyright © , Intel Corporation. All rights reserved. Intel, the Intel logo, Xeon, Core, VTune, and Cilk
        are trademarks of Intel Corporation in the U.S. and other countries.


             Optimization Notice
             Intel’s compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that
             are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and
             other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on
             microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended
             for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for
             Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information
             regarding the specific instruction sets covered by this notice.
                                                                                                          Notice revision #20110804


22                                                                  Intel Confidential
                                                      Copyright© 2012, Intel Corporation. All rights reserved.
17.04.2013                                      *Other brands and names are the property of their respective owners.
Droidcon2013 ndk cpu_architecture_optimization_weggerle_intel

Más contenido relacionado

La actualidad más candente

Intel® MPI Library e OpenMP* - Intel Software Conference 2013
Intel® MPI Library e OpenMP* - Intel Software Conference 2013Intel® MPI Library e OpenMP* - Intel Software Conference 2013
Intel® MPI Library e OpenMP* - Intel Software Conference 2013Intel Software Brasil
 
EclipseCon 2011: Deciphering the CDT debugger alphabet soup
EclipseCon 2011: Deciphering the CDT debugger alphabet soupEclipseCon 2011: Deciphering the CDT debugger alphabet soup
EclipseCon 2011: Deciphering the CDT debugger alphabet soupBruce Griffith
 
Droid con 2012 bangalore v2.0
Droid con 2012   bangalore v2.0Droid con 2012   bangalore v2.0
Droid con 2012 bangalore v2.0Premchander Rao
 
Arista @ HPC on Wall Street 2012
Arista @ HPC on Wall Street 2012Arista @ HPC on Wall Street 2012
Arista @ HPC on Wall Street 2012Kazunori Sato
 
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...jaxLondonConference
 
clCaffe*: Unleashing the Power of Intel Graphics for Deep Learning Acceleration
clCaffe*: Unleashing the Power of Intel Graphics for Deep Learning AccelerationclCaffe*: Unleashing the Power of Intel Graphics for Deep Learning Acceleration
clCaffe*: Unleashing the Power of Intel Graphics for Deep Learning AccelerationIntel® Software
 
Open source hardware and the web
Open source hardware and the webOpen source hardware and the web
Open source hardware and the webada fruit
 
резников дмитрий
резников дмитрийрезников дмитрий
резников дмитрийapps4allru
 
HSA Introduction Hot Chips 2013
HSA Introduction  Hot Chips 2013HSA Introduction  Hot Chips 2013
HSA Introduction Hot Chips 2013HSA Foundation
 
Code Reuse Made Easy: Uncovering the Hidden Gems of Corporate and Open Source...
Code Reuse Made Easy: Uncovering the Hidden Gems of Corporate and Open Source...Code Reuse Made Easy: Uncovering the Hidden Gems of Corporate and Open Source...
Code Reuse Made Easy: Uncovering the Hidden Gems of Corporate and Open Source...Perforce
 
Develop Community-based Android Distribution and Upstreaming Experience
Develop Community-based Android Distribution and Upstreaming Experience Develop Community-based Android Distribution and Upstreaming Experience
Develop Community-based Android Distribution and Upstreaming Experience National Cheng Kung University
 
OpenMAX Overview
OpenMAX OverviewOpenMAX Overview
OpenMAX OverviewYoss Cohen
 
Intel_Low Power Intelligent Solutions with Intel Atom Processor
Intel_Low Power Intelligent Solutions with Intel Atom ProcessorIntel_Low Power Intelligent Solutions with Intel Atom Processor
Intel_Low Power Intelligent Solutions with Intel Atom ProcessorIşınsu Akçetin
 
Intel® Advanced Vector Extensions Support in GNU Compiler Collection
Intel® Advanced Vector Extensions Support in GNU Compiler CollectionIntel® Advanced Vector Extensions Support in GNU Compiler Collection
Intel® Advanced Vector Extensions Support in GNU Compiler CollectionDESMOND YUEN
 
Kernel Recipes 2014 - Testing Video4Linux Applications and Drivers
Kernel Recipes 2014 - Testing Video4Linux Applications and DriversKernel Recipes 2014 - Testing Video4Linux Applications and Drivers
Kernel Recipes 2014 - Testing Video4Linux Applications and DriversAnne Nicolas
 

La actualidad más candente (20)

Accelerated Android Development with Linaro
Accelerated Android Development with LinaroAccelerated Android Development with Linaro
Accelerated Android Development with Linaro
 
Intel® MPI Library e OpenMP* - Intel Software Conference 2013
Intel® MPI Library e OpenMP* - Intel Software Conference 2013Intel® MPI Library e OpenMP* - Intel Software Conference 2013
Intel® MPI Library e OpenMP* - Intel Software Conference 2013
 
EclipseCon 2011: Deciphering the CDT debugger alphabet soup
EclipseCon 2011: Deciphering the CDT debugger alphabet soupEclipseCon 2011: Deciphering the CDT debugger alphabet soup
EclipseCon 2011: Deciphering the CDT debugger alphabet soup
 
Droid con 2012 bangalore v2.0
Droid con 2012   bangalore v2.0Droid con 2012   bangalore v2.0
Droid con 2012 bangalore v2.0
 
Arista @ HPC on Wall Street 2012
Arista @ HPC on Wall Street 2012Arista @ HPC on Wall Street 2012
Arista @ HPC on Wall Street 2012
 
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
Do You Like Coffee with Your dessert? Java and the Raspberry Pi - Simon Ritte...
 
Nvidia Cuda Apps Jun27 11
Nvidia Cuda Apps Jun27 11Nvidia Cuda Apps Jun27 11
Nvidia Cuda Apps Jun27 11
 
Guides To Analyzing WebKit Performance
Guides To Analyzing WebKit PerformanceGuides To Analyzing WebKit Performance
Guides To Analyzing WebKit Performance
 
clCaffe*: Unleashing the Power of Intel Graphics for Deep Learning Acceleration
clCaffe*: Unleashing the Power of Intel Graphics for Deep Learning AccelerationclCaffe*: Unleashing the Power of Intel Graphics for Deep Learning Acceleration
clCaffe*: Unleashing the Power of Intel Graphics for Deep Learning Acceleration
 
Open source hardware and the web
Open source hardware and the webOpen source hardware and the web
Open source hardware and the web
 
резников дмитрий
резников дмитрийрезников дмитрий
резников дмитрий
 
HSA Introduction Hot Chips 2013
HSA Introduction  Hot Chips 2013HSA Introduction  Hot Chips 2013
HSA Introduction Hot Chips 2013
 
Understanding open max il
Understanding open max ilUnderstanding open max il
Understanding open max il
 
Code Reuse Made Easy: Uncovering the Hidden Gems of Corporate and Open Source...
Code Reuse Made Easy: Uncovering the Hidden Gems of Corporate and Open Source...Code Reuse Made Easy: Uncovering the Hidden Gems of Corporate and Open Source...
Code Reuse Made Easy: Uncovering the Hidden Gems of Corporate and Open Source...
 
Develop Community-based Android Distribution and Upstreaming Experience
Develop Community-based Android Distribution and Upstreaming Experience Develop Community-based Android Distribution and Upstreaming Experience
Develop Community-based Android Distribution and Upstreaming Experience
 
ARM
ARMARM
ARM
 
OpenMAX Overview
OpenMAX OverviewOpenMAX Overview
OpenMAX Overview
 
Intel_Low Power Intelligent Solutions with Intel Atom Processor
Intel_Low Power Intelligent Solutions with Intel Atom ProcessorIntel_Low Power Intelligent Solutions with Intel Atom Processor
Intel_Low Power Intelligent Solutions with Intel Atom Processor
 
Intel® Advanced Vector Extensions Support in GNU Compiler Collection
Intel® Advanced Vector Extensions Support in GNU Compiler CollectionIntel® Advanced Vector Extensions Support in GNU Compiler Collection
Intel® Advanced Vector Extensions Support in GNU Compiler Collection
 
Kernel Recipes 2014 - Testing Video4Linux Applications and Drivers
Kernel Recipes 2014 - Testing Video4Linux Applications and DriversKernel Recipes 2014 - Testing Video4Linux Applications and Drivers
Kernel Recipes 2014 - Testing Video4Linux Applications and Drivers
 

Destacado

Microwave Devices Lecture08
Microwave Devices Lecture08Microwave Devices Lecture08
Microwave Devices Lecture08Amr Al-Awamry
 
Dvortsov A. V., "Resonance Method of Measuring a Stuff Dielectric Properties ...
Dvortsov A. V., "Resonance Method of Measuring a Stuff Dielectric Properties ...Dvortsov A. V., "Resonance Method of Measuring a Stuff Dielectric Properties ...
Dvortsov A. V., "Resonance Method of Measuring a Stuff Dielectric Properties ...Mikhail Vink
 
DIC_video_coding_standards_07
DIC_video_coding_standards_07DIC_video_coding_standards_07
DIC_video_coding_standards_07aniruddh Tyagi
 
A review of temperature compensation techniques 2014 lisi_v01
A review of temperature compensation techniques 2014 lisi_v01A review of temperature compensation techniques 2014 lisi_v01
A review of temperature compensation techniques 2014 lisi_v01Marco Lisi
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limitsDroidcon Berlin
 
Ibtc dwt hybrid coding of digital images
Ibtc dwt hybrid coding of digital imagesIbtc dwt hybrid coding of digital images
Ibtc dwt hybrid coding of digital imagesZakaria Zubi
 
Reborn Digital: coding text
Reborn Digital: coding textReborn Digital: coding text
Reborn Digital: coding textPip Willcox
 
Droidcon de 2014 google cast
Droidcon de 2014   google castDroidcon de 2014   google cast
Droidcon de 2014 google castDroidcon Berlin
 

Destacado (9)

Microwave Devices Lecture08
Microwave Devices Lecture08Microwave Devices Lecture08
Microwave Devices Lecture08
 
Dvortsov A. V., "Resonance Method of Measuring a Stuff Dielectric Properties ...
Dvortsov A. V., "Resonance Method of Measuring a Stuff Dielectric Properties ...Dvortsov A. V., "Resonance Method of Measuring a Stuff Dielectric Properties ...
Dvortsov A. V., "Resonance Method of Measuring a Stuff Dielectric Properties ...
 
DIC_video_coding_standards_07
DIC_video_coding_standards_07DIC_video_coding_standards_07
DIC_video_coding_standards_07
 
A review of temperature compensation techniques 2014 lisi_v01
A review of temperature compensation techniques 2014 lisi_v01A review of temperature compensation techniques 2014 lisi_v01
A review of temperature compensation techniques 2014 lisi_v01
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limits
 
Ibtc dwt hybrid coding of digital images
Ibtc dwt hybrid coding of digital imagesIbtc dwt hybrid coding of digital images
Ibtc dwt hybrid coding of digital images
 
crashing in style
crashing in stylecrashing in style
crashing in style
 
Reborn Digital: coding text
Reborn Digital: coding textReborn Digital: coding text
Reborn Digital: coding text
 
Droidcon de 2014 google cast
Droidcon de 2014   google castDroidcon de 2014   google cast
Droidcon de 2014 google cast
 

Similar a Droidcon2013 ndk cpu_architecture_optimization_weggerle_intel

[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...
[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...
[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...BeMyApp
 
Introduction ciot workshop premeetup
Introduction ciot workshop premeetupIntroduction ciot workshop premeetup
Introduction ciot workshop premeetupBeMyApp
 
Android on IA devices and Intel Tools
Android on IA devices and Intel ToolsAndroid on IA devices and Intel Tools
Android on IA devices and Intel ToolsXavier Hallade
 
Arm based controller - basic bootcamp
Arm based controller - basic bootcampArm based controller - basic bootcamp
Arm based controller - basic bootcampRoy Messinger
 
NFF-GO (YANFF) - Yet Another Network Function Framework
NFF-GO (YANFF) - Yet Another Network Function FrameworkNFF-GO (YANFF) - Yet Another Network Function Framework
NFF-GO (YANFF) - Yet Another Network Function FrameworkMichelle Holley
 
Open CL For Speedup Workshop
Open CL For Speedup WorkshopOpen CL For Speedup Workshop
Open CL For Speedup WorkshopOfer Rosenberg
 
Android NDK and the x86 Platform
Android NDK and the x86 PlatformAndroid NDK and the x86 Platform
Android NDK and the x86 PlatformSebastian Mauer
 
Five cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterFive cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterTim Ellison
 
Intel® Graphics Performance Analyzers
Intel® Graphics Performance AnalyzersIntel® Graphics Performance Analyzers
Intel® Graphics Performance AnalyzersIntel® Software
 
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...Intel® Software
 
Using LLVM to accelerate processing of data in Apache Arrow
Using LLVM to accelerate processing of data in Apache ArrowUsing LLVM to accelerate processing of data in Apache Arrow
Using LLVM to accelerate processing of data in Apache ArrowDataWorks Summit
 
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...Intel® Software
 
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013Intel Software Brasil
 
Android on Intel platforms : current state, near-future, future & developers ...
Android on Intel platforms : current state, near-future, future & developers ...Android on Intel platforms : current state, near-future, future & developers ...
Android on Intel platforms : current state, near-future, future & developers ...BeMyApp
 
Linxu conj2016 96boards
Linxu conj2016 96boardsLinxu conj2016 96boards
Linxu conj2016 96boardsLF Events
 
The Role of Standards in IoT Security
The Role of Standards in IoT SecurityThe Role of Standards in IoT Security
The Role of Standards in IoT SecurityHannes Tschofenig
 
ABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughBenjamin Zores
 
Velocity-EHF for Android
Velocity-EHF for AndroidVelocity-EHF for Android
Velocity-EHF for Androidmichaeljfawcett
 

Similar a Droidcon2013 ndk cpu_architecture_optimization_weggerle_intel (20)

[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...
[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...
[Android Codefest Germany] Adding x86 target to your Android app by Xavier Ha...
 
Introduction ciot workshop premeetup
Introduction ciot workshop premeetupIntroduction ciot workshop premeetup
Introduction ciot workshop premeetup
 
Android on IA devices and Intel Tools
Android on IA devices and Intel ToolsAndroid on IA devices and Intel Tools
Android on IA devices and Intel Tools
 
Arm based controller - basic bootcamp
Arm based controller - basic bootcampArm based controller - basic bootcamp
Arm based controller - basic bootcamp
 
NFF-GO (YANFF) - Yet Another Network Function Framework
NFF-GO (YANFF) - Yet Another Network Function FrameworkNFF-GO (YANFF) - Yet Another Network Function Framework
NFF-GO (YANFF) - Yet Another Network Function Framework
 
Open CL For Speedup Workshop
Open CL For Speedup WorkshopOpen CL For Speedup Workshop
Open CL For Speedup Workshop
 
Android NDK and the x86 Platform
Android NDK and the x86 PlatformAndroid NDK and the x86 Platform
Android NDK and the x86 Platform
 
Five cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterFive cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark faster
 
Intel® Graphics Performance Analyzers
Intel® Graphics Performance AnalyzersIntel® Graphics Performance Analyzers
Intel® Graphics Performance Analyzers
 
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
 
Using LLVM to accelerate processing of data in Apache Arrow
Using LLVM to accelerate processing of data in Apache ArrowUsing LLVM to accelerate processing of data in Apache Arrow
Using LLVM to accelerate processing of data in Apache Arrow
 
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
 
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013
Intel® Trace Analyzer e Collector (ITAC) - Intel Software Conference 2013
 
Android on Intel platforms : current state, near-future, future & developers ...
Android on Intel platforms : current state, near-future, future & developers ...Android on Intel platforms : current state, near-future, future & developers ...
Android on Intel platforms : current state, near-future, future & developers ...
 
E.s unit 6
E.s unit 6E.s unit 6
E.s unit 6
 
Linxu conj2016 96boards
Linxu conj2016 96boardsLinxu conj2016 96boards
Linxu conj2016 96boards
 
The Role of Standards in IoT Security
The Role of Standards in IoT SecurityThe Role of Standards in IoT Security
The Role of Standards in IoT Security
 
ABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting Walkthrough
 
Velocity-EHF for Android
Velocity-EHF for AndroidVelocity-EHF for Android
Velocity-EHF for Android
 
ARM Processor Tutorial
ARM Processor Tutorial ARM Processor Tutorial
ARM Processor Tutorial
 

Más de Droidcon Berlin

Android industrial mobility
Android industrial mobility Android industrial mobility
Android industrial mobility Droidcon Berlin
 
From sensor data_to_android_and_back
From sensor data_to_android_and_backFrom sensor data_to_android_and_back
From sensor data_to_android_and_backDroidcon Berlin
 
new_age_graphics_android_x86
new_age_graphics_android_x86new_age_graphics_android_x86
new_age_graphics_android_x86Droidcon Berlin
 
Testing and Building Android
Testing and Building AndroidTesting and Building Android
Testing and Building AndroidDroidcon Berlin
 
Matchinguu droidcon presentation
Matchinguu droidcon presentationMatchinguu droidcon presentation
Matchinguu droidcon presentationDroidcon Berlin
 
Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3Droidcon Berlin
 
The artofcalabash peterkrauss
The artofcalabash peterkraussThe artofcalabash peterkrauss
The artofcalabash peterkraussDroidcon Berlin
 
Raesch, gries droidcon 2014
Raesch, gries   droidcon 2014Raesch, gries   droidcon 2014
Raesch, gries droidcon 2014Droidcon Berlin
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Droidcon Berlin
 
20140508 quantified self droidcon
20140508 quantified self droidcon20140508 quantified self droidcon
20140508 quantified self droidconDroidcon Berlin
 
Tuning android for low ram devices
Tuning android for low ram devicesTuning android for low ram devices
Tuning android for low ram devicesDroidcon Berlin
 
Froyo to kit kat two years developing & maintaining deliradio
Froyo to kit kat   two years developing & maintaining deliradioFroyo to kit kat   two years developing & maintaining deliradio
Froyo to kit kat two years developing & maintaining deliradioDroidcon Berlin
 
Droidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicroDroidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicroDroidcon Berlin
 
Droidcon2013 commercialsuccess rannenberg
Droidcon2013 commercialsuccess rannenbergDroidcon2013 commercialsuccess rannenberg
Droidcon2013 commercialsuccess rannenbergDroidcon Berlin
 
Droidcon2013 bootstrap luedeke
Droidcon2013 bootstrap luedekeDroidcon2013 bootstrap luedeke
Droidcon2013 bootstrap luedekeDroidcon Berlin
 
Droidcon2013 app analytics_huber_1und1
Droidcon2013  app analytics_huber_1und1Droidcon2013  app analytics_huber_1und1
Droidcon2013 app analytics_huber_1und1Droidcon Berlin
 

Más de Droidcon Berlin (20)

Raspberry Pi
Raspberry PiRaspberry Pi
Raspberry Pi
 
Android industrial mobility
Android industrial mobility Android industrial mobility
Android industrial mobility
 
Details matter in ux
Details matter in uxDetails matter in ux
Details matter in ux
 
From sensor data_to_android_and_back
From sensor data_to_android_and_backFrom sensor data_to_android_and_back
From sensor data_to_android_and_back
 
droidparts
droidpartsdroidparts
droidparts
 
new_age_graphics_android_x86
new_age_graphics_android_x86new_age_graphics_android_x86
new_age_graphics_android_x86
 
5 tips of monetization
5 tips of monetization5 tips of monetization
5 tips of monetization
 
Testing and Building Android
Testing and Building AndroidTesting and Building Android
Testing and Building Android
 
Matchinguu droidcon presentation
Matchinguu droidcon presentationMatchinguu droidcon presentation
Matchinguu droidcon presentation
 
Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3Cgm life sdk_droidcon_2014_v3
Cgm life sdk_droidcon_2014_v3
 
The artofcalabash peterkrauss
The artofcalabash peterkraussThe artofcalabash peterkrauss
The artofcalabash peterkrauss
 
Raesch, gries droidcon 2014
Raesch, gries   droidcon 2014Raesch, gries   droidcon 2014
Raesch, gries droidcon 2014
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014
 
20140508 quantified self droidcon
20140508 quantified self droidcon20140508 quantified self droidcon
20140508 quantified self droidcon
 
Tuning android for low ram devices
Tuning android for low ram devicesTuning android for low ram devices
Tuning android for low ram devices
 
Froyo to kit kat two years developing & maintaining deliradio
Froyo to kit kat   two years developing & maintaining deliradioFroyo to kit kat   two years developing & maintaining deliradio
Froyo to kit kat two years developing & maintaining deliradio
 
Droidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicroDroidcon2013 security genes_trendmicro
Droidcon2013 security genes_trendmicro
 
Droidcon2013 commercialsuccess rannenberg
Droidcon2013 commercialsuccess rannenbergDroidcon2013 commercialsuccess rannenberg
Droidcon2013 commercialsuccess rannenberg
 
Droidcon2013 bootstrap luedeke
Droidcon2013 bootstrap luedekeDroidcon2013 bootstrap luedeke
Droidcon2013 bootstrap luedeke
 
Droidcon2013 app analytics_huber_1und1
Droidcon2013  app analytics_huber_1und1Droidcon2013  app analytics_huber_1und1
Droidcon2013 app analytics_huber_1und1
 

Último

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Droidcon2013 ndk cpu_architecture_optimization_weggerle_intel

  • 1. Optimizing NDK projects for multiple CPU architectures Alexander Weggerle Technical Consultant Engineer Intel Software and Services Group
  • 2. Agenda • Compatibility • Compiler options • Code paths • Differences between ARM and x86 • Publishing Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 3. Introduction • Performance critical apps are popular • Games • Real time multimedia • Augmented reality • Users are sensitive • Don’t accept lags • Fluid animations • Minimal load time Optimization is important Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 4. Compatibility “I want my app to run on all architectures” • You already done for Java & HTML • NDK based apps usually just needs a recompilation APP_ABI := all Application.mk Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 5. Agenda • Compatibility • Compiler options • Code paths • Differences between ARM and x86 • Publishing Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 6. Target compiler options • NDK-build system Android.mk file evaluated for each architecture • Variable TARGET_ARCH_ABI describes actual architecture TARGET_ARCH_ABI ifeq ($(TARGET_ARCH_ABI),x86) LOCAL_CFLAGS := -mtune=atom -mssse3 x86 endif armeabi ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) LOCAL_CFLAGS := -march=armv7-a armeabi-v7a Endif mips Android.mk Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 7. Recommended Compiler options (x86) • -mtune=atom • Out of Order scheduling • -march=atom • movbe instruction • Code is only guaranteed to run on Atom. – Might not run on emulator or other CPUs • -ansi-alias / -restrict / -no-prec-div Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 8. Agenda • Compatibility • Compiler options • Code paths • Differences between ARM and x86 • Publishing Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 9. Multiple Code Paths • Different reasons for multiple code paths • Optimizing for multiple architectures • Single Instruction Multiple Data (SIMD) • Assembly kernels • Memory alignment • Instruction set support Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 10. Multiple Code Paths Compiler macros • Directly inside source code • No runtime overhead • Works with all build configurations #ifdef __i386__ strlcat(buf, "__i386__", sizeof(buf)); #endif #ifdef __arm__ strlcat(buf, "__arm__", sizeof(buf)); #endif #ifdef _MIPS_ARCH strlcat(buf, "_MIPS_ARCH", sizeof(buf)); #endif source.c Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 11. Multiple Code Paths Make system • Make system will select source file depending on architecture • No runtime overhead arch_x86.cpp const char *getTarget (); arch_arm.cpp arch.h cpufeaturestest.cpp const char *getTarget (); const char *getTarget (); printf(“%s”, getTarget()); arch_default.cpp const char *getTarget (); Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 12. Multiple Code Paths Cpufeatures API • Checks for architecture and special CPU features • Uses compiler macros + runtime detection internally • Small runtime overhead Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 13. Agenda • Compatibility • Compiler options • Code paths • Differences between ARM and x86 • Publishing Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 14. Porting Native (C/C++) Android* Apps to x86 http://software.intel.com/en-us/articles/ndk-android-application-porting- methodologies/ Native Apps • Optimized NDK for Intel Atom based devices available on http://developer.android.com/sdk/nd k/index.html since July’11. • For most apps, changing the make file and a recompile should be sufficient to port to Intel Atom devices. • If ARM-specific features are used, Intel SSE equivalents should be added (build flag) • Developer recompiles, re-packages and publishes. Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 15. ARM* NEON to Intel® SSE • Single Instruction Multiple Data (SIMD) • Most ARM NEON functions have a 1:1 equivalent in Intel® SSE • Intel provides C++ header file to do the mapping // VADD.I8 d0,d0,d0 int8x8_t vadd_s8(int8x8_t a, int8x8_t b); #ifdef USE_MMX #define vadd_s8 _mm_add_pi8 //MMX #else #define vadd_s8 _mm_add_epi8 #endif neonvssse.h Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 16. Differences between ARM and x86 Alignment • ARM uses aligned, x86 uses packed memory struct TestStruct ARM { int mVar1; long long mVar2; int mVar3; }; x86 • Compiler parameter helps to workaround -malign-double Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 17. Agenda • Compatibility • Compiler options • Code paths • Differences between ARM and x86 • Publishing Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 18. Market Fat binary • Include all binaries into one apk libs/armeabi Source ndk-build apkbuilder libs/armeabi- v7a … libs/x86 • Device removes incompatible libs at installation Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 19. Market Multiple APKs • Support for different … • Texture formats • Screen sizes and densities • Platform versions • CPU architectures • Saves bandwidth and space while installation Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 20. Conclusion & Call to action • NDK provides plenty of mechanisms to differentiate between architectures • Recompile your NDK based app with APP_ABI := all Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners.
  • 21. 21
  • 22. Legal Disclaimer & Optimization Notice INFORMATION IN THIS DOCUMENT IS PROVIDED “AS IS”. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO THIS INFORMATION INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors. Performance tests, such as SYSmark and MobileMark, are measured using specific computer systems, components, software, operations and functions. Any change to any of those factors may cause the results to vary. You should consult other information and performance tests to assist you in fully evaluating your contemplated purchases, including the performance of that product when combined with other products. Copyright © , Intel Corporation. All rights reserved. Intel, the Intel logo, Xeon, Core, VTune, and Cilk are trademarks of Intel Corporation in the U.S. and other countries. Optimization Notice Intel’s compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice. Notice revision #20110804 22 Intel Confidential Copyright© 2012, Intel Corporation. All rights reserved. 17.04.2013 *Other brands and names are the property of their respective owners.