aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/linear
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-08-14 17:31:49 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-06-23 07:46:40 +0200
commit0d19a077e74ce523f05b64708517bd657721a68e (patch)
tree7396d978a7a037f7b2c321253184a2074f9e2665 /validation/linear
parenta1219bf5f756925870671497a890e0aa1f0c7354 (diff)
downloadsparse-dev-0d19a077e74ce523f05b64708517bd657721a68e.tar.gz
cast: make pointer casts always size preserving
Currently casts to pointers can be done from any integer types. However, casts to (or from) pointers are only meaningful if value preserving and thus between objects of the same size. To avoid to have to worry about sign/zero extension while doing casts to pointers it's good to only have to deal with the value preserving ones. Do this by doing first, if needed, a cast an integer of the same size as a pointer before doing the cast to a pointer. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/linear')
-rw-r--r--validation/linear/cast-kinds.c62
1 files changed, 32 insertions, 30 deletions
diff --git a/validation/linear/cast-kinds.c b/validation/linear/cast-kinds.c
index 4449d0af..1742cd1e 100644
--- a/validation/linear/cast-kinds.c
+++ b/validation/linear/cast-kinds.c
@@ -288,106 +288,108 @@ iptr_2_vptr:
int_2_iptr:
.L66:
<entry-point>
- utptr.64 %r101 <- (32) %arg1
- ret.64 %r101
+ scast.64 %r101 <- (32) %arg1
+ utptr.64 %r102 <- (64) %r101
+ ret.64 %r102
uint_2_iptr:
.L68:
<entry-point>
- utptr.64 %r104 <- (32) %arg1
- ret.64 %r104
+ cast.64 %r105 <- (32) %arg1
+ utptr.64 %r106 <- (64) %r105
+ ret.64 %r106
long_2_iptr:
.L70:
<entry-point>
- utptr.64 %r107 <- (64) %arg1
- ret.64 %r107
+ utptr.64 %r109 <- (64) %arg1
+ ret.64 %r109
ulong_2_iptr:
.L72:
<entry-point>
- utptr.64 %r110 <- (64) %arg1
- ret.64 %r110
+ utptr.64 %r112 <- (64) %arg1
+ ret.64 %r112
vptr_2_iptr:
.L74:
<entry-point>
- ptrcast.64 %r113 <- (64) %arg1
- ret.64 %r113
+ ptrcast.64 %r115 <- (64) %arg1
+ ret.64 %r115
int_2_float:
.L76:
<entry-point>
- scvtf.32 %r116 <- (32) %arg1
- ret.32 %r116
+ scvtf.32 %r118 <- (32) %arg1
+ ret.32 %r118
uint_2_float:
.L78:
<entry-point>
- ucvtf.32 %r119 <- (32) %arg1
- ret.32 %r119
+ ucvtf.32 %r121 <- (32) %arg1
+ ret.32 %r121
long_2_float:
.L80:
<entry-point>
- scvtf.32 %r122 <- (64) %arg1
- ret.32 %r122
+ scvtf.32 %r124 <- (64) %arg1
+ ret.32 %r124
ulong_2_float:
.L82:
<entry-point>
- ucvtf.32 %r125 <- (64) %arg1
- ret.32 %r125
+ ucvtf.32 %r127 <- (64) %arg1
+ ret.32 %r127
double_2_float:
.L84:
<entry-point>
- fcvtf.32 %r128 <- (64) %arg1
- ret.32 %r128
+ fcvtf.32 %r130 <- (64) %arg1
+ ret.32 %r130
int_2_double:
.L86:
<entry-point>
- scvtf.64 %r131 <- (32) %arg1
- ret.64 %r131
+ scvtf.64 %r133 <- (32) %arg1
+ ret.64 %r133
uint_2_double:
.L88:
<entry-point>
- ucvtf.64 %r134 <- (32) %arg1
- ret.64 %r134
+ ucvtf.64 %r136 <- (32) %arg1
+ ret.64 %r136
long_2_double:
.L90:
<entry-point>
- scvtf.64 %r137 <- (64) %arg1
- ret.64 %r137
+ scvtf.64 %r139 <- (64) %arg1
+ ret.64 %r139
ulong_2_double:
.L92:
<entry-point>
- ucvtf.64 %r140 <- (64) %arg1
- ret.64 %r140
+ ucvtf.64 %r142 <- (64) %arg1
+ ret.64 %r142
float_2_double:
.L94:
<entry-point>
- fcvtf.64 %r143 <- (32) %arg1
- ret.64 %r143
+ fcvtf.64 %r145 <- (32) %arg1
+ ret.64 %r145
float_2_float: