Skip to content

testing: Add host fmaf regression program - #3830

Open
anatol wants to merge 1 commit into
apache:masterfrom
anatol:master
Open

anatol wants to merge 1 commit into
apache:masterfrom
anatol:master

Conversation

@anatol

@anatol anatol commented Oct 11, 2026 •

Copy link
Copy Markdown

Summary

  • Add a host-side regression program under testing/fmaf that compares NuttX fmaf() with the host libm.
  • Check result bits and floating-point exception flags in all four rounding modes. The cases include boundary values, halfway cases, double-rounding traps, and one million pseudorandom inputs per rounding mode.
  • This provides a reproducible way to check fmaf() behavior against host libm.
  • Related NuttX or NuttX Apps issue: None.

Impact

  • New feature or changed existing feature? Yes. Adds a host-side fmaf() regression program.
  • Impact on user: No. No application or user-facing behavior changes.
  • Impact on build: No. Does not change the NuttX Apps build.
  • Impact on hardware: No. The program runs on a host and does not change hardware support.
  • Impact on documentation: No. The source file documents how to compile and run the program.
  • Impact on security: No.
  • Impact on compatibility: No.
  • Anything else to consider: The program must be linked with the NuttX lib_fmaf.c implementation and host libm. It is a companion for libs/libm: Add fmaf, using fmadd.s on RISC-V targets with an FPU. nuttx#20553

Testing

  • Build host: Not run.
  • Target: Host-side executable; no NuttX board target.
  • Build and runtime logs: Not run. Add the host, compiler, and output here before submitting.

PR verification Self-Check

☑ This PR introduces only one functional change.
☑ I have updated all required description fields above.
☑ My PR adheres to the Contributing Guidelines and Documentation.
☐ My PR is still work in progress (not ready for review).
☑ My PR is ready for review and can be safely merged into a codebase.

Assisted-by: Claude Code:claude-sonnet-5-5

@cederom cederom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @anatol please update PR description according to https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md :-)

@anatol

anatol commented Oct 11, 2026

Copy link
Copy Markdown
Author

@cederom Thank you for the feedback. PTAL.

Comment thread testing/fmaf/test_fmaf.c Outdated
Comment thread testing/libc/fmaf/test_fmaf.c
Comment thread testing/libc/fmaf/Kconfig Outdated
Comment thread testing/libc/fmaf/CMakeLists.txt
Comment thread testing/libc/fmaf/Makefile
Comment thread testing/libc/fmaf/test_fmaf_impl.c Outdated
Add a host-side regression program under testing/libc/fmaf that compiles the
NuttX fmaf implementation and compares results and required exception flags
with host libm across all four rounding modes. Include Make and CMake metadata
for building it as a NuttX test app.

Keep the comparison harness with the apps testing sources rather than the
NuttX tools directory, and document how to invoke it from nuttx-apps.

Tests: host C compiler build and run against system libm; 4,072,672 cases
passed across four rounding modes.

Assisted-by: Claude Code:claude-sonnet-5-5
Signed-off-by: Anatol Pomozov <anatol@google.com>
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.

3 participants