1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -mattr=+zbb -run-pass=instruction-select \
3 # RUN: -simplify-mir -verify-machineinstrs %s -o - | FileCheck %s
4 # RUN: llc -mtriple=riscv64 -mattr=+zbkb -run-pass=instruction-select \
5 # RUN: -simplify-mir -verify-machineinstrs %s -o - | FileCheck %s
11 tracksRegLiveness: true
16 ; CHECK-LABEL: name: rotl_i32
17 ; CHECK: liveins: $x10, $x11
19 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
20 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
21 ; CHECK-NEXT: [[ROLW:%[0-9]+]]:gpr = ROLW [[COPY]], [[COPY1]]
22 ; CHECK-NEXT: $x10 = COPY [[ROLW]]
23 ; CHECK-NEXT: PseudoRET implicit $x10
24 %0:gprb(s64) = COPY $x10
25 %1:gprb(s64) = COPY $x11
26 %2:gprb(s64) = G_ROLW %0, %1(s64)
28 PseudoRET implicit $x10
35 tracksRegLiveness: true
40 ; CHECK-LABEL: name: rotl_i64
41 ; CHECK: liveins: $x10, $x11
43 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
44 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
45 ; CHECK-NEXT: [[ROL:%[0-9]+]]:gpr = ROL [[COPY]], [[COPY1]]
46 ; CHECK-NEXT: $x10 = COPY [[ROL]]
47 ; CHECK-NEXT: PseudoRET implicit $x10
48 %0:gprb(s64) = COPY $x10
49 %1:gprb(s64) = COPY $x11
50 %2:gprb(s64) = G_ROTL %0, %1(s64)
52 PseudoRET implicit $x10
63 ; CHECK-LABEL: name: rotr_i32
64 ; CHECK: liveins: $x10, $x11
66 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
67 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
68 ; CHECK-NEXT: [[RORW:%[0-9]+]]:gpr = RORW [[COPY]], [[COPY1]]
69 ; CHECK-NEXT: $x10 = COPY [[RORW]]
70 ; CHECK-NEXT: PseudoRET implicit $x10
71 %0:gprb(s64) = COPY $x10
72 %1:gprb(s64) = COPY $x11
73 %2:gprb(s64) = G_RORW %0, %1(s64)
75 PseudoRET implicit $x10
86 ; CHECK-LABEL: name: rotr_i64
87 ; CHECK: liveins: $x10, $x11
89 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
90 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
91 ; CHECK-NEXT: [[ROR:%[0-9]+]]:gpr = ROR [[COPY]], [[COPY1]]
92 ; CHECK-NEXT: $x10 = COPY [[ROR]]
93 ; CHECK-NEXT: PseudoRET implicit $x10
94 %0:gprb(s64) = COPY $x10
95 %1:gprb(s64) = COPY $x11
96 %2:gprb(s64) = G_ROTR %0, %1(s64)
98 PseudoRET implicit $x10
104 regBankSelected: true
105 tracksRegLiveness: true
110 ; CHECK-LABEL: name: rotl_imm_i32
111 ; CHECK: liveins: $x10
113 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
114 ; CHECK-NEXT: [[RORIW:%[0-9]+]]:gpr = RORIW [[COPY]], 17
115 ; CHECK-NEXT: $x10 = COPY [[RORIW]]
116 ; CHECK-NEXT: PseudoRET implicit $x10
117 %0:gprb(s64) = COPY $x10
118 %1:gprb(s64) = G_CONSTANT i64 15
119 %2:gprb(s64) = G_ROLW %0, %1(s64)
121 PseudoRET implicit $x10
127 regBankSelected: true
128 tracksRegLiveness: true
133 ; CHECK-LABEL: name: rotl_imm_i64
134 ; CHECK: liveins: $x10
136 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
137 ; CHECK-NEXT: [[RORI:%[0-9]+]]:gpr = RORI [[COPY]], 31
138 ; CHECK-NEXT: $x10 = COPY [[RORI]]
139 ; CHECK-NEXT: PseudoRET implicit $x10
140 %0:gprb(s64) = COPY $x10
141 %1:gprb(s64) = G_CONSTANT i64 33
142 %2:gprb(s64) = G_ROTL %0, %1(s64)
144 PseudoRET implicit $x10
150 regBankSelected: true
151 tracksRegLiveness: true
156 ; CHECK-LABEL: name: rotr_imm_i32
157 ; CHECK: liveins: $x10
159 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
160 ; CHECK-NEXT: [[RORIW:%[0-9]+]]:gpr = RORIW [[COPY]], 15
161 ; CHECK-NEXT: $x10 = COPY [[RORIW]]
162 ; CHECK-NEXT: PseudoRET implicit $x10
163 %0:gprb(s64) = COPY $x10
164 %1:gprb(s64) = G_CONSTANT i64 15
165 %2:gprb(s64) = G_RORW %0, %1(s64)
167 PseudoRET implicit $x10
173 regBankSelected: true
174 tracksRegLiveness: true
179 ; CHECK-LABEL: name: rotr_imm_i64
180 ; CHECK: liveins: $x10
182 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
183 ; CHECK-NEXT: [[RORI:%[0-9]+]]:gpr = RORI [[COPY]], 33
184 ; CHECK-NEXT: $x10 = COPY [[RORI]]
185 ; CHECK-NEXT: PseudoRET implicit $x10
186 %0:gprb(s64) = COPY $x10
187 %1:gprb(s64) = G_CONSTANT i64 33
188 %2:gprb(s64) = G_ROTR %0, %1(s64)
190 PseudoRET implicit $x10