aboutsummaryrefslogtreecommitdiff
path: root/pseudocode/library/generic_helpers.tosac
diff options
context:
space:
mode:
Diffstat (limited to 'pseudocode/library/generic_helpers.tosac')
-rw-r--r--pseudocode/library/generic_helpers.tosac11
1 files changed, 10 insertions, 1 deletions
diff --git a/pseudocode/library/generic_helpers.tosac b/pseudocode/library/generic_helpers.tosac
index a9d71ec..a2fdbe0 100644
--- a/pseudocode/library/generic_helpers.tosac
+++ b/pseudocode/library/generic_helpers.tosac
@@ -8,11 +8,20 @@
// by a licensing agreement from ARM Limited.
bool_t is_floating_point(type) {
- if (type == fp16_t || type == fp32_t || type == bf16_t)
+ if (type == fp16_t || type == fp32_t || type == bf16_t || type == fp8e4m3_t || type == fp8e5m2_t)
return true;
return false;
}
+bool_t is_saturating_float_type(type) {
+ // Saturate for the fp8 formats, all other floats do not saturate
+ if (type == fp8e4m3_t || type == fp8e5m2_t) {
+ return true;
+ }
+ return false;
+}
+
+
int32_t idiv(int32_t input1, int32_t input2) {
return input1 / input2; // Integer divide that truncates towards zero
}