SlideShare a Scribd company logo
1Samsung Open Source Group
A closer look at ARM code size
Tilmann Scheller
Principal Compiler Engineer
t.scheller@samsung.com
Samsung Open Source Group
Samsung Research UK
EuroLLVM 2016
Barcelona, Spain, March 17 – 18, 2016
2Samsung Open Source Group
Overview
●
Introduction
●
ARM architecture
●
Case study
●
Summary
3Samsung Open Source Group
Introduction
4Samsung Open Source Group
Introduction
● Code size matters in the embedded space
● Find out how we are doing on ARM
● Comparison against GCC
● Focus on a specific application and compare the
generated assembly code
● Try to find out what we need to change in LLVM to get
better code size
5Samsung Open Source Group
ARM architecture
6Samsung Open Source Group
ARM architecture
● 32-bit/64-bit RISC architecture
● Load-store architecture
● Barrel shifter: add r4, r3, r6, lsl #4
● Powerful indexed addressing modes: ldr r0, [r1, #4]!
● Predication: ldreq r3, [r4]
● Family of 32-bit instruction sets evolved over time: ARM, Thumb, Thumb-2
● Focus on the Thumb-2 instruction set in this talk
● Instruction set extensions:
– VFP
– Advanced SIMD (NEON)
7Samsung Open Source Group
Thumb-2 ISA
● Goal: Code density similar to Thumb, performance like
original ARM instruction set
● Variable-length instructions (16-bit/32-bit)
● 16 32-bit GPRs (including PC and SP)
● 16 or 32 64-bit floating-point registers for VFP/NEON
● Conditional execution with IT (if-then) instruction
; if (r0 == r1)
cmp r0, r1
ite eq ; ARM: no code ... Thumb: IT instruction
; then r0 = r2;
moveq r0, r2 ; ARM: conditional; Thumb: condition via ITE 'T' (then)
; else r0 = r3;
movne r0, r3 ; ARM: conditional; Thumb: condition via ITE 'E' (else)
; recall that the Thumb MOV instruction has no bits to encode "EQ" or "NE"
8Samsung Open Source Group
Case study
9Samsung Open Source Group
JerryScript
●
A really lightweight JavaScript engine
●
Has a base footprint of 10KB of RAM
●
Optimized for microcontrollers
●
Written in C99
●
Supports all of ECMAScript 5.1
●
Open source (Apache 2.0 license)
●
Developed by Samsung
●
Goal: Want to compile with Clang but code size significantly
higher
10Samsung Open Source Group
Target hardware
● STM32F4 developer board
● Cortex-M4F clocked at 168 MHz
● 192KB of RAM
● 1MB of flash memory
11Samsung Open Source Group
Code size
● Compiling with a Clang trunk snapshot (r262611, March
3, 2016)
● Using GCC 5.2.1 (Linaro bare-metal toolchain)
● JerryScript trunk snapshot (afa7b78, March 4, 2016)
● Release build of JerryScript
● Optimizing for the Cortex-M4F
● Building with -Os
● Static build, running bare-metal on the STM32F4 board
12Samsung Open Source Group
Code size
-Os -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16
JerryScript
0
50
100
150
200
250
231
208
190
Clang r262611
GCC 5.2.1
GCC 5.2.1 LTO
CodesizeinKB(lowerisbetter)
13Samsung Open Source Group
Code size - LTO
● GCC in LTO mode produces the smallest binary
● Clang has no support for building in -Os -flto
● LTO optimization pipeline not tuned for size
14Samsung Open Source Group
Identifying interesting functions
● Python script which parses the "objdump -d" output
● Parsing the assembly dump of both binaries
● Binaries compiled with -fno-inline
● Computes per function code size delta
● Some functions get specialized and are only available in
one binary
● Not perfectly accurate but good enough
15Samsung Open Source Group
Code size
Clang
<jerry_api_create_null_value>:
b083 sub sp, #12
2102 movs r1, #2
f840 1b04 str.w r1, [r0], #4
4669 mov r1, sp
e891 100c ldmia.w r1, {r2, r3, ip}
e880 100c stmia.w r0, {r2, r3, ip}
b003 add sp, #12
4770 bx lr
GCC
<jerry_api_create_null_value>:
2302 movs r3, #2
7003 strb r3, [r0, #0]
4770 bx lr
typedef struct jerry_api_value_t
{
jerry_api_data_type_t type;
union
{
bool v_bool;
double v_float64;
uint32_t v_uint32;
...
} u;
} jerry_api_value_t;
/**
* Creates and returns a jerry_api_value_t
* with type JERRY_API_DATA_TYPE_NULL.
*/
jerry_api_value_t
jerry_api_create_null_value (void)
{
jerry_api_value_t jerry_val;
jerry_val.type = JERRY_API_DATA_TYPE_NULL;
return jerry_val;
}
16Samsung Open Source Group
Code size
Clang
<lit_magic_strings_ex_set>:
f240 0340 movw r3, #64 ; 0x40
f2c2 0300 movt r3, #8192 ; 0x2000
6018 str r0, [r3, #0]
f240 0044 movw r0, #68 ; 0x44
f2c2 0000 movt r0, #8192 ; 0x2000
6001 str r1, [r0, #0]
f240 0048 movw r0, #72 ; 0x48
f2c2 0000 movt r0, #8192 ; 0x2000
6002 str r2, [r0, #0]
4770 bx lr
GCC
<lit_magic_strings_ex_set>:
4b01 ldr r3, [pc, #4] ; (base)
e883 0007 stmia.w r3, {r0, r1, r2}
4770 bx lr
base: 20000074 .word 0x20000074
void
lit_magic_strings_ex_set (const lit_utf8_byte_t **ex_str_items,
uint32_t count,
const lit_utf8_size_t *ex_str_sizes)
{
lit_magic_string_ex_array = ex_str_items;
lit_magic_string_ex_count = count;
lit_magic_string_ex_sizes = ex_str_sizes;
}
17Samsung Open Source Group
Code size
Clang
<lit_cpointer_decompress>:
b120 cbz r0, 8001de2 <lit_cpointer_decompress+0xc>
b580 push {r7, lr}
466f mov r7, sp
f000 fba2 bl 8002524 <mem_decompress_pointer>
bd80 pop {r7, pc}
8001de2: 2000 movs r0, #0
4770 bx lr
GCC
<lit_cpointer_decompress>:
b108 cbz r0, 8001a74 <lit_cpointer_decompress+0x6>
f000 ba6a b.w 8001f48 <mem_decompress_pointer>
8001a74: 4770 bx lr
/* Decompress extended compressed pointer. */
lit_record_t *
lit_cpointer_decompress (lit_cpointer_t compressed_pointer)
{
if (compressed_pointer == MEM_CP_NULL)
{
return NULL;
}
return (lit_record_t *) mem_decompress_pointer (compressed_pointer);
}
18Samsung Open Source Group
Code size
/* Common function to generate fixed width, right aligned decimal numbers. */
static lit_utf8_byte_t *
ecma_date_value_number_to_bytes (lit_utf8_byte_t *dest_p,
int32_t number,
int32_t width)
{
dest_p += width;
lit_utf8_byte_t *result_p = dest_p;
do
{
dest_p--;
*dest_p = (lit_utf8_byte_t) ((number % 10) + (int32_t) LIT_CHAR_0);
number /= 10;
}
while (--width > 0);
return result_p;
}
19Samsung Open Source Group
Code size
Clang
<ecma_date_value_number_to_bytes>:
b510 push {r4, lr}
4686 mov lr, r0
f246 6c67 movw ip, 0x6667
eb0e 0002 add.w r0, lr, r2
3a01 subs r2, #1
f2c6 6c66 movt ip, 0x6666
loop: fb51 f30c smmul r3, r1, ip
109c asrs r4, r3, #2
eb04 73d3 add.w r3, r4, r3, lsr #31
eb03 0483 add.w r4, r3, r3, lsl #2
eba1 0144 sub.w r1, r1, r4, lsl #1
3130 adds r1, #48 ; 0x30
f80e 1002 strb.w r1, [lr, r2]
1e51 subs r1, r2, #1
3201 adds r2, #1
2a01 cmp r2, #1
460a mov r2, r1
4619 mov r1, r3
dced bgt.n loop
bd10 pop {r4, pc}
bf00 nop
GCC
<ecma_date_value_number_to_bytes>:
4410 add r0, r2
b530 push {r4, r5, lr}
4603 mov r3, r0
250a movs r5, #10
1a12 subs r2, r2, r0
loop: fb91 f4f5 sdiv r4, r1, r5
fb05 1114 mls r1, r5, r4, r1
3130 adds r1, #48 ; 0x30
f803 1d01 strb.w r1, [r3, #-1]!
4621 mov r1, r4
189c adds r4, r3, r2
2c00 cmp r4, #0
dcf4 bgt.n loop
bd30 pop {r4, r5, pc}
/* Common function to generate fixed width, right aligned decimal numbers. */
static lit_utf8_byte_t *
ecma_date_value_number_to_bytes (lit_utf8_byte_t *dest_p,
int32_t number,
int32_t width) {
dest_p += width;
lit_utf8_byte_t *result_p = dest_p;
do
{
dest_p--;
*dest_p = (lit_utf8_byte_t) ((number % 10) + (int32_t) LIT_CHAR_0);
number /= 10;
}
while (--width > 0);
return result_p;
}
20Samsung Open Source Group
Code size
Clang
<ecma_get_object_from_value>:
b580 push {r7, lr}
466f mov r7, sp
f7ff ff28 bl <ecma_get_value_value_field>
e8bd 4080 ldmia.w sp!, {r7, lr}
f7f5 bad2 b.w <mem_decompress_pointer>
<ecma_get_string_from_value>:
b580 push {r7, lr}
466f mov r7, sp
f7ff ff30 bl <ecma_get_value_value_field>
e8bd 4080 ldmia.w sp!, {r7, lr}
f7f5 bada b.w <mem_decompress_pointer>
GCC
<ecma_get_object_from_value>:
b508 push {r3, lr}
f7ff ff3c bl <ecma_get_value_value_field>
e8bd 4008 ldmia.w sp!, {r3, lr}
f7f5 bfd1 b.w <mem_decompress_pointer>
<ecma_get_string_from_value>:
f7ff bff7 b.w <ecma_get_object_from_value>
ecma_string_t *
ecma_get_string_from_value (ecma_value_t value) {
JERRY_ASSERT (ecma_get_value_type_field (value) == ECMA_TYPE_STRING);
return ECMA_GET_NON_NULL_POINTER (ecma_string_t,
ecma_get_value_value_field (value));
}
ecma_object_t *
ecma_get_object_from_value (ecma_value_t value) {
JERRY_ASSERT (ecma_get_value_type_field (value) == ECMA_TYPE_OBJECT);
return ECMA_GET_NON_NULL_POINTER (ecma_object_t,
ecma_get_value_value_field (value));
}
21Samsung Open Source Group
Code size
Clang
<lit_literal_equal_type_utf8>:
7883 ldrb r3, [r0, #2]
f043 0304 orr.w r3, r3, #4
b2db uxtb r3, r3
2b04 cmp r3, #4
bf04 itt eq
2000 moveq r0, #0
4770 bxeq lr
b580 push {r7, lr}
466f mov r7, sp
f7ff ff17 bl 8001fac <lit_literal_equal_utf8>
bd80 pop {r7, pc}
GCC
<lit_literal_equal_type_utf8>:
7883 ldrb r3, [r0, #2]
f013 03fb ands.w r3, r3, #251 ; 0xfb
d001 beq.n exit
f7ff bfa6 b.w 8001c3a <lit_literal_equal_utf8>
exit: 4618 mov r0, r3
4770 bx lr
bool
lit_literal_equal_type_utf8 (lit_literal_t lit,
const lit_utf8_byte_t *str_p,
lit_utf8_size_t str_size)
{
const lit_record_type_t type = (const lit_record_type_t) lit->type;
if (type == LIT_RECORD_TYPE_NUMBER || type == LIT_RECORD_TYPE_FREE)
{
return false;
}
return lit_literal_equal_utf8 (lit, str_p, str_size);
}
22Samsung Open Source Group
Code size
Clang
<libc_fatal>:
b580 push {r7, lr}
466f mov r7, sp
b082 sub sp, #8
468c mov ip, r1
4601 mov r1, r0
b161 cbz r1, L1
f1bc 0f00 cmp.w ip, #0
bf18 it ne
2a00 cmpne r2, #0
d007 beq.n L1
f24a 405d movw r0, #42077
9300 str r3, [sp, #0]
4663 mov r3, ip
f6c0 0003 movt r0, #2051
f7ff fee4 bl 802d57e <printf>
L1: f000 f804 bl 802d7c2 <abort>
GCC
<libc_fatal>:
b507 push {r0, r1, r2, lr}
b138 cbz r0, L1
b131 cbz r1, L1
b12a cbz r2, L1
9300 str r3, [sp, #0]
460b mov r3, r1
4601 mov r1, r0
4802 ldr r0, [pc, #8] ; L2
f7ff fe74 bl 802855c <printf>
L1: f000 f805 bl 8028882 <abort>
L2: 0803515a .word 0x0803515a
void libc_fatal (const char *msg,
const char *file_name,
const char *function_name,
const unsigned int line_number) {
if (msg != NULL
&& file_name != NULL
&& function_name != NULL)
{
printf ("Assertion '%s' failed at %s (%s:%u).n",
msg, function_name, file_name, line_number);
}
abort ();
}
23Samsung Open Source Group
Code size
Clang
<lit_char_is_hex_digit>:
f1a0 0130 sub.w r1, r0, #48 ; 0x30
b289 uxth r1, r1
290a cmp r1, #10
bf22 ittt cs
f1a0 0161 subcs.w r1, r0, #97 ; 0x61
b289 uxthcs r1, r1
2906 cmpcs r1, #6
d306 bcc.n L1
3841 subs r0, #65 ; 0x41
b281 uxth r1, r0
2000 movs r0, #0
2906 cmp r1, #6
bf38 it cc
2001 movcc r0, #1
4770 bx lr
L1: 2001 movs r0, #1
4770 bx lr
GCC
<lit_char_is_hex_digit>:
f1a0 0330 sub.w r3, r0, #48 ; 0x30
2b09 cmp r3, #9
d907 bls.n L1
f020 0020 bic.w r0, r0, #32
3841 subs r0, #65 ; 0x41
2805 cmp r0, #5
bf8c ite hi
2000 movhi r0, #0
2001 movls r0, #1
4770 bx lr
L1: 2001 movs r0, #1
4770 bx lr
bool
lit_char_is_hex_digit (ecma_char_t c)
{
return ((c >= '0' && c <= '9')
|| (c >= 'a' && c <= 'f')
|| (c >= 'A' && c <= 'F'));
}
24Samsung Open Source Group
Recap
● Recap: List of potential optimizations
– Constant pool vs. materialization
– CBZ; more efficient branching
– Same code merging
– Switch lowering
– Tail calls
– Data packing
– GCC-generated computations often more compact
– LLVM frequently emits the IT instruction
25Samsung Open Source Group
Summary
26Samsung Open Source Group
Summary
● Clang-generated code about 10% bigger
● Lots of code size-related low-hanging fruit
● Future work: Enable LTO + -Os in Clang
● Specific optimization passes for code size
Thank you.
27Samsung Open Source Group

More Related Content

What's hot

JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsJerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
Samsung Open Source Group
 
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceAdding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Samsung Open Source Group
 
Development Boards for Tizen IoT
Development Boards for Tizen IoTDevelopment Boards for Tizen IoT
Development Boards for Tizen IoT
Samsung Open Source Group
 
Media Resource Sharing Through the Media Controller API
Media Resource Sharing Through the Media Controller APIMedia Resource Sharing Through the Media Controller API
Media Resource Sharing Through the Media Controller API
Samsung Open Source Group
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
Jung Kim
 
Run Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT NetworkRun Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT Network
Samsung Open Source Group
 
BKK16-307 LHG OE Initiative
BKK16-307 LHG OE InitiativeBKK16-307 LHG OE Initiative
BKK16-307 LHG OE Initiative
Linaro
 
BUD17-405: Building a reference IoT product with Zephyr
BUD17-405: Building a reference IoT product with Zephyr BUD17-405: Building a reference IoT product with Zephyr
BUD17-405: Building a reference IoT product with Zephyr
Linaro
 
BKK16-102 Creating new workload for Workload Automation & using WA with LAVA
BKK16-102 Creating new workload for Workload Automation & using WA with LAVABKK16-102 Creating new workload for Workload Automation & using WA with LAVA
BKK16-102 Creating new workload for Workload Automation & using WA with LAVA
Linaro
 
BKK16-407 AOSP Toolchain Evolution and experimental languages on AOSP
BKK16-407 AOSP Toolchain Evolution and experimental languages on AOSPBKK16-407 AOSP Toolchain Evolution and experimental languages on AOSP
BKK16-407 AOSP Toolchain Evolution and experimental languages on AOSP
Linaro
 
BKK16-210 Migrating to the new dispatcher
BKK16-210 Migrating to the new dispatcherBKK16-210 Migrating to the new dispatcher
BKK16-210 Migrating to the new dispatcher
Linaro
 
Thesis - LLVM toolchain support as a plug-in for Eclipse CDT
Thesis - LLVM toolchain support as a plug-in for Eclipse CDTThesis - LLVM toolchain support as a plug-in for Eclipse CDT
Thesis - LLVM toolchain support as a plug-in for Eclipse CDT
TuononenP
 
BKK16-207 VLANd in LAVA
BKK16-207 VLANd in LAVABKK16-207 VLANd in LAVA
BKK16-207 VLANd in LAVA
Linaro
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Samsung Open Source Group
 
BKK16-209 Chromium with V4L2 playback - is it ready today?
BKK16-209 Chromium with V4L2 playback - is it ready today?BKK16-209 Chromium with V4L2 playback - is it ready today?
BKK16-209 Chromium with V4L2 playback - is it ready today?
Linaro
 
LAS16-507: LXC support in LAVA
LAS16-507: LXC support in LAVALAS16-507: LXC support in LAVA
LAS16-507: LXC support in LAVA
Linaro
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
Samsung Open Source Group
 
Hands on clang-format
Hands on clang-formatHands on clang-format
Hands on clang-format
Kai Wolf
 
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxPractical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Samsung Open Source Group
 
BKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
BKK16-302: Android Optimizing Compiler: New Member Assimilation GuideBKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
BKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
Linaro
 

What's hot (20)

JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsJerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
 
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceAdding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
 
Development Boards for Tizen IoT
Development Boards for Tizen IoTDevelopment Boards for Tizen IoT
Development Boards for Tizen IoT
 
Media Resource Sharing Through the Media Controller API
Media Resource Sharing Through the Media Controller APIMedia Resource Sharing Through the Media Controller API
Media Resource Sharing Through the Media Controller API
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
 
Run Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT NetworkRun Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT Network
 
BKK16-307 LHG OE Initiative
BKK16-307 LHG OE InitiativeBKK16-307 LHG OE Initiative
BKK16-307 LHG OE Initiative
 
BUD17-405: Building a reference IoT product with Zephyr
BUD17-405: Building a reference IoT product with Zephyr BUD17-405: Building a reference IoT product with Zephyr
BUD17-405: Building a reference IoT product with Zephyr
 
BKK16-102 Creating new workload for Workload Automation & using WA with LAVA
BKK16-102 Creating new workload for Workload Automation & using WA with LAVABKK16-102 Creating new workload for Workload Automation & using WA with LAVA
BKK16-102 Creating new workload for Workload Automation & using WA with LAVA
 
BKK16-407 AOSP Toolchain Evolution and experimental languages on AOSP
BKK16-407 AOSP Toolchain Evolution and experimental languages on AOSPBKK16-407 AOSP Toolchain Evolution and experimental languages on AOSP
BKK16-407 AOSP Toolchain Evolution and experimental languages on AOSP
 
BKK16-210 Migrating to the new dispatcher
BKK16-210 Migrating to the new dispatcherBKK16-210 Migrating to the new dispatcher
BKK16-210 Migrating to the new dispatcher
 
Thesis - LLVM toolchain support as a plug-in for Eclipse CDT
Thesis - LLVM toolchain support as a plug-in for Eclipse CDTThesis - LLVM toolchain support as a plug-in for Eclipse CDT
Thesis - LLVM toolchain support as a plug-in for Eclipse CDT
 
BKK16-207 VLANd in LAVA
BKK16-207 VLANd in LAVABKK16-207 VLANd in LAVA
BKK16-207 VLANd in LAVA
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
 
BKK16-209 Chromium with V4L2 playback - is it ready today?
BKK16-209 Chromium with V4L2 playback - is it ready today?BKK16-209 Chromium with V4L2 playback - is it ready today?
BKK16-209 Chromium with V4L2 playback - is it ready today?
 
LAS16-507: LXC support in LAVA
LAS16-507: LXC support in LAVALAS16-507: LXC support in LAVA
LAS16-507: LXC support in LAVA
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
 
Hands on clang-format
Hands on clang-formatHands on clang-format
Hands on clang-format
 
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxPractical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
 
BKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
BKK16-302: Android Optimizing Compiler: New Member Assimilation GuideBKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
BKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
 

Viewers also liked

IoTivity on Tizen: How to
IoTivity on Tizen: How toIoTivity on Tizen: How to
IoTivity on Tizen: How to
Samsung Open Source Group
 
Toward "OCF Automotive" profile
Toward "OCF Automotive" profileToward "OCF Automotive" profile
Toward "OCF Automotive" profile
Samsung Open Source Group
 
ARM lab programs
ARM  lab programs  ARM  lab programs
ARM lab programs
revanasidha janbgi
 
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxIoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
Samsung Open Source Group
 
IoTivity: From Devices to the Cloud
IoTivity: From Devices to the CloudIoTivity: From Devices to the Cloud
IoTivity: From Devices to the Cloud
Samsung Open Source Group
 
Programming The Arm Microprocessor For Embedded Systems
Programming The Arm Microprocessor For Embedded SystemsProgramming The Arm Microprocessor For Embedded Systems
Programming The Arm Microprocessor For Embedded Systemsjoshparrish13
 

Viewers also liked (6)

IoTivity on Tizen: How to
IoTivity on Tizen: How toIoTivity on Tizen: How to
IoTivity on Tizen: How to
 
Toward "OCF Automotive" profile
Toward "OCF Automotive" profileToward "OCF Automotive" profile
Toward "OCF Automotive" profile
 
ARM lab programs
ARM  lab programs  ARM  lab programs
ARM lab programs
 
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxIoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
 
IoTivity: From Devices to the Cloud
IoTivity: From Devices to the CloudIoTivity: From Devices to the Cloud
IoTivity: From Devices to the Cloud
 
Programming The Arm Microprocessor For Embedded Systems
Programming The Arm Microprocessor For Embedded SystemsProgramming The Arm Microprocessor For Embedded Systems
Programming The Arm Microprocessor For Embedded Systems
 

Similar to A Close Look at ARM Code Size

Efficient JIT to 32-bit Arches
Efficient JIT to 32-bit ArchesEfficient JIT to 32-bit Arches
Efficient JIT to 32-bit Arches
Netronome
 
Make ARM Shellcode Great Again - HITB2018PEK
Make ARM Shellcode Great Again - HITB2018PEKMake ARM Shellcode Great Again - HITB2018PEK
Make ARM Shellcode Great Again - HITB2018PEK
Saumil Shah
 
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the CompilerPragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Marina Kolpakova
 
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
PVS-Studio
 
Embedded C programming session10
Embedded C programming  session10Embedded C programming  session10
Embedded C programming session10
Keroles karam khalil
 
C programming session10
C programming  session10C programming  session10
C programming session10
Keroles karam khalil
 
HackLU 2018 Make ARM Shellcode Great Again
HackLU 2018 Make ARM Shellcode Great AgainHackLU 2018 Make ARM Shellcode Great Again
HackLU 2018 Make ARM Shellcode Great Again
Saumil Shah
 
lecture16-recap-questions-and-answers.pdf
lecture16-recap-questions-and-answers.pdflecture16-recap-questions-and-answers.pdf
lecture16-recap-questions-and-answers.pdf
AyushKumar93531
 
Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization ApproachesPragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Marina Kolpakova
 
Exploring the x64
Exploring the x64Exploring the x64
Exploring the x64FFRI, Inc.
 
Make ARM Shellcode Great Again
Make ARM Shellcode Great AgainMake ARM Shellcode Great Again
Make ARM Shellcode Great Again
Saumil Shah
 
The Ring programming language version 1.5.3 book - Part 91 of 184
The Ring programming language version 1.5.3 book - Part 91 of 184The Ring programming language version 1.5.3 book - Part 91 of 184
The Ring programming language version 1.5.3 book - Part 91 of 184
Mahmoud Samir Fayed
 
100 bugs in Open Source C/C++ projects
100 bugs in Open Source C/C++ projects 100 bugs in Open Source C/C++ projects
100 bugs in Open Source C/C++ projects
Andrey Karpov
 
Android RenderScript
Android RenderScriptAndroid RenderScript
Android RenderScript
Jungsoo Nam
 
Visual Studio를 이용한 어셈블리어 학습 part 2
Visual Studio를 이용한 어셈블리어 학습 part 2Visual Studio를 이용한 어셈블리어 학습 part 2
Visual Studio를 이용한 어셈블리어 학습 part 2
YEONG-CHEON YOU
 
Demystify eBPF JIT Compiler
Demystify eBPF JIT CompilerDemystify eBPF JIT Compiler
Demystify eBPF JIT Compiler
Netronome
 
The Ring programming language version 1.7 book - Part 86 of 196
The Ring programming language version 1.7 book - Part 86 of 196The Ring programming language version 1.7 book - Part 86 of 196
The Ring programming language version 1.7 book - Part 86 of 196
Mahmoud Samir Fayed
 
The Ring programming language version 1.4 book - Part 22 of 30
The Ring programming language version 1.4 book - Part 22 of 30The Ring programming language version 1.4 book - Part 22 of 30
The Ring programming language version 1.4 book - Part 22 of 30
Mahmoud Samir Fayed
 
Fast and Reliable Apache Spark SQL Engine
Fast and Reliable Apache Spark SQL EngineFast and Reliable Apache Spark SQL Engine
Fast and Reliable Apache Spark SQL Engine
Databricks
 
The Ring programming language version 1.5.2 book - Part 78 of 181
The Ring programming language version 1.5.2 book - Part 78 of 181The Ring programming language version 1.5.2 book - Part 78 of 181
The Ring programming language version 1.5.2 book - Part 78 of 181
Mahmoud Samir Fayed
 

Similar to A Close Look at ARM Code Size (20)

Efficient JIT to 32-bit Arches
Efficient JIT to 32-bit ArchesEfficient JIT to 32-bit Arches
Efficient JIT to 32-bit Arches
 
Make ARM Shellcode Great Again - HITB2018PEK
Make ARM Shellcode Great Again - HITB2018PEKMake ARM Shellcode Great Again - HITB2018PEK
Make ARM Shellcode Great Again - HITB2018PEK
 
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the CompilerPragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
 
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
 
Embedded C programming session10
Embedded C programming  session10Embedded C programming  session10
Embedded C programming session10
 
C programming session10
C programming  session10C programming  session10
C programming session10
 
HackLU 2018 Make ARM Shellcode Great Again
HackLU 2018 Make ARM Shellcode Great AgainHackLU 2018 Make ARM Shellcode Great Again
HackLU 2018 Make ARM Shellcode Great Again
 
lecture16-recap-questions-and-answers.pdf
lecture16-recap-questions-and-answers.pdflecture16-recap-questions-and-answers.pdf
lecture16-recap-questions-and-answers.pdf
 
Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization ApproachesPragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
 
Exploring the x64
Exploring the x64Exploring the x64
Exploring the x64
 
Make ARM Shellcode Great Again
Make ARM Shellcode Great AgainMake ARM Shellcode Great Again
Make ARM Shellcode Great Again
 
The Ring programming language version 1.5.3 book - Part 91 of 184
The Ring programming language version 1.5.3 book - Part 91 of 184The Ring programming language version 1.5.3 book - Part 91 of 184
The Ring programming language version 1.5.3 book - Part 91 of 184
 
100 bugs in Open Source C/C++ projects
100 bugs in Open Source C/C++ projects 100 bugs in Open Source C/C++ projects
100 bugs in Open Source C/C++ projects
 
Android RenderScript
Android RenderScriptAndroid RenderScript
Android RenderScript
 
Visual Studio를 이용한 어셈블리어 학습 part 2
Visual Studio를 이용한 어셈블리어 학습 part 2Visual Studio를 이용한 어셈블리어 학습 part 2
Visual Studio를 이용한 어셈블리어 학습 part 2
 
Demystify eBPF JIT Compiler
Demystify eBPF JIT CompilerDemystify eBPF JIT Compiler
Demystify eBPF JIT Compiler
 
The Ring programming language version 1.7 book - Part 86 of 196
The Ring programming language version 1.7 book - Part 86 of 196The Ring programming language version 1.7 book - Part 86 of 196
The Ring programming language version 1.7 book - Part 86 of 196
 
The Ring programming language version 1.4 book - Part 22 of 30
The Ring programming language version 1.4 book - Part 22 of 30The Ring programming language version 1.4 book - Part 22 of 30
The Ring programming language version 1.4 book - Part 22 of 30
 
Fast and Reliable Apache Spark SQL Engine
Fast and Reliable Apache Spark SQL EngineFast and Reliable Apache Spark SQL Engine
Fast and Reliable Apache Spark SQL Engine
 
The Ring programming language version 1.5.2 book - Part 78 of 181
The Ring programming language version 1.5.2 book - Part 78 of 181The Ring programming language version 1.5.2 book - Part 78 of 181
The Ring programming language version 1.5.2 book - Part 78 of 181
 

More from Samsung Open Source Group

The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)
Samsung Open Source Group
 
Easy IoT with JavaScript
Easy IoT with JavaScriptEasy IoT with JavaScript
Easy IoT with JavaScript
Samsung Open Source Group
 
Spawny: A New Approach to Logins
Spawny: A New Approach to LoginsSpawny: A New Approach to Logins
Spawny: A New Approach to Logins
Samsung Open Source Group
 
Rapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBRapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USB
Samsung Open Source Group
 
IoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondIoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and Beyond
Samsung Open Source Group
 
IoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialIoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorial
Samsung Open Source Group
 
GENIVI + OCF Cooperation
GENIVI + OCF CooperationGENIVI + OCF Cooperation
GENIVI + OCF Cooperation
Samsung Open Source Group
 
Framework for IoT Interoperability
Framework for IoT InteroperabilityFramework for IoT Interoperability
Framework for IoT Interoperability
Samsung Open Source Group
 
Open Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategyOpen Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate Strategy
Samsung Open Source Group
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT Interoperability
Samsung Open Source Group
 
OIC AGL Collaboration
OIC AGL CollaborationOIC AGL Collaboration
OIC AGL Collaboration
Samsung Open Source Group
 
Tizen Connected with IoTivity
Tizen Connected with IoTivityTizen Connected with IoTivity
Tizen Connected with IoTivity
Samsung Open Source Group
 
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devicesIoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
Samsung Open Source Group
 
6LoWPAN: An Open IoT Networking Protocol
6LoWPAN: An Open IoT Networking Protocol6LoWPAN: An Open IoT Networking Protocol
6LoWPAN: An Open IoT Networking Protocol
Samsung Open Source Group
 

More from Samsung Open Source Group (14)

The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)
 
Easy IoT with JavaScript
Easy IoT with JavaScriptEasy IoT with JavaScript
Easy IoT with JavaScript
 
Spawny: A New Approach to Logins
Spawny: A New Approach to LoginsSpawny: A New Approach to Logins
Spawny: A New Approach to Logins
 
Rapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBRapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USB
 
IoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondIoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and Beyond
 
IoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialIoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorial
 
GENIVI + OCF Cooperation
GENIVI + OCF CooperationGENIVI + OCF Cooperation
GENIVI + OCF Cooperation
 
Framework for IoT Interoperability
Framework for IoT InteroperabilityFramework for IoT Interoperability
Framework for IoT Interoperability
 
Open Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategyOpen Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate Strategy
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT Interoperability
 
OIC AGL Collaboration
OIC AGL CollaborationOIC AGL Collaboration
OIC AGL Collaboration
 
Tizen Connected with IoTivity
Tizen Connected with IoTivityTizen Connected with IoTivity
Tizen Connected with IoTivity
 
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devicesIoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
 
6LoWPAN: An Open IoT Networking Protocol
6LoWPAN: An Open IoT Networking Protocol6LoWPAN: An Open IoT Networking Protocol
6LoWPAN: An Open IoT Networking Protocol
 

Recently uploaded

Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 

Recently uploaded (20)

Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 

A Close Look at ARM Code Size

  • 1. 1Samsung Open Source Group A closer look at ARM code size Tilmann Scheller Principal Compiler Engineer t.scheller@samsung.com Samsung Open Source Group Samsung Research UK EuroLLVM 2016 Barcelona, Spain, March 17 – 18, 2016
  • 2. 2Samsung Open Source Group Overview ● Introduction ● ARM architecture ● Case study ● Summary
  • 3. 3Samsung Open Source Group Introduction
  • 4. 4Samsung Open Source Group Introduction ● Code size matters in the embedded space ● Find out how we are doing on ARM ● Comparison against GCC ● Focus on a specific application and compare the generated assembly code ● Try to find out what we need to change in LLVM to get better code size
  • 5. 5Samsung Open Source Group ARM architecture
  • 6. 6Samsung Open Source Group ARM architecture ● 32-bit/64-bit RISC architecture ● Load-store architecture ● Barrel shifter: add r4, r3, r6, lsl #4 ● Powerful indexed addressing modes: ldr r0, [r1, #4]! ● Predication: ldreq r3, [r4] ● Family of 32-bit instruction sets evolved over time: ARM, Thumb, Thumb-2 ● Focus on the Thumb-2 instruction set in this talk ● Instruction set extensions: – VFP – Advanced SIMD (NEON)
  • 7. 7Samsung Open Source Group Thumb-2 ISA ● Goal: Code density similar to Thumb, performance like original ARM instruction set ● Variable-length instructions (16-bit/32-bit) ● 16 32-bit GPRs (including PC and SP) ● 16 or 32 64-bit floating-point registers for VFP/NEON ● Conditional execution with IT (if-then) instruction ; if (r0 == r1) cmp r0, r1 ite eq ; ARM: no code ... Thumb: IT instruction ; then r0 = r2; moveq r0, r2 ; ARM: conditional; Thumb: condition via ITE 'T' (then) ; else r0 = r3; movne r0, r3 ; ARM: conditional; Thumb: condition via ITE 'E' (else) ; recall that the Thumb MOV instruction has no bits to encode "EQ" or "NE"
  • 8. 8Samsung Open Source Group Case study
  • 9. 9Samsung Open Source Group JerryScript ● A really lightweight JavaScript engine ● Has a base footprint of 10KB of RAM ● Optimized for microcontrollers ● Written in C99 ● Supports all of ECMAScript 5.1 ● Open source (Apache 2.0 license) ● Developed by Samsung ● Goal: Want to compile with Clang but code size significantly higher
  • 10. 10Samsung Open Source Group Target hardware ● STM32F4 developer board ● Cortex-M4F clocked at 168 MHz ● 192KB of RAM ● 1MB of flash memory
  • 11. 11Samsung Open Source Group Code size ● Compiling with a Clang trunk snapshot (r262611, March 3, 2016) ● Using GCC 5.2.1 (Linaro bare-metal toolchain) ● JerryScript trunk snapshot (afa7b78, March 4, 2016) ● Release build of JerryScript ● Optimizing for the Cortex-M4F ● Building with -Os ● Static build, running bare-metal on the STM32F4 board
  • 12. 12Samsung Open Source Group Code size -Os -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 JerryScript 0 50 100 150 200 250 231 208 190 Clang r262611 GCC 5.2.1 GCC 5.2.1 LTO CodesizeinKB(lowerisbetter)
  • 13. 13Samsung Open Source Group Code size - LTO ● GCC in LTO mode produces the smallest binary ● Clang has no support for building in -Os -flto ● LTO optimization pipeline not tuned for size
  • 14. 14Samsung Open Source Group Identifying interesting functions ● Python script which parses the "objdump -d" output ● Parsing the assembly dump of both binaries ● Binaries compiled with -fno-inline ● Computes per function code size delta ● Some functions get specialized and are only available in one binary ● Not perfectly accurate but good enough
  • 15. 15Samsung Open Source Group Code size Clang <jerry_api_create_null_value>: b083 sub sp, #12 2102 movs r1, #2 f840 1b04 str.w r1, [r0], #4 4669 mov r1, sp e891 100c ldmia.w r1, {r2, r3, ip} e880 100c stmia.w r0, {r2, r3, ip} b003 add sp, #12 4770 bx lr GCC <jerry_api_create_null_value>: 2302 movs r3, #2 7003 strb r3, [r0, #0] 4770 bx lr typedef struct jerry_api_value_t { jerry_api_data_type_t type; union { bool v_bool; double v_float64; uint32_t v_uint32; ... } u; } jerry_api_value_t; /** * Creates and returns a jerry_api_value_t * with type JERRY_API_DATA_TYPE_NULL. */ jerry_api_value_t jerry_api_create_null_value (void) { jerry_api_value_t jerry_val; jerry_val.type = JERRY_API_DATA_TYPE_NULL; return jerry_val; }
  • 16. 16Samsung Open Source Group Code size Clang <lit_magic_strings_ex_set>: f240 0340 movw r3, #64 ; 0x40 f2c2 0300 movt r3, #8192 ; 0x2000 6018 str r0, [r3, #0] f240 0044 movw r0, #68 ; 0x44 f2c2 0000 movt r0, #8192 ; 0x2000 6001 str r1, [r0, #0] f240 0048 movw r0, #72 ; 0x48 f2c2 0000 movt r0, #8192 ; 0x2000 6002 str r2, [r0, #0] 4770 bx lr GCC <lit_magic_strings_ex_set>: 4b01 ldr r3, [pc, #4] ; (base) e883 0007 stmia.w r3, {r0, r1, r2} 4770 bx lr base: 20000074 .word 0x20000074 void lit_magic_strings_ex_set (const lit_utf8_byte_t **ex_str_items, uint32_t count, const lit_utf8_size_t *ex_str_sizes) { lit_magic_string_ex_array = ex_str_items; lit_magic_string_ex_count = count; lit_magic_string_ex_sizes = ex_str_sizes; }
  • 17. 17Samsung Open Source Group Code size Clang <lit_cpointer_decompress>: b120 cbz r0, 8001de2 <lit_cpointer_decompress+0xc> b580 push {r7, lr} 466f mov r7, sp f000 fba2 bl 8002524 <mem_decompress_pointer> bd80 pop {r7, pc} 8001de2: 2000 movs r0, #0 4770 bx lr GCC <lit_cpointer_decompress>: b108 cbz r0, 8001a74 <lit_cpointer_decompress+0x6> f000 ba6a b.w 8001f48 <mem_decompress_pointer> 8001a74: 4770 bx lr /* Decompress extended compressed pointer. */ lit_record_t * lit_cpointer_decompress (lit_cpointer_t compressed_pointer) { if (compressed_pointer == MEM_CP_NULL) { return NULL; } return (lit_record_t *) mem_decompress_pointer (compressed_pointer); }
  • 18. 18Samsung Open Source Group Code size /* Common function to generate fixed width, right aligned decimal numbers. */ static lit_utf8_byte_t * ecma_date_value_number_to_bytes (lit_utf8_byte_t *dest_p, int32_t number, int32_t width) { dest_p += width; lit_utf8_byte_t *result_p = dest_p; do { dest_p--; *dest_p = (lit_utf8_byte_t) ((number % 10) + (int32_t) LIT_CHAR_0); number /= 10; } while (--width > 0); return result_p; }
  • 19. 19Samsung Open Source Group Code size Clang <ecma_date_value_number_to_bytes>: b510 push {r4, lr} 4686 mov lr, r0 f246 6c67 movw ip, 0x6667 eb0e 0002 add.w r0, lr, r2 3a01 subs r2, #1 f2c6 6c66 movt ip, 0x6666 loop: fb51 f30c smmul r3, r1, ip 109c asrs r4, r3, #2 eb04 73d3 add.w r3, r4, r3, lsr #31 eb03 0483 add.w r4, r3, r3, lsl #2 eba1 0144 sub.w r1, r1, r4, lsl #1 3130 adds r1, #48 ; 0x30 f80e 1002 strb.w r1, [lr, r2] 1e51 subs r1, r2, #1 3201 adds r2, #1 2a01 cmp r2, #1 460a mov r2, r1 4619 mov r1, r3 dced bgt.n loop bd10 pop {r4, pc} bf00 nop GCC <ecma_date_value_number_to_bytes>: 4410 add r0, r2 b530 push {r4, r5, lr} 4603 mov r3, r0 250a movs r5, #10 1a12 subs r2, r2, r0 loop: fb91 f4f5 sdiv r4, r1, r5 fb05 1114 mls r1, r5, r4, r1 3130 adds r1, #48 ; 0x30 f803 1d01 strb.w r1, [r3, #-1]! 4621 mov r1, r4 189c adds r4, r3, r2 2c00 cmp r4, #0 dcf4 bgt.n loop bd30 pop {r4, r5, pc} /* Common function to generate fixed width, right aligned decimal numbers. */ static lit_utf8_byte_t * ecma_date_value_number_to_bytes (lit_utf8_byte_t *dest_p, int32_t number, int32_t width) { dest_p += width; lit_utf8_byte_t *result_p = dest_p; do { dest_p--; *dest_p = (lit_utf8_byte_t) ((number % 10) + (int32_t) LIT_CHAR_0); number /= 10; } while (--width > 0); return result_p; }
  • 20. 20Samsung Open Source Group Code size Clang <ecma_get_object_from_value>: b580 push {r7, lr} 466f mov r7, sp f7ff ff28 bl <ecma_get_value_value_field> e8bd 4080 ldmia.w sp!, {r7, lr} f7f5 bad2 b.w <mem_decompress_pointer> <ecma_get_string_from_value>: b580 push {r7, lr} 466f mov r7, sp f7ff ff30 bl <ecma_get_value_value_field> e8bd 4080 ldmia.w sp!, {r7, lr} f7f5 bada b.w <mem_decompress_pointer> GCC <ecma_get_object_from_value>: b508 push {r3, lr} f7ff ff3c bl <ecma_get_value_value_field> e8bd 4008 ldmia.w sp!, {r3, lr} f7f5 bfd1 b.w <mem_decompress_pointer> <ecma_get_string_from_value>: f7ff bff7 b.w <ecma_get_object_from_value> ecma_string_t * ecma_get_string_from_value (ecma_value_t value) { JERRY_ASSERT (ecma_get_value_type_field (value) == ECMA_TYPE_STRING); return ECMA_GET_NON_NULL_POINTER (ecma_string_t, ecma_get_value_value_field (value)); } ecma_object_t * ecma_get_object_from_value (ecma_value_t value) { JERRY_ASSERT (ecma_get_value_type_field (value) == ECMA_TYPE_OBJECT); return ECMA_GET_NON_NULL_POINTER (ecma_object_t, ecma_get_value_value_field (value)); }
  • 21. 21Samsung Open Source Group Code size Clang <lit_literal_equal_type_utf8>: 7883 ldrb r3, [r0, #2] f043 0304 orr.w r3, r3, #4 b2db uxtb r3, r3 2b04 cmp r3, #4 bf04 itt eq 2000 moveq r0, #0 4770 bxeq lr b580 push {r7, lr} 466f mov r7, sp f7ff ff17 bl 8001fac <lit_literal_equal_utf8> bd80 pop {r7, pc} GCC <lit_literal_equal_type_utf8>: 7883 ldrb r3, [r0, #2] f013 03fb ands.w r3, r3, #251 ; 0xfb d001 beq.n exit f7ff bfa6 b.w 8001c3a <lit_literal_equal_utf8> exit: 4618 mov r0, r3 4770 bx lr bool lit_literal_equal_type_utf8 (lit_literal_t lit, const lit_utf8_byte_t *str_p, lit_utf8_size_t str_size) { const lit_record_type_t type = (const lit_record_type_t) lit->type; if (type == LIT_RECORD_TYPE_NUMBER || type == LIT_RECORD_TYPE_FREE) { return false; } return lit_literal_equal_utf8 (lit, str_p, str_size); }
  • 22. 22Samsung Open Source Group Code size Clang <libc_fatal>: b580 push {r7, lr} 466f mov r7, sp b082 sub sp, #8 468c mov ip, r1 4601 mov r1, r0 b161 cbz r1, L1 f1bc 0f00 cmp.w ip, #0 bf18 it ne 2a00 cmpne r2, #0 d007 beq.n L1 f24a 405d movw r0, #42077 9300 str r3, [sp, #0] 4663 mov r3, ip f6c0 0003 movt r0, #2051 f7ff fee4 bl 802d57e <printf> L1: f000 f804 bl 802d7c2 <abort> GCC <libc_fatal>: b507 push {r0, r1, r2, lr} b138 cbz r0, L1 b131 cbz r1, L1 b12a cbz r2, L1 9300 str r3, [sp, #0] 460b mov r3, r1 4601 mov r1, r0 4802 ldr r0, [pc, #8] ; L2 f7ff fe74 bl 802855c <printf> L1: f000 f805 bl 8028882 <abort> L2: 0803515a .word 0x0803515a void libc_fatal (const char *msg, const char *file_name, const char *function_name, const unsigned int line_number) { if (msg != NULL && file_name != NULL && function_name != NULL) { printf ("Assertion '%s' failed at %s (%s:%u).n", msg, function_name, file_name, line_number); } abort (); }
  • 23. 23Samsung Open Source Group Code size Clang <lit_char_is_hex_digit>: f1a0 0130 sub.w r1, r0, #48 ; 0x30 b289 uxth r1, r1 290a cmp r1, #10 bf22 ittt cs f1a0 0161 subcs.w r1, r0, #97 ; 0x61 b289 uxthcs r1, r1 2906 cmpcs r1, #6 d306 bcc.n L1 3841 subs r0, #65 ; 0x41 b281 uxth r1, r0 2000 movs r0, #0 2906 cmp r1, #6 bf38 it cc 2001 movcc r0, #1 4770 bx lr L1: 2001 movs r0, #1 4770 bx lr GCC <lit_char_is_hex_digit>: f1a0 0330 sub.w r3, r0, #48 ; 0x30 2b09 cmp r3, #9 d907 bls.n L1 f020 0020 bic.w r0, r0, #32 3841 subs r0, #65 ; 0x41 2805 cmp r0, #5 bf8c ite hi 2000 movhi r0, #0 2001 movls r0, #1 4770 bx lr L1: 2001 movs r0, #1 4770 bx lr bool lit_char_is_hex_digit (ecma_char_t c) { return ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')); }
  • 24. 24Samsung Open Source Group Recap ● Recap: List of potential optimizations – Constant pool vs. materialization – CBZ; more efficient branching – Same code merging – Switch lowering – Tail calls – Data packing – GCC-generated computations often more compact – LLVM frequently emits the IT instruction
  • 25. 25Samsung Open Source Group Summary
  • 26. 26Samsung Open Source Group Summary ● Clang-generated code about 10% bigger ● Lots of code size-related low-hanging fruit ● Future work: Enable LTO + -Os in Clang ● Specific optimization passes for code size