From cec641a71b15fca2458d4844263418427f199ba8 Mon Sep 17 00:00:00 2001 From: Daniel Kutenin Date: Mon, 26 Sep 2022 13:00:18 +0100 Subject: [PATCH 1/3] Add ldapr for Arm instances --- cmake/cpu_features.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/cpu_features.cmake b/cmake/cpu_features.cmake index f9b2f103f49..35eb95a5d47 100644 --- a/cmake/cpu_features.cmake +++ b/cmake/cpu_features.cmake @@ -45,6 +45,8 @@ elseif (ARCH_AARCH64) # dotprod: Scalar vector product (SDOT and UDOT instructions). Probably the most obscure extra flag with doubtful performance benefits # but it has been activated since always, so why not enable it. It's not 100% clear in which revision this flag was # introduced as optional, either in v8.2 [7] or in v8.4 [8]. + # ldapr: Load-Acquire RCpc Register. Better support of release/acquire of atomics. Good for allocators and high contention code. + # Optional in v8.2, mandatory in v8.3 [9]. Supported in Graviton 2+, Azure and GCP instances. Generated from clang 15. # # [1] https://github.com/aws/aws-graviton-getting-started/blob/main/c-c%2B%2B.md # [2] https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/making-the-most-of-the-arm-architecture-in-gcc-10 @@ -54,7 +56,8 @@ elseif (ARCH_AARCH64) # [6] https://developer.arm.com/documentation/100067/0612/armclang-Command-line-Options/-mcpu?lang=en # [7] https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html # [8] https://developer.arm.com/documentation/102651/a/What-are-dot-product-intructions- - set (COMPILER_FLAGS "${COMPILER_FLAGS} -march=armv8.2-a+simd+crypto+dotprod+ssbs") + # [9] https://developer.arm.com/documentation/dui0801/g/A64-Data-Transfer-Instructions/LDAPR?lang=en + set (COMPILER_FLAGS "${COMPILER_FLAGS} -march=armv8.2-a+simd+crypto+dotprod+ssbs -Xclang=-target-feature -Xclang=+ldapr") endif () elseif (ARCH_PPC64LE) From 46d45607c8faa620ea928c9202b795af1194b353 Mon Sep 17 00:00:00 2001 From: Daniel Kutenin Date: Mon, 26 Sep 2022 15:53:03 +0100 Subject: [PATCH 2/3] Disable unused command line as it does not work for assembly files --- cmake/warnings.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/warnings.cmake b/cmake/warnings.cmake index 89f3a62ba2e..92aebdea70d 100644 --- a/cmake/warnings.cmake +++ b/cmake/warnings.cmake @@ -46,6 +46,7 @@ if (COMPILER_CLANG) no_warning(weak-vtables) no_warning(thread-safety-negative) # experimental flag, too many false positives no_warning(enum-constexpr-conversion) # breaks magic-enum library in clang-16 + no_warning(unused-command-line-argument) # TODO Enable conversion, sign-conversion, double-promotion warnings. elseif (COMPILER_GCC) # Add compiler options only to c++ compiler From 9825b4d1f9e9eb9e86b27f2e1b530bb8c8705fb9 Mon Sep 17 00:00:00 2001 From: Daniel Kutenin Date: Mon, 26 Sep 2022 20:56:52 +0100 Subject: [PATCH 3/3] Move unused command line arguments to a proper place --- cmake/cpu_features.cmake | 2 +- cmake/warnings.cmake | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cmake/cpu_features.cmake b/cmake/cpu_features.cmake index 35eb95a5d47..6707d703372 100644 --- a/cmake/cpu_features.cmake +++ b/cmake/cpu_features.cmake @@ -57,7 +57,7 @@ elseif (ARCH_AARCH64) # [7] https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html # [8] https://developer.arm.com/documentation/102651/a/What-are-dot-product-intructions- # [9] https://developer.arm.com/documentation/dui0801/g/A64-Data-Transfer-Instructions/LDAPR?lang=en - set (COMPILER_FLAGS "${COMPILER_FLAGS} -march=armv8.2-a+simd+crypto+dotprod+ssbs -Xclang=-target-feature -Xclang=+ldapr") + set (COMPILER_FLAGS "${COMPILER_FLAGS} -march=armv8.2-a+simd+crypto+dotprod+ssbs -Xclang=-target-feature -Xclang=+ldapr -Wno-unused-command-line-argument") endif () elseif (ARCH_PPC64LE) diff --git a/cmake/warnings.cmake b/cmake/warnings.cmake index 92aebdea70d..89f3a62ba2e 100644 --- a/cmake/warnings.cmake +++ b/cmake/warnings.cmake @@ -46,7 +46,6 @@ if (COMPILER_CLANG) no_warning(weak-vtables) no_warning(thread-safety-negative) # experimental flag, too many false positives no_warning(enum-constexpr-conversion) # breaks magic-enum library in clang-16 - no_warning(unused-command-line-argument) # TODO Enable conversion, sign-conversion, double-promotion warnings. elseif (COMPILER_GCC) # Add compiler options only to c++ compiler