From ae92ea149c30bb90082a627d30d663b3359a6e4c Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Thu, 3 Dec 2020 20:37:08 +0100 Subject: [PATCH] esp32: enable the FPU This allows working with float32 values, for example it allows testdata/float.go to work correctly (assuming an Xtensa backend bug is fixed, see https://github.com/espressif/llvm-project/issues/41). --- src/device/esp/esp32.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/device/esp/esp32.S b/src/device/esp/esp32.S index f8fc6f93..1179a2da 100644 --- a/src/device/esp/esp32.S +++ b/src/device/esp/esp32.S @@ -42,6 +42,11 @@ call_start_cpu0: wsr.ps a2 rsync + // Enable the FPU (coprocessor 0 so the lowest bit). + movi a2, 1 + wsr.cpenable a2 + rsync + // Jump to the runtime start function written in Go. call4 main