aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
Diffstat (limited to 'validation')
-rw-r--r--validation/bitfield-size.c5
-rw-r--r--validation/builtin-bswap-variable.c4
-rw-r--r--validation/cast-kinds-check.c5
-rw-r--r--validation/cast-weirds.c8
-rw-r--r--validation/compound-assign-type.c3
-rw-r--r--validation/expand/builtin-expect.c8
-rw-r--r--validation/linear/bitfield-init-zero.c8
-rw-r--r--validation/linear/bool-cast.c2
-rw-r--r--validation/linear/call-basic.c2
-rw-r--r--validation/linear/cast-kinds.c179
-rw-r--r--validation/linear/cast-volatile.c5
-rw-r--r--validation/optim/bool-simplify.c4
-rw-r--r--validation/optim/canonical-cmp.c72
-rw-r--r--validation/optim/kill-casts.c2
14 files changed, 151 insertions, 156 deletions
diff --git a/validation/bitfield-size.c b/validation/bitfield-size.c
index b027cbd5..a39c3966 100644
--- a/validation/bitfield-size.c
+++ b/validation/bitfield-size.c
@@ -35,7 +35,8 @@ unsigned int get_pbfi_b(struct bfi *bf) { return bf->b; }
* check-command: test-linearize -Wno-decl $file
* check-output-ignore
*
- * check-output-pattern(24): cast\\.
- * check-output-pattern(12): cast\\.4
+ * check-output-pattern(8): zext\\.
+ * check-output-pattern(4): sext\\.
+ * check-output-pattern(12): trunc\\.4
* check-output-pattern(6): lsr\\..*\\$6
*/
diff --git a/validation/builtin-bswap-variable.c b/validation/builtin-bswap-variable.c
index 738ba2a4..40ad6413 100644
--- a/validation/builtin-bswap-variable.c
+++ b/validation/builtin-bswap-variable.c
@@ -25,8 +25,8 @@ static u64 swap64v(u32 a)
*
* check-output-ignore
* check-output-contains:call.16 .* __builtin_bswap16
- * check-output-contains:cast.32 .* (64) %arg1
+ * check-output-contains:trunc.32 .* (64) %arg1
* check-output-contains:call.32 .* __builtin_bswap32
- * check-output-contains:cast.64 .* (32) %arg1
+ * check-output-contains:zext.64 .* (32) %arg1
* check-output-contains:call.64 .* __builtin_bswap64
*/
diff --git a/validation/cast-kinds-check.c b/validation/cast-kinds-check.c
index 48b1306d..0fe705f5 100644
--- a/validation/cast-kinds-check.c
+++ b/validation/cast-kinds-check.c
@@ -13,11 +13,6 @@ linear/cast-kinds.c:12:48: warning: cast drops bits
linear/cast-kinds.c:13:50: warning: cast drops bits
linear/cast-kinds.c:14:49: warning: cast drops bits
linear/cast-kinds.c:15:48: warning: cast drops bits
-linear/cast-kinds.c:21:49: warning: cast wasn't removed
-linear/cast-kinds.c:28:52: warning: cast wasn't removed
-linear/cast-kinds.c:34:52: warning: cast wasn't removed
-linear/cast-kinds.c:35:54: warning: cast wasn't removed
-linear/cast-kinds.c:36:52: warning: cast wasn't removed
linear/cast-kinds.c:37:42: warning: non size-preserving integer to pointer cast
linear/cast-kinds.c:38:44: warning: non size-preserving integer to pointer cast
* check-error-end
diff --git a/validation/cast-weirds.c b/validation/cast-weirds.c
index 71e52ff5..a99c65d2 100644
--- a/validation/cast-weirds.c
+++ b/validation/cast-weirds.c
@@ -20,7 +20,7 @@ cast-weirds.c:5:44: warning: non size-preserving integer to pointer cast
int_2_iptr:
.L0:
<entry-point>
- scast.64 %r2 <- (32) %arg1
+ sext.64 %r2 <- (32) %arg1
utptr.64 %r3 <- (64) %r2
ret.64 %r3
@@ -28,7 +28,7 @@ int_2_iptr:
uint_2_iptr:
.L2:
<entry-point>
- cast.64 %r6 <- (32) %arg1
+ zext.64 %r6 <- (32) %arg1
utptr.64 %r7 <- (64) %r6
ret.64 %r7
@@ -36,14 +36,14 @@ uint_2_iptr:
int_2_vptr:
.L4:
<entry-point>
- scast.64 %r10 <- (32) %arg1
+ sext.64 %r10 <- (32) %arg1
ret.64 %r10
uint_2_vptr:
.L6:
<entry-point>
- cast.64 %r13 <- (32) %arg1
+ zext.64 %r13 <- (32) %arg1
ret.64 %r13
diff --git a/validation/compound-assign-type.c b/validation/compound-assign-type.c
index 450fa26d..e13dcfcd 100644
--- a/validation/compound-assign-type.c
+++ b/validation/compound-assign-type.c
@@ -11,5 +11,6 @@ static unsigned int foo(unsigned int x, long a)
*
* check-output-excludes: divu\\.32
* check-output-contains: divs\\.64
- * check-output-contains: scast\\.32
+ * check-output-contains: zext.64 .* (32) %arg1
+ * check-output-contains: trunc.32 .* (64)
*/
diff --git a/validation/expand/builtin-expect.c b/validation/expand/builtin-expect.c
index a80176a5..77f714ef 100644
--- a/validation/expand/builtin-expect.c
+++ b/validation/expand/builtin-expect.c
@@ -41,7 +41,7 @@ void *fptr(void *a)
flia:
.L0:
<entry-point>
- scast.32 %r2 <- (64) %arg1
+ trunc.32 %r2 <- (64) %arg1
ret.32 %r2
@@ -54,7 +54,7 @@ flic:
fila:
.L4:
<entry-point>
- scast.64 %r6 <- (32) %arg1
+ sext.64 %r6 <- (32) %arg1
ret.64 %r6
@@ -79,9 +79,7 @@ fils:
fptr:
.L12:
<entry-point>
- cast.64 %r12 <- (64) %arg1
- scast.64 %r13 <- (64) %r12
- ret.64 %r13
+ ret.64 %arg1
* check-output-end
diff --git a/validation/linear/bitfield-init-zero.c b/validation/linear/bitfield-init-zero.c
index 39a64345..7a410a7c 100644
--- a/validation/linear/bitfield-init-zero.c
+++ b/validation/linear/bitfield-init-zero.c
@@ -57,7 +57,7 @@ int bfs_get0(void)
bfuu_init:
.L0:
<entry-point>
- cast.9 %r2 <- (32) %arg1
+ trunc.9 %r2 <- (32) %arg1
shl.32 %r4 <- %r2, $11
ret.32 %r4
@@ -65,7 +65,7 @@ bfuu_init:
bfus_init:
.L2:
<entry-point>
- scast.9 %r10 <- (32) %arg1
+ trunc.9 %r10 <- (32) %arg1
shl.32 %r12 <- %r10, $11
ret.32 %r12
@@ -79,7 +79,7 @@ bfu_get0:
bfsu_init:
.L6:
<entry-point>
- cast.9 %r23 <- (32) %arg1
+ trunc.9 %r23 <- (32) %arg1
shl.32 %r25 <- %r23, $11
ret.32 %r25
@@ -87,7 +87,7 @@ bfsu_init:
bfss_init:
.L8:
<entry-point>
- scast.9 %r31 <- (32) %arg1
+ trunc.9 %r31 <- (32) %arg1
shl.32 %r33 <- %r31, $11
ret.32 %r33
diff --git a/validation/linear/bool-cast.c b/validation/linear/bool-cast.c
index 43276a46..0438a94f 100644
--- a/validation/linear/bool-cast.c
+++ b/validation/linear/bool-cast.c
@@ -29,6 +29,8 @@ static _Bool fdbl_e(dbl a) { return (_Bool)a; }
* check-output-excludes: cast\\.
* check-output-excludes: fcvt[us]\\.
* check-output-excludes: ptrtu\\.
+ * check-output-excludes: [sz]ext\\.
+ * check-output-excludes: trunc\\.
* check-output-pattern(12): setne\\.
* check-output-pattern(2): fcmpune\\.
*/
diff --git a/validation/linear/call-basic.c b/validation/linear/call-basic.c
index 46eab108..3822a267 100644
--- a/validation/linear/call-basic.c
+++ b/validation/linear/call-basic.c
@@ -49,7 +49,7 @@ pointer1:
builtin:
.L6:
<entry-point>
- call.32 %r11 <- __builtin_popcount, %arg1
+ call.32 %r10 <- __builtin_popcount, %arg1
ret
diff --git a/validation/linear/cast-kinds.c b/validation/linear/cast-kinds.c
index 8e3e21a7..5df307bc 100644
--- a/validation/linear/cast-kinds.c
+++ b/validation/linear/cast-kinds.c
@@ -67,44 +67,44 @@ uint_2_int:
long_2_int:
.L2:
<entry-point>
- scast.32 %r5 <- (64) %arg1
- ret.32 %r5
+ trunc.32 %r4 <- (64) %arg1
+ ret.32 %r4
ulong_2_int:
.L4:
<entry-point>
- cast.32 %r8 <- (64) %arg1
- ret.32 %r8
+ trunc.32 %r7 <- (64) %arg1
+ ret.32 %r7
vptr_2_int:
.L6:
<entry-point>
- cast.32 %r11 <- (64) %arg1
- ret.32 %r11
+ trunc.32 %r10 <- (64) %arg1
+ ret.32 %r10
iptr_2_int:
.L8:
<entry-point>
- ptrtu.64 %r14 <- (64) %arg1
- cast.32 %r15 <- (64) %r14
- ret.32 %r15
+ ptrtu.64 %r13 <- (64) %arg1
+ trunc.32 %r14 <- (64) %r13
+ ret.32 %r14
float_2_int:
.L10:
<entry-point>
- fcvts.32 %r18 <- (32) %arg1
- ret.32 %r18
+ fcvts.32 %r17 <- (32) %arg1
+ ret.32 %r17
double_2_int:
.L12:
<entry-point>
- fcvts.32 %r21 <- (64) %arg1
- ret.32 %r21
+ fcvts.32 %r20 <- (64) %arg1
+ ret.32 %r20
int_2_uint:
@@ -116,58 +116,58 @@ int_2_uint:
long_2_uint:
.L16:
<entry-point>
- scast.32 %r27 <- (64) %arg1
- ret.32 %r27
+ trunc.32 %r25 <- (64) %arg1
+ ret.32 %r25
ulong_2_uint:
.L18:
<entry-point>
- cast.32 %r30 <- (64) %arg1
- ret.32 %r30
+ trunc.32 %r28 <- (64) %arg1
+ ret.32 %r28
vptr_2_uint:
.L20:
<entry-point>
- cast.32 %r33 <- (64) %arg1
- ret.32 %r33
+ trunc.32 %r31 <- (64) %arg1
+ ret.32 %r31
iptr_2_uint:
.L22:
<entry-point>
- ptrtu.64 %r36 <- (64) %arg1
- cast.32 %r37 <- (64) %r36
- ret.32 %r37
+ ptrtu.64 %r34 <- (64) %arg1
+ trunc.32 %r35 <- (64) %r34
+ ret.32 %r35
float_2_uint:
.L24:
<entry-point>
- fcvtu.32 %r40 <- (32) %arg1
- ret.32 %r40
+ fcvtu.32 %r38 <- (32) %arg1
+ ret.32 %r38
double_2_uint:
.L26:
<entry-point>
- fcvtu.32 %r43 <- (64) %arg1
- ret.32 %r43
+ fcvtu.32 %r41 <- (64) %arg1
+ ret.32 %r41
int_2_long:
.L28:
<entry-point>
- scast.64 %r46 <- (32) %arg1
- ret.64 %r46
+ sext.64 %r44 <- (32) %arg1
+ ret.64 %r44
uint_2_long:
.L30:
<entry-point>
- cast.64 %r49 <- (32) %arg1
- ret.64 %r49
+ zext.64 %r47 <- (32) %arg1
+ ret.64 %r47
ulong_2_long:
@@ -179,43 +179,42 @@ ulong_2_long:
vptr_2_long:
.L34:
<entry-point>
- cast.64 %r55 <- (64) %arg1
- ret.64 %r55
+ ret.64 %arg1
iptr_2_long:
.L36:
<entry-point>
- ptrtu.64 %r58 <- (64) %arg1
- ret.64 %r58
+ ptrtu.64 %r54 <- (64) %arg1
+ ret.64 %r54
float_2_long:
.L38:
<entry-point>
- fcvts.64 %r61 <- (32) %arg1
- ret.64 %r61
+ fcvts.64 %r57 <- (32) %arg1
+ ret.64 %r57
double_2_long:
.L40:
<entry-point>
- fcvts.64 %r64 <- (64) %arg1
- ret.64 %r64
+ fcvts.64 %r60 <- (64) %arg1
+ ret.64 %r60
int_2_ulong:
.L42:
<entry-point>
- scast.64 %r67 <- (32) %arg1
- ret.64 %r67
+ sext.64 %r63 <- (32) %arg1
+ ret.64 %r63
uint_2_ulong:
.L44:
<entry-point>
- cast.64 %r70 <- (32) %arg1
- ret.64 %r70
+ zext.64 %r66 <- (32) %arg1
+ ret.64 %r66
long_2_ulong:
@@ -227,171 +226,167 @@ long_2_ulong:
vptr_2_ulong:
.L48:
<entry-point>
- cast.64 %r76 <- (64) %arg1
- ret.64 %r76
+ ret.64 %arg1
iptr_2_ulong:
.L50:
<entry-point>
- ptrtu.64 %r79 <- (64) %arg1
- ret.64 %r79
+ ptrtu.64 %r73 <- (64) %arg1
+ ret.64 %r73
float_2_ulong:
.L52:
<entry-point>
- fcvtu.64 %r82 <- (32) %arg1
- ret.64 %r82
+ fcvtu.64 %r76 <- (32) %arg1
+ ret.64 %r76
double_2_ulong:
.L54:
<entry-point>
- fcvtu.64 %r85 <- (64) %arg1
- ret.64 %r85
+ fcvtu.64 %r79 <- (64) %arg1
+ ret.64 %r79
int_2_vptr:
.L56:
<entry-point>
- scast.64 %r88 <- (32) %arg1
- ret.64 %r88
+ sext.64 %r82 <- (32) %arg1
+ ret.64 %r82
uint_2_vptr:
.L58:
<entry-point>
- cast.64 %r91 <- (32) %arg1
- ret.64 %r91
+ zext.64 %r85 <- (32) %arg1
+ ret.64 %r85
long_2_vptr:
.L60:
<entry-point>
- scast.64 %r94 <- (64) %arg1
- ret.64 %r94
+ ret.64 %arg1
ulong_2_vptr:
.L62:
<entry-point>
- cast.64 %r97 <- (64) %arg1
- ret.64 %r97
+ ret.64 %arg1
iptr_2_vptr:
.L64:
<entry-point>
- cast.64 %r100 <- (64) %arg1
- ret.64 %r100
+ ret.64 %arg1
int_2_iptr:
.L66:
<entry-point>
- scast.64 %r103 <- (32) %arg1
- utptr.64 %r104 <- (64) %r103
- ret.64 %r104
+ sext.64 %r94 <- (32) %arg1
+ utptr.64 %r95 <- (64) %r94
+ ret.64 %r95
uint_2_iptr:
.L68:
<entry-point>
- cast.64 %r107 <- (32) %arg1
- utptr.64 %r108 <- (64) %r107
- ret.64 %r108
+ zext.64 %r98 <- (32) %arg1
+ utptr.64 %r99 <- (64) %r98
+ ret.64 %r99
long_2_iptr:
.L70:
<entry-point>
- utptr.64 %r111 <- (64) %arg1
- ret.64 %r111
+ utptr.64 %r102 <- (64) %arg1
+ ret.64 %r102
ulong_2_iptr:
.L72:
<entry-point>
- utptr.64 %r114 <- (64) %arg1
- ret.64 %r114
+ utptr.64 %r105 <- (64) %arg1
+ ret.64 %r105
vptr_2_iptr:
.L74:
<entry-point>
- ptrcast.64 %r117 <- (64) %arg1
- ret.64 %r117
+ ptrcast.64 %r108 <- (64) %arg1
+ ret.64 %r108
int_2_float:
.L76:
<entry-point>
- scvtf.32 %r120 <- (32) %arg1
- ret.32 %r120
+ scvtf.32 %r111 <- (32) %arg1
+ ret.32 %r111
uint_2_float:
.L78:
<entry-point>
- ucvtf.32 %r123 <- (32) %arg1
- ret.32 %r123
+ ucvtf.32 %r114 <- (32) %arg1
+ ret.32 %r114
long_2_float:
.L80:
<entry-point>
- scvtf.32 %r126 <- (64) %arg1
- ret.32 %r126
+ scvtf.32 %r117 <- (64) %arg1
+ ret.32 %r117
ulong_2_float:
.L82:
<entry-point>
- ucvtf.32 %r129 <- (64) %arg1
- ret.32 %r129
+ ucvtf.32 %r120 <- (64) %arg1
+ ret.32 %r120
double_2_float:
.L84:
<entry-point>
- fcvtf.32 %r132 <- (64) %arg1
- ret.32 %r132
+ fcvtf.32 %r123 <- (64) %arg1
+ ret.32 %r123
int_2_double:
.L86:
<entry-point>
- scvtf.64 %r135 <- (32) %arg1
- ret.64 %r135
+ scvtf.64 %r126 <- (32) %arg1
+ ret.64 %r126
uint_2_double:
.L88:
<entry-point>
- ucvtf.64 %r138 <- (32) %arg1
- ret.64 %r138
+ ucvtf.64 %r129 <- (32) %arg1
+ ret.64 %r129
long_2_double:
.L90:
<entry-point>
- scvtf.64 %r141 <- (64) %arg1
- ret.64 %r141
+ scvtf.64 %r132 <- (64) %arg1
+ ret.64 %r132
ulong_2_double:
.L92:
<entry-point>
- ucvtf.64 %r144 <- (64) %arg1
- ret.64 %r144
+ ucvtf.64 %r135 <- (64) %arg1
+ ret.64 %r135
float_2_double:
.L94:
<entry-point>
- fcvtf.64 %r147 <- (32) %arg1
- ret.64 %r147
+ fcvtf.64 %r138 <- (32) %arg1
+ ret.64 %r138
float_2_float:
diff --git a/validation/linear/cast-volatile.c b/validation/linear/cast-volatile.c
index f8a64937..6d12c015 100644
--- a/validation/linear/cast-volatile.c
+++ b/validation/linear/cast-volatile.c
@@ -8,7 +8,8 @@ static int foo(volatile int *a, int v)
* check-name: cast-volatile
* check-command: test-linearize -fdump-ir=linearize $file
*
- * check-known-to-fail
* check-output-ignore
- * check-output-excludes: scast\\.
+ * check-output-excludes: sext\\.
+ * check-output-excludes: zext\\.
+ * check-output-excludes: trunc\\.
*/
diff --git a/validation/optim/bool-simplify.c b/validation/optim/bool-simplify.c
index 05be1149..5b3cf449 100644
--- a/validation/optim/bool-simplify.c
+++ b/validation/optim/bool-simplify.c
@@ -33,7 +33,7 @@ and_1:
.L2:
<entry-point>
setne.1 %r8 <- %arg1, $0
- cast.32 %r11 <- (1) %r8
+ zext.32 %r11 <- (1) %r8
ret.32 %r11
@@ -41,7 +41,7 @@ or_0:
.L4:
<entry-point>
setne.1 %r14 <- %arg1, $0
- cast.32 %r17 <- (1) %r14
+ zext.32 %r17 <- (1) %r14
ret.32 %r17
diff --git a/validation/optim/canonical-cmp.c b/validation/optim/canonical-cmp.c
index 0fc531e9..e0ca7db3 100644
--- a/validation/optim/canonical-cmp.c
+++ b/validation/optim/canonical-cmp.c
@@ -27,97 +27,97 @@ uint uat(uint p, uint a) { return (123 < p) ? a : 0; }
seq:
.L0:
<entry-point>
- seteq.32 %r4 <- %arg1, $123
- select.32 %r5 <- %r4, %arg2, $0
- ret.32 %r5
+ seteq.32 %r3 <- %arg1, $123
+ select.32 %r4 <- %r3, %arg2, $0
+ ret.32 %r4
sne:
.L2:
<entry-point>
- setne.32 %r11 <- %arg1, $123
- select.32 %r12 <- %r11, %arg2, $0
- ret.32 %r12
+ setne.32 %r8 <- %arg1, $123
+ select.32 %r9 <- %r8, %arg2, $0
+ ret.32 %r9
slt:
.L4:
<entry-point>
- setlt.32 %r18 <- %arg1, $123
- select.32 %r19 <- %r18, %arg2, $0
- ret.32 %r19
+ setlt.32 %r13 <- %arg1, $123
+ select.32 %r14 <- %r13, %arg2, $0
+ ret.32 %r14
sle:
.L6:
<entry-point>
- setle.32 %r25 <- %arg1, $123
- select.32 %r26 <- %r25, %arg2, $0
- ret.32 %r26
+ setle.32 %r18 <- %arg1, $123
+ select.32 %r19 <- %r18, %arg2, $0
+ ret.32 %r19
sge:
.L8:
<entry-point>
- setge.32 %r32 <- %arg1, $123
- select.32 %r33 <- %r32, %arg2, $0
- ret.32 %r33
+ setge.32 %r23 <- %arg1, $123
+ select.32 %r24 <- %r23, %arg2, $0
+ ret.32 %r24
sgt:
.L10:
<entry-point>
- setgt.32 %r39 <- %arg1, $123
- select.32 %r40 <- %r39, %arg2, $0
- ret.32 %r40
+ setgt.32 %r28 <- %arg1, $123
+ select.32 %r29 <- %r28, %arg2, $0
+ ret.32 %r29
ueq:
.L12:
<entry-point>
- seteq.32 %r45 <- %arg1, $123
- select.32 %r46 <- %r45, %arg2, $0
- ret.32 %r46
+ seteq.32 %r33 <- %arg1, $123
+ select.32 %r34 <- %r33, %arg2, $0
+ ret.32 %r34
une:
.L14:
<entry-point>
- setne.32 %r50 <- %arg1, $123
- select.32 %r51 <- %r50, %arg2, $0
- ret.32 %r51
+ setne.32 %r38 <- %arg1, $123
+ select.32 %r39 <- %r38, %arg2, $0
+ ret.32 %r39
ubt:
.L16:
<entry-point>
- setb.32 %r55 <- %arg1, $123
- select.32 %r56 <- %r55, %arg2, $0
- ret.32 %r56
+ setb.32 %r43 <- %arg1, $123
+ select.32 %r44 <- %r43, %arg2, $0
+ ret.32 %r44
ube:
.L18:
<entry-point>
- setbe.32 %r60 <- %arg1, $123
- select.32 %r61 <- %r60, %arg2, $0
- ret.32 %r61
+ setbe.32 %r48 <- %arg1, $123
+ select.32 %r49 <- %r48, %arg2, $0
+ ret.32 %r49
uae:
.L20:
<entry-point>
- setae.32 %r65 <- %arg1, $123
- select.32 %r66 <- %r65, %arg2, $0
- ret.32 %r66
+ setae.32 %r53 <- %arg1, $123
+ select.32 %r54 <- %r53, %arg2, $0
+ ret.32 %r54
uat:
.L22:
<entry-point>
- seta.32 %r70 <- %arg1, $123
- select.32 %r71 <- %r70, %arg2, $0
- ret.32 %r71
+ seta.32 %r58 <- %arg1, $123
+ select.32 %r59 <- %r58, %arg2, $0
+ ret.32 %r59
* check-output-end
diff --git a/validation/optim/kill-casts.c b/validation/optim/kill-casts.c
index 140b8d20..2aa53fda 100644
--- a/validation/optim/kill-casts.c
+++ b/validation/optim/kill-casts.c
@@ -22,4 +22,6 @@ void foo(struct s *x)
* check-output-excludes: fcvt[us]\\.
* check-output-excludes: utptr\\.
* check-output-excludes: ptrtu\\.
+ * check-output-excludes: [sz]ext\\.
+ * check-output-excludes: trunc\\.
*/