Skip to content

Conversation

@chiphogg
Copy link
Member

The interface is would_value_overflow<Op>(x), where x is a value of
type OpInput<Op>. This interface is already good enough to replace
both the implicit-rep and explicit-rep versions of the runtime overflow
checkers! Except that we can't just yet, because we're not actually
using an operation
to implement our conversions.

Along the way, we add (and test) some other helpful utilities, some of
which are useful in other places. For example, we'll make use of
CanOverflowAbove in our implicit conversion policy.

MinValueChecker and MaxValueChecker are designed to produce
functions that unconditionally return false for their is_too_XX()
members. This should make it very easy for the compiler to produce very
efficient assembly for would_value_overflow().

Helps #349: at this point, the :overflow_boundary target should be
complete and ready for production!

The interface is `would_value_overflow<Op>(x)`, where `x` is a value of
type `OpInput<Op>`.  This interface is already good enough to replace
both the implicit-rep and explicit-rep versions of the runtime overflow
checkers!  Except that we can't just yet, because we're not _actually
using an operation_ to implement our conversions.

Along the way, we add (and test) some other helpful utilities, some of
which are useful in other places.  For example, we'll make use of
`CanOverflowAbove` in our implicit conversion policy.

`MinValueChecker` and `MaxValueChecker` are designed to produce
functions that unconditionally return `false` for their `is_too_XX()`
members.  This should make it very easy for the compiler to produce very
efficient assembly for `would_value_overflow()`.

Helps #349: at this point, the `:overflow_boundary` target should be
complete and ready for production!
@chiphogg chiphogg merged commit dfad42c into main Jul 18, 2025
14 checks passed
@chiphogg chiphogg deleted the chiphogg/runtime-overflow-checker#349 branch July 18, 2025 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants