4.7.6. Enabling the FPU

Note

Ignore this section if the optional FPU is not present in your implementation.

The FPU is disabled from reset. You must enable it before you can use any floating-point instructions. Example 4.1 shows an example code sequence for enabling the FPU in privileged mode. The processor must be in privileged mode to read from and write to the CPACR.

Example 4.1. Enabling the FPU

CPACR   EQU  0xE000ED88

LDR     R0,  =CPACR          ; Read CPACR
LDR     r1, [R0]             ; Set bits 20-23 to enable CP10 and CP11 coprocessors
ORR     R1, R1, #(0xF << 20)
STR     R1, [R0]             ; Write back the modified value to the CPACR

DSB
ISB                          ; Reset pipeline now the FPU is enabled.

Copyright © 2015, 2018 Arm. All rights reserved.ARM DUI 0646C
Non-ConfidentialID121118