1
1
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2
2
; RUN: llc -mtriple=riscv64 -mattr=+d -verify-machineinstrs -target-abi=lp64d \
3
3
; RUN: -disable-strictnode-mutation < %s | FileCheck %s -check-prefix=RV64ID
4
+ ; RUN: llc -mtriple=riscv64 -mattr=+zdinx -verify-machineinstrs -target-abi=lp64 \
5
+ ; RUN: -disable-strictnode-mutation < %s | FileCheck %s -check-prefix=RV64IDINX
4
6
5
7
; This file exhaustively checks double<->i32 conversions. In general,
6
8
; fcvt.l[u].d can be selected instead of fcvt.w[u].d because poison is
@@ -12,6 +14,11 @@ define i32 @aext_fptosi(double %a) nounwind strictfp {
12
14
; RV64ID: # %bb.0:
13
15
; RV64ID-NEXT: fcvt.w.d a0, fa0, rtz
14
16
; RV64ID-NEXT: ret
17
+ ;
18
+ ; RV64IDINX-LABEL: aext_fptosi:
19
+ ; RV64IDINX: # %bb.0:
20
+ ; RV64IDINX-NEXT: fcvt.w.d a0, a0, rtz
21
+ ; RV64IDINX-NEXT: ret
15
22
%1 = call i32 @llvm.experimental.constrained.fptosi.i32.f64 (double %a , metadata !"fpexcept.strict" ) strictfp
16
23
ret i32 %1
17
24
}
@@ -22,6 +29,11 @@ define signext i32 @sext_fptosi(double %a) nounwind strictfp {
22
29
; RV64ID: # %bb.0:
23
30
; RV64ID-NEXT: fcvt.w.d a0, fa0, rtz
24
31
; RV64ID-NEXT: ret
32
+ ;
33
+ ; RV64IDINX-LABEL: sext_fptosi:
34
+ ; RV64IDINX: # %bb.0:
35
+ ; RV64IDINX-NEXT: fcvt.w.d a0, a0, rtz
36
+ ; RV64IDINX-NEXT: ret
25
37
%1 = call i32 @llvm.experimental.constrained.fptosi.i32.f64 (double %a , metadata !"fpexcept.strict" ) strictfp
26
38
ret i32 %1
27
39
}
@@ -33,6 +45,13 @@ define zeroext i32 @zext_fptosi(double %a) nounwind strictfp {
33
45
; RV64ID-NEXT: slli a0, a0, 32
34
46
; RV64ID-NEXT: srli a0, a0, 32
35
47
; RV64ID-NEXT: ret
48
+ ;
49
+ ; RV64IDINX-LABEL: zext_fptosi:
50
+ ; RV64IDINX: # %bb.0:
51
+ ; RV64IDINX-NEXT: fcvt.w.d a0, a0, rtz
52
+ ; RV64IDINX-NEXT: slli a0, a0, 32
53
+ ; RV64IDINX-NEXT: srli a0, a0, 32
54
+ ; RV64IDINX-NEXT: ret
36
55
%1 = call i32 @llvm.experimental.constrained.fptosi.i32.f64 (double %a , metadata !"fpexcept.strict" ) strictfp
37
56
ret i32 %1
38
57
}
@@ -42,6 +61,11 @@ define i32 @aext_fptoui(double %a) nounwind strictfp {
42
61
; RV64ID: # %bb.0:
43
62
; RV64ID-NEXT: fcvt.wu.d a0, fa0, rtz
44
63
; RV64ID-NEXT: ret
64
+ ;
65
+ ; RV64IDINX-LABEL: aext_fptoui:
66
+ ; RV64IDINX: # %bb.0:
67
+ ; RV64IDINX-NEXT: fcvt.wu.d a0, a0, rtz
68
+ ; RV64IDINX-NEXT: ret
45
69
%1 = call i32 @llvm.experimental.constrained.fptoui.i32.f64 (double %a , metadata !"fpexcept.strict" ) strictfp
46
70
ret i32 %1
47
71
}
@@ -52,6 +76,11 @@ define signext i32 @sext_fptoui(double %a) nounwind strictfp {
52
76
; RV64ID: # %bb.0:
53
77
; RV64ID-NEXT: fcvt.wu.d a0, fa0, rtz
54
78
; RV64ID-NEXT: ret
79
+ ;
80
+ ; RV64IDINX-LABEL: sext_fptoui:
81
+ ; RV64IDINX: # %bb.0:
82
+ ; RV64IDINX-NEXT: fcvt.wu.d a0, a0, rtz
83
+ ; RV64IDINX-NEXT: ret
55
84
%1 = call i32 @llvm.experimental.constrained.fptoui.i32.f64 (double %a , metadata !"fpexcept.strict" ) strictfp
56
85
ret i32 %1
57
86
}
@@ -61,6 +90,11 @@ define zeroext i32 @zext_fptoui(double %a) nounwind strictfp {
61
90
; RV64ID: # %bb.0:
62
91
; RV64ID-NEXT: fcvt.lu.d a0, fa0, rtz
63
92
; RV64ID-NEXT: ret
93
+ ;
94
+ ; RV64IDINX-LABEL: zext_fptoui:
95
+ ; RV64IDINX: # %bb.0:
96
+ ; RV64IDINX-NEXT: fcvt.lu.d a0, a0, rtz
97
+ ; RV64IDINX-NEXT: ret
64
98
%1 = call i32 @llvm.experimental.constrained.fptoui.i32.f64 (double %a , metadata !"fpexcept.strict" ) strictfp
65
99
ret i32 %1
66
100
}
@@ -70,6 +104,11 @@ define double @uitofp_aext_i32_to_f64(i32 %a) nounwind strictfp {
70
104
; RV64ID: # %bb.0:
71
105
; RV64ID-NEXT: fcvt.d.wu fa0, a0
72
106
; RV64ID-NEXT: ret
107
+ ;
108
+ ; RV64IDINX-LABEL: uitofp_aext_i32_to_f64:
109
+ ; RV64IDINX: # %bb.0:
110
+ ; RV64IDINX-NEXT: fcvt.d.wu a0, a0
111
+ ; RV64IDINX-NEXT: ret
73
112
%1 = call double @llvm.experimental.constrained.uitofp.f64.i32 (i32 %a , metadata !"round.dynamic" , metadata !"fpexcept.strict" ) strictfp
74
113
ret double %1
75
114
}
@@ -80,6 +119,11 @@ define double @uitofp_sext_i32_to_f64(i32 signext %a) nounwind strictfp {
80
119
; RV64ID: # %bb.0:
81
120
; RV64ID-NEXT: fcvt.d.wu fa0, a0
82
121
; RV64ID-NEXT: ret
122
+ ;
123
+ ; RV64IDINX-LABEL: uitofp_sext_i32_to_f64:
124
+ ; RV64IDINX: # %bb.0:
125
+ ; RV64IDINX-NEXT: fcvt.d.wu a0, a0
126
+ ; RV64IDINX-NEXT: ret
83
127
%1 = call double @llvm.experimental.constrained.uitofp.f64.i32 (i32 %a , metadata !"round.dynamic" , metadata !"fpexcept.strict" ) strictfp
84
128
ret double %1
85
129
}
@@ -89,6 +133,11 @@ define double @uitofp_zext_i32_to_f64(i32 zeroext %a) nounwind strictfp {
89
133
; RV64ID: # %bb.0:
90
134
; RV64ID-NEXT: fcvt.d.wu fa0, a0
91
135
; RV64ID-NEXT: ret
136
+ ;
137
+ ; RV64IDINX-LABEL: uitofp_zext_i32_to_f64:
138
+ ; RV64IDINX: # %bb.0:
139
+ ; RV64IDINX-NEXT: fcvt.d.wu a0, a0
140
+ ; RV64IDINX-NEXT: ret
92
141
%1 = call double @llvm.experimental.constrained.uitofp.f64.i32 (i32 %a , metadata !"round.dynamic" , metadata !"fpexcept.strict" ) strictfp
93
142
ret double %1
94
143
}
@@ -98,6 +147,11 @@ define double @sitofp_aext_i32_to_f64(i32 %a) nounwind strictfp {
98
147
; RV64ID: # %bb.0:
99
148
; RV64ID-NEXT: fcvt.d.w fa0, a0
100
149
; RV64ID-NEXT: ret
150
+ ;
151
+ ; RV64IDINX-LABEL: sitofp_aext_i32_to_f64:
152
+ ; RV64IDINX: # %bb.0:
153
+ ; RV64IDINX-NEXT: fcvt.d.w a0, a0
154
+ ; RV64IDINX-NEXT: ret
101
155
%1 = call double @llvm.experimental.constrained.sitofp.f64.i32 (i32 %a , metadata !"round.dynamic" , metadata !"fpexcept.strict" ) strictfp
102
156
ret double %1
103
157
}
@@ -108,6 +162,11 @@ define double @sitofp_sext_i32_to_f64(i32 signext %a) nounwind strictfp {
108
162
; RV64ID: # %bb.0:
109
163
; RV64ID-NEXT: fcvt.d.w fa0, a0
110
164
; RV64ID-NEXT: ret
165
+ ;
166
+ ; RV64IDINX-LABEL: sitofp_sext_i32_to_f64:
167
+ ; RV64IDINX: # %bb.0:
168
+ ; RV64IDINX-NEXT: fcvt.d.w a0, a0
169
+ ; RV64IDINX-NEXT: ret
111
170
%1 = call double @llvm.experimental.constrained.sitofp.f64.i32 (i32 %a , metadata !"round.dynamic" , metadata !"fpexcept.strict" ) strictfp
112
171
ret double %1
113
172
}
@@ -117,6 +176,11 @@ define double @sitofp_zext_i32_to_f64(i32 zeroext %a) nounwind strictfp {
117
176
; RV64ID: # %bb.0:
118
177
; RV64ID-NEXT: fcvt.d.w fa0, a0
119
178
; RV64ID-NEXT: ret
179
+ ;
180
+ ; RV64IDINX-LABEL: sitofp_zext_i32_to_f64:
181
+ ; RV64IDINX: # %bb.0:
182
+ ; RV64IDINX-NEXT: fcvt.d.w a0, a0
183
+ ; RV64IDINX-NEXT: ret
120
184
%1 = call double @llvm.experimental.constrained.sitofp.f64.i32 (i32 %a , metadata !"round.dynamic" , metadata !"fpexcept.strict" ) strictfp
121
185
ret double %1
122
186
}
0 commit comments