[compiler-rt] [compiler-rt][ARM] Optimized mulsf3 and divsf3 (PR #161546)
Simon Tatham via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 6 04:03:14 PST 2025
================
@@ -422,6 +422,24 @@ set(arm_or_thumb2_base_SOURCES
${GENERIC_SOURCES}
)
+option(COMPILER_RT_ARM_OPTIMIZED_FP
+ "On 32-bit Arm, use optimized assembly implementations of FP arithmetic. Likely to increase code size, but be faster." ON)
+
+if(COMPILER_RT_ARM_OPTIMIZED_FP)
+ set(assembly_files
+ arm/mulsf3.S
+ arm/divsf3.S)
+ set_source_files_properties(${assembly_files}
+ PROPERTIES COMPILE_OPTIONS "-Wa,-mimplicit-it=always")
----------------
statham-arm wrote:
OK, now I've put in a check. It turned out that no cmake command higher-level than the general-purpose `try_compile` would handle assembly language -- all the things like `check_compiler_flag()` had a list of supported languages not including ASM. So I had to write my own helper function.
I still haven't figured out how to test it against anything that isn't a compiler driver. But I'm testing for `-mimplicit-it` first, which means that compiling with clang the first test passes, and with gcc the first test fails and we fall back to `-Wa,-mimplicit-it`, so I've at least been able to check that these tests are doing _something_ nontrivial.
https://github.com/llvm/llvm-project/pull/161546
More information about the llvm-commits
mailing list