1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -run-pass=instruction-select %s -o - \
5 name: const_i64_INT_MIN
8 tracksRegLiveness: true
13 ; CHECK-LABEL: name: const_i64_INT_MIN
14 ; CHECK: liveins: $x10
16 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI $x0, -1
17 ; CHECK-NEXT: [[SLLI:%[0-9]+]]:gpr = SLLI [[ADDI]], 63
18 ; CHECK-NEXT: $x10 = COPY [[SLLI]]
19 ; CHECK-NEXT: PseudoRET implicit $x10
20 %0:gprb(s64) = G_CONSTANT i64 -9223372036854775808
22 PseudoRET implicit $x10
26 name: const_i64_neg_9223372036854775000
29 tracksRegLiveness: true
34 ; CHECK-LABEL: name: const_i64_neg_9223372036854775000
35 ; CHECK: liveins: $x10
37 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI $x0, -1
38 ; CHECK-NEXT: [[SLLI:%[0-9]+]]:gpr = SLLI [[ADDI]], 63
39 ; CHECK-NEXT: [[ADDI1:%[0-9]+]]:gpr = ADDI [[SLLI]], 808
40 ; CHECK-NEXT: $x10 = COPY [[ADDI1]]
41 ; CHECK-NEXT: PseudoRET implicit $x10
42 %0:gprb(s64) = G_CONSTANT i64 -9223372036854775000
44 PseudoRET implicit $x10
48 name: const_i64_INT_MAX
51 tracksRegLiveness: true
56 ; CHECK-LABEL: name: const_i64_INT_MAX
57 ; CHECK: liveins: $x10
59 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI $x0, -1
60 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[ADDI]], 1
61 ; CHECK-NEXT: $x10 = COPY [[SRLI]]
62 ; CHECK-NEXT: PseudoRET implicit $x10
63 %0:gprb(s64) = G_CONSTANT i64 9223372036854775807
65 PseudoRET implicit $x10
69 name: const_i64_9223372036854775000
72 tracksRegLiveness: true
77 ; CHECK-LABEL: name: const_i64_9223372036854775000
78 ; CHECK: liveins: $x10
80 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI $x0, -1615
81 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[ADDI]], 1
82 ; CHECK-NEXT: $x10 = COPY [[SRLI]]
83 ; CHECK-NEXT: PseudoRET implicit $x10
84 %0:gprb(s64) = G_CONSTANT i64 9223372036854775000
86 PseudoRET implicit $x10
93 tracksRegLiveness: true
98 ; CHECK-LABEL: name: const_i64_256
99 ; CHECK: liveins: $x10
101 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI $x0, 256
102 ; CHECK-NEXT: $x10 = COPY [[ADDI]]
103 ; CHECK-NEXT: PseudoRET implicit $x10
104 %0:gprb(s64) = G_CONSTANT i64 256
106 PseudoRET implicit $x10
112 regBankSelected: true
113 tracksRegLiveness: true
118 ; CHECK-LABEL: name: const_i64_0
119 ; CHECK: liveins: $x10
121 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x0
122 ; CHECK-NEXT: $x10 = COPY [[COPY]]
123 ; CHECK-NEXT: PseudoRET implicit $x10
124 %0:gprb(s64) = G_CONSTANT i64 0
126 PseudoRET implicit $x10
130 name: const_i32_INT_MIN
132 regBankSelected: true
133 tracksRegLiveness: true
138 ; CHECK-LABEL: name: const_i32_INT_MIN
139 ; CHECK: liveins: $x10
141 ; CHECK-NEXT: [[LUI:%[0-9]+]]:gpr = LUI 524288
142 ; CHECK-NEXT: $x10 = COPY [[LUI]]
143 ; CHECK-NEXT: PseudoRET implicit $x10
144 %0:gprb(s64) = G_CONSTANT i64 -2147483648
146 PseudoRET implicit $x10
150 name: const_i32_neg_2147483000
152 regBankSelected: true
153 tracksRegLiveness: true
158 ; CHECK-LABEL: name: const_i32_neg_2147483000
159 ; CHECK: liveins: $x10
161 ; CHECK-NEXT: [[LUI:%[0-9]+]]:gpr = LUI 524288
162 ; CHECK-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[LUI]], 648
163 ; CHECK-NEXT: $x10 = COPY [[ADDIW]]
164 ; CHECK-NEXT: PseudoRET implicit $x10
165 %0:gprb(s64) = G_CONSTANT i64 -2147483000
167 PseudoRET implicit $x10
171 name: const_i32_INT_MAX
173 regBankSelected: true
174 tracksRegLiveness: true
179 ; CHECK-LABEL: name: const_i32_INT_MAX
180 ; CHECK: liveins: $x10
182 ; CHECK-NEXT: [[LUI:%[0-9]+]]:gpr = LUI 524288
183 ; CHECK-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[LUI]], -1
184 ; CHECK-NEXT: $x10 = COPY [[ADDIW]]
185 ; CHECK-NEXT: PseudoRET implicit $x10
186 %0:gprb(s64) = G_CONSTANT i64 2147483647
188 PseudoRET implicit $x10
192 name: const_i32_2147483000
194 regBankSelected: true
195 tracksRegLiveness: true
200 ; CHECK-LABEL: name: const_i32_2147483000
201 ; CHECK: liveins: $x10
203 ; CHECK-NEXT: [[LUI:%[0-9]+]]:gpr = LUI 524288
204 ; CHECK-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[LUI]], -648
205 ; CHECK-NEXT: $x10 = COPY [[ADDIW]]
206 ; CHECK-NEXT: PseudoRET implicit $x10
207 %0:gprb(s64) = G_CONSTANT i64 2147483000
209 PseudoRET implicit $x10