1 | // compile with -march=armv8-a+simd on compatible aarch64 compiler |
2 | // linux-aarch64-neon.core was generated by: aarch64-linux-gnu-gcc-8 |
3 | // commandline: -march=armv8-a+simd -nostdlib -static -g linux-aarch64-neon.c |
4 | #include <stdint.h> |
5 | |
6 | static void bar(char *boom) { |
7 | char F = 'b'; |
8 | asm volatile("fmov d0, #0.5\n\t" ); |
9 | asm volatile("fmov d1, #1.5\n\t" ); |
10 | asm volatile("fmov d2, #2.5\n\t" ); |
11 | asm volatile("fmov d3, #3.5\n\t" ); |
12 | asm volatile("fmov s4, #4.5\n\t" ); |
13 | asm volatile("fmov s5, #5.5\n\t" ); |
14 | asm volatile("fmov s6, #6.5\n\t" ); |
15 | asm volatile("fmov s7, #7.5\n\t" ); |
16 | asm volatile("movi v8.16b, #0x11\n\t" ); |
17 | asm volatile("movi v31.16b, #0x30\n\t" ); |
18 | |
19 | uint64_t pattern = 0x1122334455667788; |
20 | asm volatile("msr tpidr_el0, %0" ::"r" (pattern)); |
21 | |
22 | *boom = 47; // Frame bar |
23 | } |
24 | |
25 | static void foo(char *boom, void (*boomer)(char *)) { |
26 | char F = 'f'; |
27 | boomer(boom); // Frame foo |
28 | } |
29 | |
30 | void _start(void) { |
31 | char F = '_'; |
32 | foo(boom: 0, boomer: bar); // Frame _start |
33 | } |
34 | |