P4C
The P4 Compiler
|
Contains utility functions for eliminating saturating arithmetic. More...
#include <saturationElim.h>
Static Public Member Functions | |
static const IR::Mux * | eliminate (const IR::Operation_Binary *binary) |
static bool | isSaturationOperation (const IR::Expression *expr) |
Contains utility functions for eliminating saturating arithmetic.
|
static |
Eliminates saturating arithmetic by rewriting the given binary expression into a conditional ternary expression. The two operands in the given expression are assumed to be pure expressions (i.e., they have no side effects), and may be evaluated multiple times in the resulting expression. No checks are made to determine whether this assumption holds.
|
static |