Skip to content

Add support for hard float on M33 via CMake variable PICO_HARD_FLOAT_ABI=1#2822

Merged
kilograham merged 25 commits into
developfrom
hard_float_support
Mar 4, 2026
Merged

Add support for hard float on M33 via CMake variable PICO_HARD_FLOAT_ABI=1#2822
kilograham merged 25 commits into
developfrom
hard_float_support

Conversation

@kilograham
Copy link
Copy Markdown
Contributor

@kilograham kilograham commented Feb 8, 2026

Note there is currently no hard float library in the llvm_libc

andylinpersonal and others added 4 commits February 7, 2026 18:56
Resolves #2783

Signed-off-by: Andy Lin <andylinpersonal@gmail.com>
- splitting out executable for each test type for pico_float/double_test
- removing undefined behavior from custom_float_funcs_test.c, to de-confuse clang
- add test of denormal->int

Note some tests still fail on llvm libc (at least version 19)
@kilograham kilograham added this to the 2.2.1 milestone Feb 8, 2026
@kilograham kilograham changed the title Add support for hard float on M33 ia Cmake var PICO_HARD_FLOAT_ABI=1 Add support for hard float on M33 ia CMake var PICO_HARD_FLOAT_ABI=1 Feb 8, 2026
@kilograham kilograham changed the title Add support for hard float on M33 ia CMake var PICO_HARD_FLOAT_ABI=1 Add support for hard float on M33 via CMake variable PICO_HARD_FLOAT_ABI=1 Feb 8, 2026
@dpgeorge
Copy link
Copy Markdown
Contributor

dpgeorge commented Feb 8, 2026

Really looking forward to this! Unless there are serious performance regressions (I expect there will not be) we will enable it in MicroPython. That's because our ABI for dynamically loadable native code only supports -mfloat-abi=soft or -mfloat-abi=hard, we don't support softfp (we could, but it's extra work and an extra combination of targets to support across all the tools).

Comment thread test/pico_float_test/CMakeLists.txt Outdated
Comment thread test/pico_float_test/CMakeLists.txt Outdated
kilograham and others added 2 commits March 2, 2026 13:20
Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
Comment thread src/rp2_common/pico_double/double_aeabi_dcp.S
Comment thread src/rp2_common/pico_double/double_conv_m33.S
Comment thread src/rp2_common/pico_double/double_fma_dcp.S Outdated
Comment thread src/rp2_common/pico_float/CMakeLists.txt
Comment thread src/rp2_common/pico_float/float_common_m33.S
Copy link
Copy Markdown
Contributor

@Wren6991 Wren6991 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fairly certain the mismatched push/pop is a bug. Otherwise looks ok, so LGTM once that is re-checked

@lurch
Copy link
Copy Markdown
Contributor

lurch commented Mar 3, 2026

CI appears to be failing with:

CMake Error at src/CMakeLists.txt:72 (target_link_options):
  Cannot specify link options for target "pico_double_pico_dcp" which is not
  built by this project.
Call Stack (most recent call first):
  src/rp2_common/pico_double/CMakeLists.txt:60 (pico_wrap_function)
  src/rp2_common/pico_double/CMakeLists.txt:124 (wrap_double_functions)

Wren6991
Wren6991 previously approved these changes Mar 3, 2026
Copy link
Copy Markdown
Contributor

@Wren6991 Wren6991 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake change in fc579bc looks weird, and may be related to CI failure. Otherwise looks like everything I mentioned was addressed so LGTM

@lurch
Copy link
Copy Markdown
Contributor

lurch commented Mar 3, 2026

Lots of CI failures in the Bazel builds now, e.g.

[1,024 / 1,094] Compiling test/hardware_sync_spin_lock_test/hardware_sync_spin_lock_test.c; 0s processwrapper-sandbox, disk-cache ... (3 actions, 2 running)
INFO: From Compiling test/pico_float_test/pico_float_test.c:
In file included from external/+_repo_rules+arm_gcc_linux-x86_64/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/include/stdio.h:35,
                 from test/pico_float_test/pico_float_test.c:15:
test/pico_float_test/pico_float_test.c: In function 'main':
test/pico_float_test/pico_float_test.c:348:85: warning: implicit declaration of function '__real_fmaf'; did you mean '__real_fmodf'? [-Wimplicit-function-declaration]
  348 | #define check_close3(func,p0,p1,p2) ({ typeof(p0) r = func(p0,p1,p2), r2 = __CONCAT(__real_, func)(p0,p1,p2); if (isnanf(p0) || isnanf(p1) || isnanf(p2)) assert_nan(r); else assert_close(r, r2); r; })
      |                                                                                     ^~~~~~~
test/pico_float_test/pico_float_test.c:506:17: note: in expansion of macro 'check_close3'
  506 |                 check_close3(fmaf, a, b, c);
      |                 ^~~~~~~~~~~~

@kilograham kilograham merged commit 9a47668 into develop Mar 4, 2026
11 checks passed
@kilograham kilograham deleted the hard_float_support branch March 4, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants