Skip to content

Commit f4a3ea4

Browse files
authored
Merge pull request python#35 from tiran/perf-arm64
2 parents daacbf5 + dfecbc5 commit f4a3ea4

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

Objects/asm_trampoline.S

+12-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,19 @@ _Py_trampoline_func_start:
1212
pop %rbp
1313
ret
1414
#endif // __x86_64__
15-
#ifdef __aarch64__
16-
TODO
15+
#if defined(__aarch64__) && defined(__AARCH64EL__) && !defined(__ILP32__)
16+
// ARM64 little endian, 64bit ABI
17+
// generate with aarch64-linux-gnu-gcc 12.1
18+
stp x29, x30, [sp, -16]!
19+
mov x29, sp
20+
mov x4, x0
21+
mov x0, x1
22+
mov x1, x2
23+
mov w2, w3
24+
blr x4
25+
ldp x29, x30, [sp], 16
26+
ret
1727
#endif
1828
.globl _Py_trampoline_func_end
1929
_Py_trampoline_func_end:
2030
.section .note.GNU-stack,"",@progbits
21-

configure

+4-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

+3-2
Original file line numberDiff line numberDiff line change
@@ -3428,8 +3428,9 @@ AC_MSG_RESULT($SHLIBS)
34283428
dnl perf trampoline is Linux specific and requires an arch-specific
34293429
dnl trampoline in asssembly.
34303430
AC_MSG_CHECKING([perf trampoline])
3431-
AS_CASE([$host],
3432-
[x86_64-*-linux-*], [perf_trampoline=yes],
3431+
AS_CASE([$PLATFORM_TRIPLET],
3432+
[x86_64-linux-gnu], [perf_trampoline=yes],
3433+
[aarch64-linux-gnu], [perf_trampoline=yes],
34333434
[perf_trampoline=no]
34343435
)
34353436
AC_MSG_RESULT([$perf_trampoline])

0 commit comments

Comments
 (0)