RP2350 FPU compiler flags #1993
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk#1993
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
See https://github.com/earlephilhower/arduino-pico/issues/2535
According to this it seems like it is using softmp mode for floating point operation for the RP2350.
SoftFP (soft floating point): Use hardware floating-point operations, but function calls pass parameters via general-purpose registers (compatible with non-FPU systems).
HardFP (hard floating point): Pass floating-point values in floating-point registers during function calls (which is faster but requires hardware FPU support).
Is there any reason for this and would hardfp make floating point performance better (I am using the FPU primarely for Audio DSP).
I was testing that and
hardinsteadsoftfpwas initially a bit faster, but my test code was usingatan2f()and it happened to spit out some garbage whenhard. Some regularhardmultiplication and divisions turned out to be equally fast assoftfp.PS. But
GCC8.3.1 was fastest of allGCCs(9.3.1 was a bit slower and then 10, 11, 12, 13 like 10 % slower - but it was some "specific" code. Some "regular" one was not faster like that).LLVM LTO(whichever version) was the fastest - but code overall, not justFPI guess whenLTO.That's not going to work with the standard SDK setup. Many FP functions are wrapped, such as
atan2fandsinto use ROM routines. If you change the ABI of your code you can't call those ROM routines. If you disabled the--Wl,--wrap=xxxxxfrom the build process you might be able to get everything running. Runmake VERBOSE=1to see the final link stage which will have these--wrapoptions.That said, if you're doing any reasonable amount of FP ops in a function, and not just one or two, I don't imagine any gains to be very large. Moving from FP regs to normal ones is only a 1-cycle OP, I'd imagine...
Roughly what i was going to say 😄
Upshot is that we decided that the benefit of hard-fp is minimal
More importantly, using it is currently not supported as noted, as all the assembly functions in
pico_floatandpico_doubleassume softfp (this is something we plan to fix in an upcoming SDK release)You can probably use hardfp if you set
pico_float_implementationandpico_double_implementationtocompiler(though I haven't tried)