1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
; RUN: | FileCheck %s -check-prefixes=RV32-RV64,RV32
; RUN: llc -mtriple=riscv32 -mattr=+d -verify-machineinstrs < %s \
; RUN: | FileCheck %s -check-prefixes=RV32D-RV64D,RV32D
; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
; RUN: | FileCheck %s -check-prefixes=RV32-RV64,RV64
; RUN: llc -mtriple=riscv64 -mattr=+d -verify-machineinstrs < %s \
; RUN: | FileCheck %s -check-prefixes=RV32D-RV64D,RV64D
define void @int32_float_pair(i32 %tmp1, float %tmp2, ptr %ref.tmp) {
; RV32-RV64-LABEL: int32_float_pair:
; RV32-RV64: # %bb.0:
; RV32-RV64-NEXT: sw a0, 0(a2)
; RV32-RV64-NEXT: sw a1, 4(a2)
; RV32-RV64-NEXT: ret
;
; RV32D-RV64D-LABEL: int32_float_pair:
; RV32D-RV64D: # %bb.0:
; RV32D-RV64D-NEXT: sw a0, 0(a1)
; RV32D-RV64D-NEXT: fsw fa0, 4(a1)
; RV32D-RV64D-NEXT: ret
%t0 = bitcast float %tmp2 to i32
%t1 = zext i32 %t0 to i64
%t2 = shl nuw i64 %t1, 32
%t3 = zext i32 %tmp1 to i64
%t4 = or i64 %t2, %t3
store i64 %t4, ptr %ref.tmp, align 8
ret void
}
define void @float_int32_pair(float %tmp1, i32 %tmp2, ptr %ref.tmp) {
; RV32-RV64-LABEL: float_int32_pair:
; RV32-RV64: # %bb.0:
; RV32-RV64-NEXT: sw a0, 0(a2)
; RV32-RV64-NEXT: sw a1, 4(a2)
; RV32-RV64-NEXT: ret
;
; RV32D-RV64D-LABEL: float_int32_pair:
; RV32D-RV64D: # %bb.0:
; RV32D-RV64D-NEXT: fsw fa0, 0(a1)
; RV32D-RV64D-NEXT: sw a0, 4(a1)
; RV32D-RV64D-NEXT: ret
%t0 = bitcast float %tmp1 to i32
%t1 = zext i32 %tmp2 to i64
%t2 = shl nuw i64 %t1, 32
%t3 = zext i32 %t0 to i64
%t4 = or i64 %t2, %t3
store i64 %t4, ptr %ref.tmp, align 8
ret void
}
define void @int16_float_pair(i16 signext %tmp1, float %tmp2, ptr %ref.tmp) {
; RV32-LABEL: int16_float_pair:
; RV32: # %bb.0:
; RV32-NEXT: slli a0, a0, 16
; RV32-NEXT: srli a0, a0, 16
; RV32-NEXT: sw a0, 0(a2)
; RV32-NEXT: sw a1, 4(a2)
; RV32-NEXT: ret
;
; RV32D-LABEL: int16_float_pair:
; RV32D: # %bb.0:
; RV32D-NEXT: slli a0, a0, 16
; RV32D-NEXT: srli a0, a0, 16
; RV32D-NEXT: sw a0, 0(a1)
; RV32D-NEXT: fsw fa0, 4(a1)
; RV32D-NEXT: ret
;
; RV64-LABEL: int16_float_pair:
; RV64: # %bb.0:
; RV64-NEXT: slli a0, a0, 48
; RV64-NEXT: srli a0, a0, 48
; RV64-NEXT: sw a0, 0(a2)
; RV64-NEXT: sw a1, 4(a2)
; RV64-NEXT: ret
;
; RV64D-LABEL: int16_float_pair:
; RV64D: # %bb.0:
; RV64D-NEXT: slli a0, a0, 48
; RV64D-NEXT: srli a0, a0, 48
; RV64D-NEXT: sw a0, 0(a1)
; RV64D-NEXT: fsw fa0, 4(a1)
; RV64D-NEXT: ret
%t0 = bitcast float %tmp2 to i32
%t1 = zext i32 %t0 to i64
%t2 = shl nuw i64 %t1, 32
%t3 = zext i16 %tmp1 to i64
%t4 = or i64 %t2, %t3
store i64 %t4, ptr %ref.tmp, align 8
ret void
}
define void @int8_float_pair(i8 signext %tmp1, float %tmp2, ptr %ref.tmp) {
; RV32-RV64-LABEL: int8_float_pair:
; RV32-RV64: # %bb.0:
; RV32-RV64-NEXT: zext.b a0, a0
; RV32-RV64-NEXT: sw a0, 0(a2)
; RV32-RV64-NEXT: sw a1, 4(a2)
; RV32-RV64-NEXT: ret
;
; RV32D-RV64D-LABEL: int8_float_pair:
; RV32D-RV64D: # %bb.0:
; RV32D-RV64D-NEXT: zext.b a0, a0
; RV32D-RV64D-NEXT: sw a0, 0(a1)
; RV32D-RV64D-NEXT: fsw fa0, 4(a1)
; RV32D-RV64D-NEXT: ret
%t0 = bitcast float %tmp2 to i32
%t1 = zext i32 %t0 to i64
%t2 = shl nuw i64 %t1, 32
%t3 = zext i8 %tmp1 to i64
%t4 = or i64 %t2, %t3
store i64 %t4, ptr %ref.tmp, align 8
ret void
}
define void @int32_int32_pair(i32 %tmp1, i32 %tmp2, ptr %ref.tmp) {
; RV32-LABEL: int32_int32_pair:
; RV32: # %bb.0:
; RV32-NEXT: sw a0, 0(a2)
; RV32-NEXT: sw a1, 4(a2)
; RV32-NEXT: ret
;
; RV32D-LABEL: int32_int32_pair:
; RV32D: # %bb.0:
; RV32D-NEXT: sw a0, 0(a2)
; RV32D-NEXT: sw a1, 4(a2)
; RV32D-NEXT: ret
;
; RV64-LABEL: int32_int32_pair:
; RV64: # %bb.0:
; RV64-NEXT: slli a1, a1, 32
; RV64-NEXT: slli a0, a0, 32
; RV64-NEXT: srli a0, a0, 32
; RV64-NEXT: or a0, a1, a0
; RV64-NEXT: sd a0, 0(a2)
; RV64-NEXT: ret
;
; RV64D-LABEL: int32_int32_pair:
; RV64D: # %bb.0:
; RV64D-NEXT: slli a1, a1, 32
; RV64D-NEXT: slli a0, a0, 32
; RV64D-NEXT: srli a0, a0, 32
; RV64D-NEXT: or a0, a1, a0
; RV64D-NEXT: sd a0, 0(a2)
; RV64D-NEXT: ret
%t1 = zext i32 %tmp2 to i64
%t2 = shl nuw i64 %t1, 32
%t3 = zext i32 %tmp1 to i64
%t4 = or i64 %t2, %t3
store i64 %t4, ptr %ref.tmp, align 8
ret void
}
define void @mbb_int32_float_pair(i32 %tmp1, float %tmp2, ptr %ref.tmp) {
; RV32-RV64-LABEL: mbb_int32_float_pair:
; RV32-RV64: # %bb.0: # %entry
; RV32-RV64-NEXT: sw a0, 0(a2)
; RV32-RV64-NEXT: sw a1, 4(a2)
; RV32-RV64-NEXT: ret
;
; RV32D-RV64D-LABEL: mbb_int32_float_pair:
; RV32D-RV64D: # %bb.0: # %entry
; RV32D-RV64D-NEXT: sw a0, 0(a1)
; RV32D-RV64D-NEXT: fsw fa0, 4(a1)
; RV32D-RV64D-NEXT: ret
entry:
%t0 = bitcast float %tmp2 to i32
br label %next
next:
%t1 = zext i32 %t0 to i64
%t2 = shl nuw i64 %t1, 32
%t3 = zext i32 %tmp1 to i64
%t4 = or i64 %t2, %t3
store i64 %t4, ptr %ref.tmp, align 8
ret void
}
define void @mbb_int32_float_multi_stores(i32 %tmp1, float %tmp2, ptr %ref.tmp, ptr %ref.tmp1, i1 %cmp) {
; RV32-RV64-LABEL: mbb_int32_float_multi_stores:
; RV32-RV64: # %bb.0: # %entry
; RV32-RV64-NEXT: andi a4, a4, 1
; RV32-RV64-NEXT: sw a0, 0(a2)
; RV32-RV64-NEXT: sw a1, 4(a2)
; RV32-RV64-NEXT: beqz a4, .LBB6_2
; RV32-RV64-NEXT: # %bb.1: # %bb2
; RV32-RV64-NEXT: sw a0, 0(a3)
; RV32-RV64-NEXT: sw a1, 4(a3)
; RV32-RV64-NEXT: .LBB6_2: # %exitbb
; RV32-RV64-NEXT: ret
;
; RV32D-RV64D-LABEL: mbb_int32_float_multi_stores:
; RV32D-RV64D: # %bb.0: # %entry
; RV32D-RV64D-NEXT: andi a3, a3, 1
; RV32D-RV64D-NEXT: sw a0, 0(a1)
; RV32D-RV64D-NEXT: fsw fa0, 4(a1)
; RV32D-RV64D-NEXT: beqz a3, .LBB6_2
; RV32D-RV64D-NEXT: # %bb.1: # %bb2
; RV32D-RV64D-NEXT: sw a0, 0(a2)
; RV32D-RV64D-NEXT: fsw fa0, 4(a2)
; RV32D-RV64D-NEXT: .LBB6_2: # %exitbb
; RV32D-RV64D-NEXT: ret
entry:
%t0 = bitcast float %tmp2 to i32
br label %bb1
bb1:
%t1 = zext i32 %t0 to i64
%t2 = shl nuw i64 %t1, 32
%t3 = zext i32 %tmp1 to i64
%t4 = or i64 %t2, %t3
store i64 %t4, ptr %ref.tmp, align 8
br i1 %cmp, label %bb2, label %exitbb
bb2:
store i64 %t4, ptr %ref.tmp1, align 8
br label %exitbb
exitbb:
ret void
}
|