[compiler-rt] [compiler-rt][ARM] Optimized mulsf3 and divsf3 (PR #161546)

Simon Tatham via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 5 09:08:08 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:

I'm still very confused about _how_ to configure a test build of compiler-rt which will successfully assemble the Arm builtins without being a compiler driver that speaks `-Wa,`. You seem to be saying here that there's some other way to configure cmake to invoke both cpp and as? But I don't know what it is; surely CMAKE_ASM_COMPILER would need to be set to a single command, and I can't think what command would work.

> In fact, I think that `-mimplicit-it=always` can just be passed without the `-Wa,`

Huh, apparently that works in clang! TIL. Doesn't work in my nearest gcc, though – that still demands `-Wa,`. But I suppose at least that gives me a way to test a piece of cmake that checks which flag works.

https://github.com/llvm/llvm-project/pull/161546


More information about the llvm-commits mailing list