Your SlideShare is downloading. ×

Porting Android application from ARM to x86

583

Published on

Presentation from Massimiliano Torregiani (@MaxTorregiani) at the Intel Codefest Milano on February 13th 2014 at Mediateca …

Presentation from Massimiliano Torregiani (@MaxTorregiani) at the Intel Codefest Milano on February 13th 2014 at Mediateca

http://codefestmilano.bemyapp.com

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
583
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Porting Android application from ARM to X86 Massimiliano Torregiani Intel CODEFEST Milan 13 Febbraio 2014
  • 2. Android SDK e NDK Programmazione SDK compile once, run everywhere Programmazione NDK some compile once, run everywhere oppure oppure 2  
  • 3. Concetti di Xcompilazione nativa Sistema Host E’ il sistema dove il compilatore è installato e su cui avviene la compilazione Sistema target E’ il sistema dove l’eseguibile generato su host sara’ eseguito. Cosa serve per la compilazione? •  Toolchain (compilatore, linker, archiver, assembler, etc) •  Header file delle librerie •  Librerie standard, dei framework e altre librerie accessorie cross-compilate per il sistema target 3  
  • 4. Pacchetto NDK di Google Il pacchetto NDK fornito da Google comprende: Target Architecture •  ARMv5TE  &  ARMv7-­‐A   •  MIPS   •  X86  -­‐  Intel  Atom   Target operative system Tipo e versione compilatore (e.g.  GCC  4.8)   4  
  • 5. Supporto Intel per Android: Beacon Mountain 5  
  • 6. Porting da ARM a X86 Sample 1: HelloJni 6  
  • 7. Differenze tra architettura ARM e X86 Memory Alignment struct TestStruct { int mVar1; long long mVar2; int mVar3; }; GCC flag “-malign-double” By Default “Double Margin” By default No margin 7  
  • 8. Differenze tra architettura ARM e X86 Memory Big  or  li/le  endian  order   Alignment (ARM  is  bi-­‐endian)   Floating Point li/le-­‐endian  assembly   ARMv5  à  So@  FP  opts   Intel  Atom  à  IA-­‐32   ARMv7  à  Hardware  FPU   instrucJons,  Hardware  Based   instrucJons  (VFP)   FP  opts   SIMD ARMv5  à  No  SIMD  ext   Intel  Atom  à  SSSE3  (Supplemental   extensions ARMv7  à  NEON  ext   Streaming  SIMD  Extensions  3)   8  
  • 9. Differenze tra architettura GCC Flags Memory –mlittle-endian Alignment –mbig-endian Floating -mfloat-abi= soft | softfp | hard –mfpmath=sse Point -mfpu= vfp | vfpv3-d16 | neon | ... -mavx -maes SIMD -march=armv7-a extensions -mtune=cortex-a8 -msse –DHAVE_NEON=1 9  
  • 10. Porting da ARM a X86 Sample 2: HelloNeon 10  
  • 11. Utilizzo librerie esterne Step 1: Porting librerie esterne Libreria  Esterna   naJva   Codice  naJvo   proprietario   Libreria   compilata  per   Target   Step 2: Porting codice nativo proprietario JNI APP  Android   (Java)   Step 3: Rebuild applicazione 11  
  • 12. Porting da ARM a X86 Sample 3: HelloFFmpeg 12  
  • 13. KALPA srl Thanks! Mail: massimiliano.torregiani@kalpa.it   Twitter: @maxtorregiani   Linkedin: h/p://www.linkedin.com/pub/massimiliano-­‐torregiani/3/555/550  

×