mobile game going to 64-bit world - the story behind game going to 64-bit world...
TRANSCRIPT
1
Mobile Game Going to 64-bit World
移动游戏的64位世界
The Story Behind
背后的故事
Fang Bao 鲍方
2
The Consumer Expects Mobile Device New Every Year
每年,消费者都期盼新的移动设备
Your first 64-bit
Phone!
2011
2012
2013
2014 Dual-core CPU
performance
Octa-core CPU
1080p screens Quad-core CPU
720p screens
ARMv8-A and shift to 64-bit 2K screens
3
Mobile Device Usage
移动设备的使用时间分析
Source Digi-Capital Games
Investment Review 2013
4
Mobile Device Usage
移动设备的使用时间分析
Source Digi-Capital Games
Investment Review 2013
About Half of the usage of Smartphones & Tablets
is to play Games!
近半数的移动设备使用时间是在游戏上!
5
SW Architecture (软件架构)
• Delivering initial software against the architecture specification for validation and partner support
SW Ecosystem Bootstrap (软件生态)
• Putting in place all the necessary standards, hardware and software to enable the ecosystem to deliver on ARM architecture (Toolchain, OS and developer tools)
Mobile Game Engines (移动游戏引擎)
• 2D and 3D Mobile Game Engines 64-bit porting, consolidation, optimisation and support on early silicon products
Stages for ARM 64-bit Mobile Game Ecosystem
ARM 64位移动游戏生态的脚步
Now!
6
SW Architecture
软件架构
Introduction to ARMv8
ARMv8 架构介绍
7
ARM7TDMI ARM1176 Cortex® -A9 Cortex-A50 series ARM926EJ
ARMv4
Increasing SoC complexity
Increasing OS complexity
Increasing choice of HW and SW
ARM Architecture Evolution
ARM 架构演进
1995 2005 2015
Virtualization
8
ARMv8-A AArch32
ARMv8-A ARMv7-A
ARMv7-A Compatible
A32+T32 A64
CRYPTO
Scalar FP
Advanced SIMD
AArch32 AArch64
Applications
and software
AArch32 maintains full-compatibility
with ARMv7 while addressing emerging
software trends
AArch32: Evolution of 32-bit
Enhanced floating point support (IEE754-2008)
Ideal for concurrent programming
C11, C++ 11, Java5
More efficient, high-performance thread-safe
software
Cryptography support (AES, Sha-1, Sha-256)
ARMv8-A 32位模式保持了完整的前向兼容性
9
ARMv8-A AArch64 ARMv8-A 64位模式 增强了已有的功能并增加了更多的新功能
AArch64 can support ALL
ARMv8-A features. Clean instruction set
Larger address space (>4GB memory for
Application)
Wider data register (64-bit)
Better SIMD (NEON)
Better Floating point
Increased number and size of general
purpose registers (31 general, 32
FP/NEON/Crypto)
Better Security Architecture, dealing with
Hypervisors
More…
10
ARMv8-A execution state Overview
ARMv8-A 执行状态概况
11
ARMv8 is everywhere
无处不在的ARMv8
12
SW Ecosystem Bootstrap
软件生态的启动
13
Technical Leadership: Software Ecosystem
技术领导的软件生态
ARM direct
staff
ARM
investments (,)
Fostering
standardization
Supporting
developers
64-bit
Platform
Key focus
on 64-bit ARM Trusted
Firmware
14
ARM and its Partners Enable the Ecosystem
ARM 和合作伙伴们一起驱动广大的生态
AR
M e
nab
lem
ent
Applications
Middleware
Driver & OS
Security
Tools
Models
100,000s
1,000s
100s
10s
10s
A collective effort from ARM
and its partners
ARM focuses on enabling key
building blocks
Tools, kernel, Secure OS, Hypervisor
Key middleware
ARM partners reach Apps Developers
Par
tners
Enab
lem
ent
15
Key Goals
Provide a collaborative environment where competitors can jointly develop and
maintain common open source software
Used shared investment to provide increased return on investment to members
Accelerate time to market for member products
Reduce upstream fragmentation and resulting costs
Work closely with ARM to deliver Linux software and tools for new ARM technology
Linaro – Enabling FOSS Partner Collaboration Linaro – 启动自由及开源软件伙伴们的合作
16
Core projects where partners can collaborate i.e. Tools, Linux kernel, Security framework…
Produce regular snapshots from upstream Increased testing and validation of upstream code Contributions and patch reviews
Linaro – Collaboration on Key Domains and Projects Linaro – 合作于关键领域和相关项目
Mo
bile
En
terp
rise
Netw
ork
ing
…
17
ARMv8 and Open-source Community Development
ARMv8 和开源社区的合作开发
…2011 2012 2013 2014…
AArch64 support upstream
Maintained from Gcc 4.8
AArch64 support upstream
Maintained from Linux 3.7
ARMv8 specification
ARM DDI 048 preliminary data Initial release
(Confidential)
ARMv8 specification
GNU tools (Gcc, Binutils etc.)
Linux kernel
Initial KVM and Xen
Maintained from Linux 3.11
18
ARM is actively involved in two major Open Source Compilers
LLVM
AArch64 supported upstream as of LLVM 3.3
Ongoing work to address outstanding defects
OpenCL™ support
Buildbots available http://lab.llvm.org:8011/builders/
GCC
AArch64 supported upstream as of GCC 4.8
Support for dynamic linking, TLS, cross-compiler and glibc
Support for C/C++ ABI and PCS
ARM® NEON™ auto-vectorization and intrinsics
Toolchains
工具链
19
Linux Kernel
Linux 内核 AArch64 general support is now in the public domain
ARM’s Catalin Marinas & Will Deacon maintainers for
AArch64, Marc Zyngier for KVM
KVM support accepted for inclusion in the 3.11 release
Xen contributions have started too
Where to get it
Sources http://www.kernel.org/
Prebuilt tools http://www.linaro.org/downloads/
20
Mobile Game Engines
移动游戏引擎
21
The Game Engine Importance
游戏引擎的重要性 Typically, Mobile Developers have had to create their own bespoke Game Engines and keeps the
Engine lightweight, and gives the developer complete control.
However there is now a shift towards the use of open source / commercial Game Engines with
complete editors. And brings...
...flexibility
灵活性
...multiple platform
跨平台
...reduced costs
降低维护成本
...Middleware Integration
中间件集成
...proven workflow 可靠的工作流程
...ease of development
开发简单
22
Case Study
案例分析
Cocos2d-x and Android on 64-bit ARM CPU
Cocos2d-x Android版本运行在64位ARM处理器上
23
Environment
环境
Porting
移植
Profiling
分析
Optimizing
优化
Stages for Mobile Game Engines Going to ARM 64-bit World
移动游戏引擎的进入64位世界的步骤
24
Environment
环境
Porting
移植
Profiling
分析
Optimizing
优化
Stages for Mobile Game Engines Going to ARM 64-bit World
移动游戏引擎的进入64位世界的步骤
25
Juno ARM Development Platform (ADP)
Juno ARM开发板 First 64-bit Software Development Platform from ARM
Cortex-A57 MP2, Cortex-A53 MP4, Mali-T624 MP4 test chip
Implement ARMv8 & associated based system requirements
Reference 64-bit software stack
◦ Linaro Stable Kernel 3.10, AOSP 4.4+ and OE filesystems 14.06
◦ UEFI v15593, ARM TF v0.4, SCP 1.0.0
Expandable with LogicTile (FPGA board)
Enables software development for
64-bit kernel, drivers, software and tools
3D graphics and GPU compute
Hypervisors & secure OS integration
Platform tuning (power, performance)
ARMv8-A big.LITTLE
OpenGL ES 3.1, OpenCL 1.1
On-chip power & thermal management
TrustZone & Secure OS ready
8GB DDR3 with 12.8 GB/s bw
FPGA extension, USB2.0
Order now shipping from e/o July 2014
26
Juno Enables ARMv8 Ecosystem Partners (支持的合作伙伴)
27
Android Open Source Project port for ARMv8-A
Announced on July 2, 2014
Tested on ARMV8-A Fast Models and Juno platform, a ARMv8-A 64-bit H/W development platform
and.
http://releases.linaro.org/latest/members/arm/android/images/armv8-android-juno-lsk
Linaro ARMv8 Engineering Project for Juno
Linaro ARMv8 基于Juno的工程项目
28
Android ‘L’ announced at Google I/O and Android Lollipop is released on Oct 2014.
Supports both 32-bit and 64-bit
New Android Runtime (ART)
Support for OpenGL ES 3.1 and Android Extension Pack
NDK r10 released in July 2014 and NDK r10c released in Oct 2014.
Separate packages for 32bit and 64-bit
Android API level 21 is the first level with 64-bit support
Added arm64-v8a ABI
GCC 4.9 is the default compiler for 64-bit ABIs. Clang 3.5 is also added to support all hosts.
The cpu-features library has been updated for the ARMv8 kernel
Android Lollipop and NDK r10
Android Lollipop 和 NDK 版本10
Android applications can be
written in Java, native ARM code,
or a combination of the two
29
Environment
环境
Porting
移植
Profiling
分析
Optimizing
优化
Stages for Mobile Game Engines Going to ARM 64-bit World
移动游戏引擎的进入64位世界的步骤
30
ARM Infocenter – ARM Online Technical Publications
http://infocenter.arm.com/
ARMv8-A architecture overview
http://www.arm.com/zh/products/processors/instruction-set-architectures/armv8-architecture.php
http://youtu.be/GBeEEfmJ3NI
ARMv8-A architecture manual
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0487a.a_errata1/index.html
ARMv8-A Processors
http://www.arm.com/products/processors/cortex-a50/index.php
Juno ARM development platform
http://www.arm.com/zh/products/tools/development-boards/versatile-express/juno-arm-development-
platform.php
Reading Online Tutorials / Resources 1
阅读在线资料 1
31
ARM Connected Community (欢迎来ARM 中文社区提问)
http://community.arm.com/community/arm-cc-cn
ARM 64-bit porting guide
http://community.arm.com/docs/DOC-8453
Introduction to 64-bit ARM porting by Linaro
http://people.linaro.org/~rikuvoipio/aarch64-talk/#/
Running Android L Developer Preview on 64-bit ARM QEMU
http://www.linaro.org/blog/core-dump/running-64bit-android-l-qemu/
Taming ARMv8 NEON: from theory to benchmark results (LCU14-504)
http://lcu14.zerista.com/event/member/137791
ARMv8-A Software Development (ARM Training Course)
http://www.arm.com/support/training/arm-training-courses/armv8-a-software-development.php
Reading Online Tutorials / Resources 2
阅读在线资料 2
32
Evolution of the ARM architecture
ARM架构的演进
Overview of AArch64 in ARMv8-A
ARMv8架构的64位模式概况
64-bit data models
64位数据模型
Re-compile or re-write
重编和重写代码
Hints, tips and gotchas
提示和建议
References
参考文献
Porting to 64-bit ARM
64位ARM的移植
http://community.arm.com/docs/DOC-8453
33
Porting to 64-bit ARM 64-bit 数据模型和C语言代码的相关问题
64-bit Linux
A64-LP64
built-in types when compiling C code for A32 and LP64
34
Fishjoy 3 Android Porting to 64-bit ARM
捕鱼达人3 安卓版本的64位移植工作
Juno Board
35
Environment
环境
Porting
移植
Profiling
分析
Optimizing
优化
Stages for Mobile Game Engines Going to ARM 64-bit World
移动游戏引擎的进入64位世界的步骤
36
1st step: Architecture & Algorithm Analysis
第一步:架构和算法分析
2nd step: Run Test Suit as a basic Benchmark
第二步:运行测试组件作为基本的标准程序
3rd step: Use Profiling Tools on Real Game
第三步:使用专业的性能分析工具调试真实游戏
Performance Parameters from the Profiling
来自性能分析的数据
Game Profiling
游戏性能分析
37
Architecture & Algorithm Analysis
架构和算法分析
38
Run Test Suit as a basic Benchmark
运行测试组件作为基本的标准程序 2D cpp-tests
3D EngineDemo
2D Performance Test
3D Performance Test
39
Run Test Suit as a basic Benchmark
运行测试组件作为基本的标准程序 2D cpp-tests
Math Performance Test
40
Run Test Suit as a basic Benchmark
运行测试组件作为基本的标准程序 2D cpp-tests
Math Performance Test
64-bit Mode
41
3D EngineDemo
Run Test Suit as a basic Benchmark
运行测试组件作为基本的标准程序
42
ARM DS-5 Streamline Analyzer
ARM DS-5 Streamline 性能分析器
Advantages
System-wide visibility into CPUs, GPUs,
interconnect, power consumption and
Linux/Android OS resources
C/C++ source code level profiling based on
time or PMU events
Streaming data collection allowing analysis as
long as hours
Extensible data sources and customizable
data visualization
Trace hardware not required
43
Timeline: Heat Map 时间线分析:热度图
Select from CPU/GPU counters
OS level and custom data sources
Accumulate counters, measure time
and find instant hotspots
Select one or more tasks to
isolate their contribution
Combined task switching trace and
sample-based profile
44
FPS Frame Per Second
每秒帧率
CPU% CPU utilization
CPU使用率
SPF Time interval between the rendering frame
渲染帧间隔时间
GL verts The amount of data in every frame
每帧数据
GL calls The number of perform rendering instructions
渲染指令执行数量
Performance parameters from the Profiling
来自性能分析的数据
45
Environment
环境
Porting
移植
Profiling
分析
Optimizing
优化
Stages for Mobile Game Engines Going to ARM 64-bit World
移动游戏引擎的进入64位世界的步骤
46
AArch64 Performance Over AArch32
超越32位模式的64位模式性能 >20% increase on several key
workloads
Most workloads increase,
some slow down Slowdowns are often outliers like
mcf in spec2k with unrealistic data
access patterns
Overall trend is increasing
performance with 64b Will increase further as compilers
mature
-10%
0%
10%
20%
30%
40%
50%
60%
70%
80% ARMv8 AArch64 performance vs. AArch32
Cortex-A53
Cortex-A57
47
Cocos2d-x Math library
AArch64 Performance Over AArch32
超越32位模式的64位模式性能
48
Math library (C Language Code)
AArch64 Performance Over AArch32
超越32位模式的64位模式性能
Blue curve: 32-bit mode Red curve: 64-bit mode Platform : ARM Juno Board
49
Math library (ARM NEON Optimization Code)
AArch64 Performance Over AArch32
超越32位模式的64位模式性能
Blue curve: 32-bit mode Red curve: 64-bit mode Platform : ARM Juno Board
50
More 64-bit NEON optimization is been done by ARM and community.
AArch64 Performance Over AArch32
超越32位模式的64位模式性能
51
More 64-bit NEON optimization is been done by ARM and community.
AArch64 Performance Over AArch32
超越32位模式的64位模式性能
We are working with game engines to import
open source project optimized by 64-bit ARM.
我们正在和游戏引擎们合作,引入64位ARM
优化的开源项目最新版本。
52
SW Architecture (软件架构)
• Delivering initial software against the architecture specification for validation and partner support
SW Ecosystem Bootstrap (软件生态)
• Putting in place all the necessary standards, hardware and software to enable the ecosystem to deliver on ARM architecture (Toolchain, OS and developer tools)
Mobile Game Engines (移动游戏引擎)
• 2D and 3D Mobile Game Engines 64-bit porting, consolidation, optimisation and support on early silicon products
Mobile Games (移动游戏)
• Ongoing, active promotion for all Mobile Game developers and companies
Stages for ARM 64-bit Mobile Game Ecosystem
ARM 64位移动游戏生态的脚步
53
Follow the guide of 64-bit Game Engine
Follow the guide of 64-bit Mobile OS
Understand basic ARM 64-bit knowledge
Going to 64-bit world is so easy!
Mobile Games Developers
移动游戏开发者
54
55
Together, let’s drive mobile games
to the 64-bit world!
让我们一起来推动移动游戏
进入64位世界!
56
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