1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
3 ; RUN: --ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s
4 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \
5 ; RUN: --ppc-asm-full-reg-names -mcpu=pwr7 < %s | FileCheck %s
6 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-aix \
7 ; RUN: --ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s
10 declare void @llvm.ppc.tdw(i64 %a, i64 %b, i32 immarg)
11 define dso_local void @test__tdwlgt(i64 %a, i64 %b) {
12 ; CHECK-LABEL: test__tdwlgt:
14 ; CHECK-NEXT: tdlgt r3, r4
16 call void @llvm.ppc.tdw(i64 %a, i64 %b, i32 1)
20 define dso_local void @test__tdwllt(i64 %a, i64 %b) {
21 ; CHECK-LABEL: test__tdwllt:
23 ; CHECK-NEXT: tdllt r3, r4
25 call void @llvm.ppc.tdw(i64 %a, i64 %b, i32 2)
29 define dso_local void @test__tdw3(i64 %a, i64 %b) {
30 ; CHECK-LABEL: test__tdw3:
32 ; CHECK-NEXT: td 3, r3, r4
34 call void @llvm.ppc.tdw(i64 %a, i64 %b, i32 3)
37 define dso_local void @test__tdweq(i64 %a, i64 %b) {
38 ; CHECK-LABEL: test__tdweq:
40 ; CHECK-NEXT: tdeq r3, r4
42 call void @llvm.ppc.tdw(i64 %a, i64 %b, i32 4)
46 define dso_local void @test__tdwlge(i64 %a, i64 %b) {
47 ; CHECK-LABEL: test__tdwlge:
49 ; CHECK-NEXT: td 5, r3, r4
51 call void @llvm.ppc.tdw(i64 %a, i64 %b, i32 5)
55 define dso_local void @test__tdwlle(i64 %a, i64 %b) {
56 ; CHECK-LABEL: test__tdwlle:
58 ; CHECK-NEXT: td 6, r3, r4
60 call void @llvm.ppc.tdw(i64 %a, i64 %b, i32 6)
64 define dso_local void @test__tdwgt(i64 %a, i64 %b) {
65 ; CHECK-LABEL: test__tdwgt:
67 ; CHECK-NEXT: tdgt r3, r4
69 call void @llvm.ppc.tdw(i64 %a, i64 %b, i32 8)
73 define dso_local void @test__tdwge(i64 %a, i64 %b) {
74 ; CHECK-LABEL: test__tdwge:
76 ; CHECK-NEXT: td 12, r3, r4
78 call void @llvm.ppc.tdw(i64 %a, i64 %b, i32 12)
82 define dso_local void @test__tdwlt(i64 %a, i64 %b) {
83 ; CHECK-LABEL: test__tdwlt:
85 ; CHECK-NEXT: tdlt r3, r4
87 call void @llvm.ppc.tdw(i64 %a, i64 %b, i32 16)
91 define dso_local void @test__tdwle(i64 %a, i64 %b) {
92 ; CHECK-LABEL: test__tdwle:
94 ; CHECK-NEXT: td 20, r3, r4
96 call void @llvm.ppc.tdw(i64 %a, i64 %b, i32 20)
100 define dso_local void @test__tdwne24(i64 %a, i64 %b) {
101 ; CHECK-LABEL: test__tdwne24:
103 ; CHECK-NEXT: tdne r3, r4
105 call void @llvm.ppc.tdw(i64 %a, i64 %b, i32 24)
109 define dso_local void @test__tdw31(i64 %a, i64 %b) {
110 ; CHECK-LABEL: test__tdw31:
112 ; CHECK-NEXT: tdu r3, r4
114 call void @llvm.ppc.tdw(i64 %a, i64 %b, i32 31)
118 define dso_local void @test__tdw_no_match(i64 %a, i64 %b) {
119 ; CHECK-LABEL: test__tdw_no_match:
121 ; CHECK-NEXT: td 13, r3, r4
123 call void @llvm.ppc.tdw(i64 %a, i64 %b, i32 13)
128 define dso_local void @test__tdi_reg_imm_boundary(i64 %a) {
129 ; CHECK-LABEL: test__tdi_reg_imm_boundary:
131 ; CHECK-NEXT: tdi 3, r3, 32767
133 call void @llvm.ppc.tdw(i64 %a, i64 32767, i32 3)
137 define dso_local void @test__tdi_imm_reg_boundary(i64 %a) {
138 ; CHECK-LABEL: test__tdi_imm_reg_boundary:
140 ; CHECK-NEXT: tdi 3, r3, 32767
142 call void @llvm.ppc.tdw(i64 32767, i64 %a, i32 3)
146 define dso_local void @test__tdi_reg_imm_boundary1(i64 %a) {
147 ; CHECK-LABEL: test__tdi_reg_imm_boundary1:
149 ; CHECK-NEXT: tdi 3, r3, -32768
151 call void @llvm.ppc.tdw(i64 %a, i64 -32768, i32 3)
155 define dso_local void @test__tdi_imm_reg_boundary1(i64 %a) {
156 ; CHECK-LABEL: test__tdi_imm_reg_boundary1:
158 ; CHECK-NEXT: tdi 3, r3, -32768
160 call void @llvm.ppc.tdw(i64 -32768, i64 %a, i32 3)
164 define dso_local void @test__td_reg_imm_boundary2(i64 %a) {
165 ; CHECK-LABEL: test__td_reg_imm_boundary2:
167 ; CHECK-NEXT: li r4, 0
168 ; CHECK-NEXT: ori r4, r4, 32768
169 ; CHECK-NEXT: td 3, r4, r3
171 call void @llvm.ppc.tdw(i64 32768, i64 %a, i32 3)
175 define dso_local void @test__td_imm_reg_boundary2(i64 %a) {
176 ; CHECK-LABEL: test__td_imm_reg_boundary2:
178 ; CHECK-NEXT: li r4, 0
179 ; CHECK-NEXT: ori r4, r4, 32768
180 ; CHECK-NEXT: td 3, r3, r4
182 call void @llvm.ppc.tdw(i64 %a, i64 32768, i32 3)
186 define dso_local void @test__td_reg_imm_boundary3(i64 %a) {
187 ; CHECK-LABEL: test__td_reg_imm_boundary3:
189 ; CHECK-NEXT: lis r4, -1
190 ; CHECK-NEXT: ori r4, r4, 32767
191 ; CHECK-NEXT: td 3, r3, r4
193 call void @llvm.ppc.tdw(i64 %a, i64 -32769, i32 3)
197 define dso_local void @test__td_imm_reg_boundary3(i64 %a) {
198 ; CHECK-LABEL: test__td_imm_reg_boundary3:
200 ; CHECK-NEXT: lis r4, -1
201 ; CHECK-NEXT: ori r4, r4, 32767
202 ; CHECK-NEXT: td 3, r3, r4
204 call void @llvm.ppc.tdw(i64 %a, i64 -32769, i32 3)
208 define dso_local void @test__tdlgti_reg_imm(i64 %a) {
209 ; CHECK-LABEL: test__tdlgti_reg_imm:
211 ; CHECK-NEXT: tdlgti r3, 0
213 call void @llvm.ppc.tdw(i64 %a, i64 0, i32 1)
217 define dso_local void @test__tdllti_imm_reg(i64 %a) {
218 ; CHECK-LABEL: test__tdllti_imm_reg:
220 ; CHECK-NEXT: tdllti r3, 0
222 call void @llvm.ppc.tdw(i64 0, i64 %a, i32 1)
226 define dso_local void @test__tdllti_reg_imm(i64 %a) {
227 ; CHECK-LABEL: test__tdllti_reg_imm:
229 ; CHECK-NEXT: tdllti r3, 1
231 call void @llvm.ppc.tdw(i64 %a, i64 1, i32 2)
235 define dso_local void @test__tdlgti_imm_reg(i64 %a) {
236 ; CHECK-LABEL: test__tdlgti_imm_reg:
238 ; CHECK-NEXT: tdlgti r3, 1
240 call void @llvm.ppc.tdw(i64 1, i64 %a, i32 2)
244 define dso_local void @test__tdeqi_reg_imm(i64 %a) {
245 ; CHECK-LABEL: test__tdeqi_reg_imm:
247 ; CHECK-NEXT: tdeqi r3, 2
249 call void @llvm.ppc.tdw(i64 %a, i64 2, i32 4)
253 define dso_local void @test__tdeqi_imm_reg(i64 %a) {
254 ; CHECK-LABEL: test__tdeqi_imm_reg:
256 ; CHECK-NEXT: tdeqi r3, 2
258 call void @llvm.ppc.tdw(i64 2, i64 %a, i32 4)
262 define dso_local void @test__tdgti_reg_imm(i64 %a) {
263 ; CHECK-LABEL: test__tdgti_reg_imm:
265 ; CHECK-NEXT: tdgti r3, 16
267 call void @llvm.ppc.tdw(i64 %a, i64 16, i32 8)
271 define dso_local void @test__tdlti_imm_reg(i64 %a) {
272 ; CHECK-LABEL: test__tdlti_imm_reg:
274 ; CHECK-NEXT: tdlti r3, 16
276 call void @llvm.ppc.tdw(i64 16, i64 %a, i32 8)
280 define dso_local void @test__tdlti_reg_imm(i64 %a) {
281 ; CHECK-LABEL: test__tdlti_reg_imm:
283 ; CHECK-NEXT: tdlti r3, 64
285 call void @llvm.ppc.tdw(i64 %a, i64 64, i32 16)
289 define dso_local void @test__tdgti_imm_reg(i64 %a) {
290 ; CHECK-LABEL: test__tdgti_imm_reg:
292 ; CHECK-NEXT: tdgti r3, 64
294 call void @llvm.ppc.tdw(i64 64, i64 %a, i32 16)
298 define dso_local void @test__tdnei_reg_imm(i64 %a) {
299 ; CHECK-LABEL: test__tdnei_reg_imm:
301 ; CHECK-NEXT: tdnei r3, 256
303 call void @llvm.ppc.tdw(i64 %a, i64 256, i32 24)
307 define dso_local void @test__tdnei_imm_reg(i64 %a) {
308 ; CHECK-LABEL: test__tdnei_imm_reg:
310 ; CHECK-NEXT: tdnei r3, 256
312 call void @llvm.ppc.tdw(i64 256, i64 %a, i32 24)
316 define dso_local void @test__tdui_reg_imm(i64 %a) {
317 ; CHECK-LABEL: test__tdui_reg_imm:
319 ; CHECK-NEXT: tdui r3, 512
321 call void @llvm.ppc.tdw(i64 %a, i64 512, i32 31)
325 define dso_local void @test__tdui_imm_reg(i64 %a) {
326 ; CHECK-LABEL: test__tdui_imm_reg:
328 ; CHECK-NEXT: tdui r3, 512
330 call void @llvm.ppc.tdw(i64 512, i64 %a, i32 31)
335 declare void @llvm.ppc.trapd(i64 %a)
336 define dso_local void @test__trapd(i64 %a) {
337 ; CHECK-LABEL: test__trapd:
339 ; CHECK-NEXT: tdnei r3, 0
341 call void @llvm.ppc.trapd(i64 %a)