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

Simon Tatham via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 27 10:13:20 PDT 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:

Thanks, I hadn't thought of that. (I didn't know it was even possible to use `llvm-mc` directly in a cmake build.)

Do you happen to know how to check which assembler syntax is in use? It looks to me as if cmake doesn't have `check_asm_compiler_flag` or `CMAKE_ASM_COMPILER_FRONTEND_VARIANT` (whereas it has both of those for `cxx`). I'm sure I can make up my own system if I have to, but if there's an existing one I haven't found, I'd prefer to use it, and surely you would too :slightly_smiling_face: 

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


More information about the llvm-commits mailing list