Skip to content

Commit 2689590

Browse files
stephanosiocarlescufi
authored andcommitted
arch: arm64: Disable ldp/stp Qn for consecutive 32-byte loads/stores
GCC may generate ldp/stp instructions with the Advanced SIMD Qn registers for consecutive 32-byte loads and stores. This commit disables this GCC behaviour because saving and restoring the Advanced SIMD context is very expensive, and it is preferable to keep it turned off by not emitting these instructions for better context switching performance. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent a4264f3 commit 2689590

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

arch/arm64/core/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,13 @@ endif ()
4444

4545
zephyr_cc_option_ifdef(CONFIG_USERSPACE -mno-outline-atomics)
4646

47+
# GCC may generate ldp/stp instructions with the Advanced SIMD Qn registers for
48+
# consecutive 32-byte loads and stores. Saving and restoring the Advanced SIMD
49+
# context is very expensive, and it is preferable to keep it turned off by not
50+
# emitting these instructions for better context switching performance.
51+
52+
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
53+
zephyr_cc_option(-moverride=tune=no_ldp_stp_qregs)
54+
endif()
55+
4756
add_subdirectory_ifdef(CONFIG_SOC_XENVM xen)

0 commit comments

Comments
 (0)