[libc-commits] [libc] [libc] Enable the FPU in Arm startup code (PR #166349)

Victor Campos via libc-commits libc-commits at lists.llvm.org
Wed Nov 5 07:33:04 PST 2025


================
@@ -131,6 +131,28 @@ namespace LIBC_NAMESPACE_DECL {
   __arm_wsr("CPSR_c", 0x13); // SVC
 #endif
 
+#ifdef __ARM_FP
+// Enable FPU
+#if __ARM_ARCH_PROFILE == 'M'
+  // Set CPACR cp10 and cp11
+  auto cpacr = (volatile uint32_t *const)0xE000ED88;
+  *cpacr |= (0xF << 20);
+  __dsb(0xF);
----------------
vhscampos wrote:

Good point. Fixed.

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


More information about the libc-commits mailing list