aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/linear/cast-kinds.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-08-14 15:05:24 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-06-23 07:46:40 +0200
commit52856c815a191b73530557133bd44ec478f3fece (patch)
tree453cf39d9723ab4435b4d7b871317b502d4e8058 /validation/linear/cast-kinds.c
parent55cac5336b14524ebc371bcee006e2b497d84c5f (diff)
downloadsparse-dev-52856c815a191b73530557133bd44ec478f3fece.tar.gz
cast: specialize floats to integer conversion
Currently, casts from floats to integers are processed like integers (or any other type) to integers. This is simple but rather unconvenient as it correspond to different operations that obeys to different rules and which later need extra checks. Change this by directly using specific instructions: - FCVTU for floats to unsigned integers - FCVTS for floats to signed integers Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/linear/cast-kinds.c')
-rw-r--r--validation/linear/cast-kinds.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/validation/linear/cast-kinds.c b/validation/linear/cast-kinds.c
index 5944610c..d07a9419 100644
--- a/validation/linear/cast-kinds.c
+++ b/validation/linear/cast-kinds.c
@@ -95,14 +95,14 @@ iptr_2_int:
float_2_int:
.L10:
<entry-point>
- cast.32 %r17 <- (32) %arg1
+ fcvts.32 %r17 <- (32) %arg1
ret.32 %r17
double_2_int:
.L12:
<entry-point>
- cast.32 %r20 <- (64) %arg1
+ fcvts.32 %r20 <- (64) %arg1
ret.32 %r20
@@ -143,14 +143,14 @@ iptr_2_uint:
float_2_uint:
.L24:
<entry-point>
- cast.32 %r38 <- (32) %arg1
+ fcvtu.32 %r38 <- (32) %arg1
ret.32 %r38
double_2_uint:
.L26:
<entry-point>
- cast.32 %r41 <- (64) %arg1
+ fcvtu.32 %r41 <- (64) %arg1
ret.32 %r41
@@ -191,14 +191,14 @@ iptr_2_long:
float_2_long:
.L38:
<entry-point>
- cast.64 %r59 <- (32) %arg1
+ fcvts.64 %r59 <- (32) %arg1
ret.64 %r59
double_2_long:
.L40:
<entry-point>
- cast.64 %r62 <- (64) %arg1
+ fcvts.64 %r62 <- (64) %arg1
ret.64 %r62
@@ -239,14 +239,14 @@ iptr_2_ulong:
float_2_ulong:
.L52:
<entry-point>
- cast.64 %r80 <- (32) %arg1
+ fcvtu.64 %r80 <- (32) %arg1
ret.64 %r80
double_2_ulong:
.L54:
<entry-point>
- cast.64 %r83 <- (64) %arg1
+ fcvtu.64 %r83 <- (64) %arg1
ret.64 %r83