armv8: advantages for android - architecting a smarter ... · armv8: advantages for android ......

14
1 ARMv8: Advantages for Android Steve Bannister

Upload: hangoc

Post on 02-Apr-2018

233 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: ARMv8: Advantages for Android - Architecting a Smarter ... · ARMv8: Advantages for Android ... Porting C code to 64-bit is the same as for ... ARMv8-A Porting Guide:

1

ARMv8: Advantages for Android

Steve Bannister

Page 2: ARMv8: Advantages for Android - Architecting a Smarter ... · ARMv8: Advantages for Android ... Porting C code to 64-bit is the same as for ... ARMv8-A Porting Guide:

2

§  Why 64-bit in mobile?

§  64-bit support in Android™ Lollipop §  Where next?

§  Summary

Contents

Page 3: ARMv8: Advantages for Android - Architecting a Smarter ... · ARMv8: Advantages for Android ... Porting C code to 64-bit is the same as for ... ARMv8-A Porting Guide:

3

The ARM® 64-bit Architecture : ARMv8-A

§  Full native 32-bit execution, side-by-side with 64-bit

§  New, modern, A64 instruction set architecture (ISA)

§  Double the number (and size) of registers

§  New instructions for both A32 and A64

ARMv8-A

Crypto

Advanced SIMD

Scalar FP

AArch32 AArch64

T32 + A32 ISA A64 ISA

Page 4: ARMv8: Advantages for Android - Architecting a Smarter ... · ARMv8: Advantages for Android ... Porting C code to 64-bit is the same as for ... ARMv8-A Porting Guide:

4

Why 64-bit in mobile?

Performance through architecture

§  Cleaner instruction set architecture

§  Hard-float ABI by default in ARMv8-A

§  More registers, less stack spillage

§  Cheaper function calls §  Up to 16x crypto acceleration

§  Preparation for larger memory devices

Page 5: ARMv8: Advantages for Android - Architecting a Smarter ... · ARMv8: Advantages for Android ... Porting C code to 64-bit is the same as for ... ARMv8-A Porting Guide:

5

64-bit support in Android Lollipop

§  64-bit support for ARM

§  32-bit & 64-bit apps exist in the same build

§  Also, introduces the ART runtime

Source : http://www.android.com/

Page 6: ARMv8: Advantages for Android - Architecting a Smarter ... · ARMv8: Advantages for Android ... Porting C code to 64-bit is the same as for ... ARMv8-A Porting Guide:

6

What does L mean for developers?

§  Pure Java apps get ARMv8-A benefit for free via ART

§  32-bit NDK apps run without change, and at full performance

§  Rebuild NDK code with APP_ABI="arm64-v8a” to take full advantage of A64

§  Interworking rules mean Java apps run as 32-bits if they call 32-bit NDK code

Page 7: ARMv8: Advantages for Android - Architecting a Smarter ... · ARMv8: Advantages for Android ... Porting C code to 64-bit is the same as for ... ARMv8-A Porting Guide:

7

What is ART?

§  ART is a replacement for Dalvik

§  AOT vs JIT (ahead of time - i.e. at install)

§  Redesigned to be better on multi-core systems

§  Fits well with big.LITTLE™ technology

Measured on Nexus 7 with Dalvik/ART Preview on 4.4

0%

100%

200%

Quadrant CPU Linpack MT

Rel

ativ

e to

Dal

vik

JIT

Dalvik ART

Page 8: ARMv8: Advantages for Android - Architecting a Smarter ... · ARMv8: Advantages for Android ... Porting C code to 64-bit is the same as for ... ARMv8-A Porting Guide:

8

ART on ARMv8-A: performance features

§  Utilizes the modern A64 ISA for 64-bit apps

§  Single-cycle instructions for Java long &

double types

§  Uses hard-float ABI

§  32-bit object references - no 64-bit pointer penalty

Rocket by Luis Prado from the Noun Project

Page 9: ARMv8: Advantages for Android - Architecting a Smarter ... · ARMv8: Advantages for Android ... Porting C code to 64-bit is the same as for ... ARMv8-A Porting Guide:

9

Considerations for native developers

§  Porting C code to 64-bit is the same as for any other architecture

§  Review your feature detection code when moving to 64-bit

§  Assembly code needs to be ported to the more efficient A64 ISA

§  NEON™ changes can be simply recompiled if written using compiler intrinsics

Change graphic

Page 10: ARMv8: Advantages for Android - Architecting a Smarter ... · ARMv8: Advantages for Android ... Porting C code to 64-bit is the same as for ... ARMv8-A Porting Guide:

10

Performance – Native

0%

5%

10%

15%

20%

25%

30%

Single Thread Multithreaded

AA

rch6

4 im

prov

emen

t o

ver A

Arc

h32

AnTuTu 32/64bit CPU Test v5.0

Measured on Juno (2x Cortex®-A57, 4x Cortex-A53)

0%

5%

10%

15%

20%

25%

30%

bionic

AA

rch6

4 im

prov

emen

t o

ver A

Arc

h32

bionic-benchmarks

Page 11: ARMv8: Advantages for Android - Architecting a Smarter ... · ARMv8: Advantages for Android ... Porting C code to 64-bit is the same as for ... ARMv8-A Porting Guide:

11

Performance – ART

Measured on Juno (2x Cortex-A57, 4x Cortex-A53)

0%

5%

10%

15%

20%

25%

30%

AA

rch6

4 im

prov

emen

t o

ver A

Arc

h32

CPU Score

Quadrant 2.0

0%

5%

10%

15%

20%

25%

30%

AA

rch6

4 im

prov

emen

t o

ver A

Arc

h32

Multi-threaded

Linpack

Page 12: ARMv8: Advantages for Android - Architecting a Smarter ... · ARMv8: Advantages for Android ... Porting C code to 64-bit is the same as for ... ARMv8-A Porting Guide:

12

Want to know more?

§  Join us in the Android group at Connected Community!

§  http://community.arm.com/groups/android-community

§  ARMv8-A Porting Guide: §  http://community.arm.com/docs/

DOC-8453

§  Taming ARMv8-A NEON: from theory to benchmark results

§  http://youtu.be/ixuDntaSnHI?list=UUIVqQKxCyQLJS6xvSmfndLA

§  Porting & optimizing for 64-bit, a compiler perspective

§  http://www.linaro.org/assets/common/campus-party-presentation-Sept_2013.pdf

§  https://www.youtube.com/watch?v=epzYErIIx0Y

§  An OSX perspective of the 32-64-bit transition

§  https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/64bitPorting/intro/intro.html

Page 13: ARMv8: Advantages for Android - Architecting a Smarter ... · ARMv8: Advantages for Android ... Porting C code to 64-bit is the same as for ... ARMv8-A Porting Guide:

13

Summary

§  The ARMv8-A architecture makes the difference for mobile and 64-bit

§  Android Lollipop provides multi-arch

support enabling both 32/64-bit applications

§  Performance gains for those taking advantage of the ARMv8-A architecture

§  Come join us at Connected Community

Page 14: ARMv8: Advantages for Android - Architecting a Smarter ... · ARMv8: Advantages for Android ... Porting C code to 64-bit is the same as for ... ARMv8-A Porting Guide:

14

Thank You

The trademarks featured in this presentation are registered and/or unregistered trademarks of ARM Limited (or its subsidiaries) in the EU and/or elsewhere. All rights reserved. Any other marks featured may be trademarks of their respective owners

The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.

Google Play is a trademark of Google Inc.