aboutsummaryrefslogtreecommitdiff
path: root/pseudocode/operators/CAST.tosac
diff options
context:
space:
mode:
authorKevin Petit <kevin.petit@arm.com>2024-02-08 11:03:29 +0000
committerKevin Petit <kevin.petit@arm.com>2024-02-23 18:33:47 +0000
commit0635552aed54eee35ca417901b65754a07a12dae (patch)
tree55cdac9a1bdb2edd1ad862ae8976698bdb7bbb3a /pseudocode/operators/CAST.tosac
parentd2ca22c2af5e5a9c6c7279d0578c2b1f9620d5df (diff)
downloadspecification-0635552aed54eee35ca417901b65754a07a12dae.tar.gz
pseudocode: replace calls to non-existent functions
... with the correct libary functions. Change-Id: I99c252629d27be3977852a422774bc0be94922b3 Signed-off-by: Kevin Petit <kevin.petit@arm.com>
Diffstat (limited to 'pseudocode/operators/CAST.tosac')
-rw-r--r--pseudocode/operators/CAST.tosac6
1 files changed, 3 insertions, 3 deletions
diff --git a/pseudocode/operators/CAST.tosac b/pseudocode/operators/CAST.tosac
index fd3ce72..4e2dca3 100644
--- a/pseudocode/operators/CAST.tosac
+++ b/pseudocode/operators/CAST.tosac
@@ -12,7 +12,7 @@ for_each(index in shape) {
out_t out;
if (out_t == bool_t) {
out = (in != 0) ? true : false;
- } else if (is_floating_point_type<out_t>()) {
+ } else if (is_floating_point<out_t>()) {
// Conversion to float cases
if (in_t == bool_t) {
out = (in) ? 1.0 : 0.0;
@@ -26,8 +26,8 @@ for_each(index in shape) {
// Conversion to integer cases
if (in_t == bool_t) {
out = (in) ? 1 : 0;
- } else if (is_floating_point_type<in_t>()) {
- out = truncate<out_t>(apply_clip_s<i32_t>(round_to_nearest_int(in), minimum<out_t>, maximum<out_t>));
+ } else if (is_floating_point<in_t>()) {
+ out = truncate<out_t>(apply_clip_s<i32_t>(round_to_nearest_int(in), minimum_s<out_t>(), maximum_s<out_t>()));
} else if (sizeof(out_t) >= sizeof(in_t)) {
out = sign_extend<out_t>(in);
} else {