Consider removing support for saturating float point to integer conversions #2820

Open
opened 2026-02-06 18:03:01 -06:00 by kilograham · 0 comments
kilograham commented 2026-02-06 18:03:01 -06:00 (Migrated from github.com)

In all our custom floating point code we have traditionally supported saturating the results for out of range inputs, however this appears NOT to be required by the C specification and whether the compiler does or not varies between versions

LLVM has -fno-strict-float-cast-overflow to enable the behavior which i have added for our floating point tests because LLVM was treating parts of the test as undefined behavior

The saturation logic probably makes the code slower, so we could consider removing it (at least for the built-in C style conversions as used

In all our custom floating point code we have traditionally supported saturating the results for out of range inputs, however this appears NOT to be required by the C specification and whether the compiler does or not varies between versions LLVM has `-fno-strict-float-cast-overflow` to enable the behavior which i have added for our floating point tests because LLVM was treating parts of the test as undefined behavior The saturation logic probably makes the code slower, so we could consider removing it (at least for the built-in C style conversions as used
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk#2820
No description provided.