aboutsummaryrefslogtreecommitdiff
path: root/pseudocode/library/numeric_conversion_helpers.tosac
diff options
context:
space:
mode:
authorKevin Petit <kevin.petit@arm.com>2024-02-08 11:03:26 +0000
committerKevin Petit <kevin.petit@arm.com>2024-02-15 10:14:44 +0000
commit667e62897a809ab3af832e7778139d3869532277 (patch)
tree1d8faf7336ca9335792f76becf19d9b20b33d82a /pseudocode/library/numeric_conversion_helpers.tosac
parent1f05883799957300ea88d7ec314a5897e6c0ccb1 (diff)
downloadspecification-667e62897a809ab3af832e7778139d3869532277.tar.gz
pseudocode: use function declaration syntax for library functions that are not defined
Also: - Add missing semicolon - Fix prototype for is_floating_point to use template syntax Change-Id: I9ec1c687a3854b73ddac78f4db0db8e10f4e10e6 Signed-off-by: Kevin Petit <kevin.petit@arm.com>
Diffstat (limited to 'pseudocode/library/numeric_conversion_helpers.tosac')
-rw-r--r--pseudocode/library/numeric_conversion_helpers.tosac40
1 files changed, 20 insertions, 20 deletions
diff --git a/pseudocode/library/numeric_conversion_helpers.tosac b/pseudocode/library/numeric_conversion_helpers.tosac
index 576351f..0073a66 100644
--- a/pseudocode/library/numeric_conversion_helpers.tosac
+++ b/pseudocode/library/numeric_conversion_helpers.tosac
@@ -7,28 +7,28 @@
// copies and copies may only be made to the extent permitted
// by a licensing agreement from ARM Limited.
-int round_to_nearest_int(float_t f)
- Converts the floating-point value to f, with rounding to the nearest integer value.
- For the required precision see the section: Main inference precision requirements.
+// Converts the floating-point value to f, with rounding to the nearest integer value.
+// For the required precision see the section: Main inference precision requirements.
+int round_to_nearest_int(float_t f);
-float_t round_to_nearest_float_nonsaturating(in_t f)
- Converts the input value into floating-point, rounding to the nearest representable value.
- Values that are not NaN outside of the representable range of the destination type must be set to infinity of the correct sign.
- For the required precision see the section: Main inference precision requirements.
+// Converts the input value into floating-point, rounding to the nearest representable value.
+// Values that are not NaN outside of the representable range of the destination type must be set to infinity of the correct sign.
+// For the required precision see the section: Main inference precision requirements.
+float_t round_to_nearest_float_nonsaturating(in_t f);
-float_t round_to_nearest_float_saturating(in_t f)
- Converts the input value into floating-point, rounding to the nearest representable normal value.
- Values that are not NaN outside of the representable range must return the maximum representable normal value of the correct sign.
- For the required precision see the section: Main inference precision requirements.
+// Converts the input value into floating-point, rounding to the nearest representable normal value.
+// Values that are not NaN outside of the representable range must return the maximum representable normal value of the correct sign.
+// For the required precision see the section: Main inference precision requirements.
+float_t round_to_nearest_float_saturating(in_t f);
-out_t sign_extend<out_t>(in_t input)
- Floating point values are unchanged.
- For two's complement integer values where out_t has more bits than in_t, replicate the top bit of input for all bits between the top bit of input and the top bit of output.
+// Floating point values are unchanged.
+// For two's complement integer values where out_t has more bits than in_t, replicate the top bit of input for all bits between the top bit of input and the top bit of output.
+out_t sign_extend<out_t>(in_t input);
-out_t zero_extend<out_t>(in_t input)
- Floating point values are unchanged.
- For two's complement integer values where out_t has more bits than in_t, insert zero values for all bits between the top bit of input and the top bit of output.
+// Floating point values are unchanged.
+// For two's complement integer values where out_t has more bits than in_t, insert zero values for all bits between the top bit of input and the top bit of output.
+out_t zero_extend<out_t>(in_t input);
-out_t truncate(in_t input)
- output is the sizeof(out_t) least significant bits in input.
- Nop for floating-point types
+// output is the sizeof(out_t) least significant bits in input.
+// Nop for floating-point types
+out_t truncate(in_t input);