1# RUN: llvm-mc --disassemble %s -triple powerpc64le-unknown-unknown -mcpu=pwr7 | FileCheck %s
2
3# FIXME: test b target
4
5# FIXME: test ba target
6
7# FIXME: test bl target
8
9# FIXME: test bla target
10
11# FIXME: test bc 4, 10, target
12
13# FIXME: test bca 4, 10, target
14
15# FIXME: test bcl 4, 10, target
16
17# FIXME: test bcla 4, 10, target
18
19# CHECK: bclr 4, 10, 3
200x20 0x18 0x8a 0x4c
21
22# CHECK: bclr 4, 10
230x20 0x00 0x8a 0x4c
24
25# CHECK: bclrl 4, 10, 3
260x21 0x18 0x8a 0x4c
27
28# CHECK: bclrl 4, 10
290x21 0x00 0x8a 0x4c
30
31# CHECK: bcctr 4, 10, 3
320x20 0x1c 0x8a 0x4c
33
34# CHECK: bcctr 4, 10
350x20 0x04 0x8a 0x4c
36
37# CHECK: bcctrl 4, 10, 3
380x21 0x1c 0x8a 0x4c
39
40# CHECK: bcctrl 4, 10
410x21 0x04 0x8a 0x4c
42
43# CHECK: crand 2, 3, 4
440x02 0x22 0x43 0x4c
45
46# CHECK: crnand 2, 3, 4
470xc2 0x21 0x43 0x4c
48
49# CHECK: cror 2, 3, 4
500x82 0x23 0x43 0x4c
51
52# CHECK: crxor 2, 3, 4
530x82 0x21 0x43 0x4c
54
55# CHECK: crnor 2, 3, 4
560x42 0x20 0x43 0x4c
57
58# CHECK: creqv 2, 3, 4
590x42 0x22 0x43 0x4c
60
61# CHECK: crandc 2, 3, 4
620x02 0x21 0x43 0x4c
63
64# CHECK: crorc 2, 3, 4
650x42 0x23 0x43 0x4c
66
67# CHECK: mcrf 2, 3
680x00 0x00 0x0c 0x4d
69
70# CHECK: sc 1
710x22 0x00 0x00 0x44
72
73# CHECK: sc
740x02 0x00 0x00 0x44
75
76# CHECK: clrbhrb
770x5c 0x03 0x00 0x7c
78
79# CHECK: mfbhrbe 9, 983
800x5c 0xba 0x3e 0x7d
81
82# CHECK: rfebb 1
830x24 0x09 0x00 0x4c
84
85# CHECK: lbz 2, 128(4)
860x80 0x00 0x44 0x88
87
88# CHECK: lbzx 2, 3, 4
890xae 0x20 0x43 0x7c
90
91# CHECK: lbzu 2, 128(4)
920x80 0x00 0x44 0x8c
93
94# CHECK: lbzux 2, 3, 4
950xee 0x20 0x43 0x7c
96
97# CHECK: lhz 2, 128(4)
980x80 0x00 0x44 0xa0
99
100# CHECK: lhzx 2, 3, 4
1010x2e 0x22 0x43 0x7c
102
103# CHECK: lhzu 2, 128(4)
1040x80 0x00 0x44 0xa4
105
106# CHECK: lhzux 2, 3, 4
1070x6e 0x22 0x43 0x7c
108
109# CHECK: lha 2, 128(4)
1100x80 0x00 0x44 0xa8
111
112# CHECK: lhax 2, 3, 4
1130xae 0x22 0x43 0x7c
114
115# CHECK: lhau 2, 128(4)
1160x80 0x00 0x44 0xac
117
118# CHECK: lhaux 2, 3, 4
1190xee 0x22 0x43 0x7c
120
121# CHECK: lwz 2, 128(4)
1220x80 0x00 0x44 0x80
123
124# CHECK: lwzx 2, 3, 4
1250x2e 0x20 0x43 0x7c
126
127# CHECK: lwzu 2, 128(4)
1280x80 0x00 0x44 0x84
129
130# CHECK: lwzux 2, 3, 4
1310x6e 0x20 0x43 0x7c
132
133# CHECK: lwa 2, 128(4)
1340x82 0x00 0x44 0xe8
135
136# CHECK: lwax 2, 3, 4
1370xaa 0x22 0x43 0x7c
138
139# CHECK: lwaux 2, 3, 4
1400xea 0x22 0x43 0x7c
141
142# CHECK: ld 2, 128(4)
1430x80 0x00 0x44 0xe8
144
145# CHECK: ldx 2, 3, 4
1460x2a 0x20 0x43 0x7c
147
148# CHECK: ldu 2, 128(4)
1490x81 0x00 0x44 0xe8
150
151# CHECK: ldux 2, 3, 4
1520x6a 0x20 0x43 0x7c
153
154# CHECK: stb 2, 128(4)
1550x80 0x00 0x44 0x98
156
157# CHECK: stbx 2, 3, 4
1580xae 0x21 0x43 0x7c
159
160# CHECK: stbu 2, 128(4)
1610x80 0x00 0x44 0x9c
162
163# CHECK: stbux 2, 3, 4
1640xee 0x21 0x43 0x7c
165
166# CHECK: sth 2, 128(4)
1670x80 0x00 0x44 0xb0
168
169# CHECK: sthx 2, 3, 4
1700x2e 0x23 0x43 0x7c
171
172# CHECK: sthu 2, 128(4)
1730x80 0x00 0x44 0xb4
174
175# CHECK: sthux 2, 3, 4
1760x6e 0x23 0x43 0x7c
177
178# CHECK: stw 2, 128(4)
1790x80 0x00 0x44 0x90
180
181# CHECK: stwx 2, 3, 4
1820x2e 0x21 0x43 0x7c
183
184# CHECK: stwu 2, 128(4)
1850x80 0x00 0x44 0x94
186
187# CHECK: stwux 2, 3, 4
1880x6e 0x21 0x43 0x7c
189
190# CHECK: std 2, 128(4)
1910x80 0x00 0x44 0xf8
192
193# CHECK: stdx 2, 3, 4
1940x2a 0x21 0x43 0x7c
195
196# CHECK: stdu 2, 128(4)
1970x81 0x00 0x44 0xf8
198
199# CHECK: stdux 2, 3, 4
2000x6a 0x21 0x43 0x7c
201
202# CHECK: lhbrx 2, 3, 4
2030x2c 0x26 0x43 0x7c
204
205# CHECK: sthbrx 2, 3, 4
2060x2c 0x27 0x43 0x7c
207
208# CHECK: lwbrx 2, 3, 4
2090x2c 0x24 0x43 0x7c
210
211# CHECK: stwbrx 2, 3, 4
2120x2c 0x25 0x43 0x7c
213
214# CHECK: ldbrx 2, 3, 4
2150x28 0x24 0x43 0x7c
216
217# CHECK: stdbrx 2, 3, 4
2180x28 0x25 0x43 0x7c
219
220# CHECK: lmw 2, 128(1)
2210x80 0x00 0x41 0xb8
222
223# CHECK: stmw 2, 128(1)
2240x80 0x00 0x41 0xbc
225
226# CHECK: addi 2, 3, 128
2270x80 0x00 0x43 0x38
228
229# CHECK: addis 2, 3, 128
2300x80 0x00 0x43 0x3c
231
232# CHECK: add 2, 3, 4
2330x14 0x22 0x43 0x7c
234
235# CHECK: add. 2, 3, 4
2360x15 0x22 0x43 0x7c
237
238# CHECK: subf 2, 3, 4
2390x50 0x20 0x43 0x7c
240
241# CHECK: subf. 2, 3, 4
2420x51 0x20 0x43 0x7c
243
244# CHECK: addic 2, 3, 128
2450x80 0x00 0x43 0x30
246
247# CHECK: addic. 2, 3, 128
2480x80 0x00 0x43 0x34
249
250# CHECK: subfic 2, 3, 4
2510x04 0x00 0x43 0x20
252
253# CHECK: addc 2, 3, 4
2540x14 0x20 0x43 0x7c
255
256# CHECK: addc. 2, 3, 4
2570x15 0x20 0x43 0x7c
258
259# CHECK: subfc 2, 3, 4
2600x10 0x20 0x43 0x7c
261
262# CHECK: subfc 2, 3, 4
2630x10 0x20 0x43 0x7c
264
265# CHECK: adde 2, 3, 4
2660x14 0x21 0x43 0x7c
267
268# CHECK: adde. 2, 3, 4
2690x15 0x21 0x43 0x7c
270
271# CHECK: subfe 2, 3, 4
2720x10 0x21 0x43 0x7c
273
274# CHECK: subfe. 2, 3, 4
2750x11 0x21 0x43 0x7c
276
277# CHECK: addme 2, 3
2780xd4 0x01 0x43 0x7c
279
280# CHECK: addme. 2, 3
2810xd5 0x01 0x43 0x7c
282
283# CHECK: subfme 2, 3
2840xd0 0x01 0x43 0x7c
285
286# CHECK: subfme. 2, 3
2870xd1 0x01 0x43 0x7c
288
289# CHECK: addze 2, 3
2900x94 0x01 0x43 0x7c
291
292# CHECK: addze. 2, 3
2930x95 0x01 0x43 0x7c
294
295# CHECK: subfze 2, 3
2960x90 0x01 0x43 0x7c
297
298# CHECK: subfze. 2, 3
2990x91 0x01 0x43 0x7c
300
301# CHECK: neg 2, 3
3020xd0 0x00 0x43 0x7c
303
304# CHECK: neg. 2, 3
3050xd1 0x00 0x43 0x7c
306
307# CHECK: mulli 2, 3, 128
3080x80 0x00 0x43 0x1c
309
310# CHECK: mulhw 2, 3, 4
3110x96 0x20 0x43 0x7c
312
313# CHECK: mulhw. 2, 3, 4
3140x97 0x20 0x43 0x7c
315
316# CHECK: mullw 2, 3, 4
3170xd6 0x21 0x43 0x7c
318
319# CHECK: mullw. 2, 3, 4
3200xd7 0x21 0x43 0x7c
321
322# CHECK: mulhwu 2, 3, 4
3230x16 0x20 0x43 0x7c
324
325# CHECK: mulhwu. 2, 3, 4
3260x17 0x20 0x43 0x7c
327
328# CHECK: divw 2, 3, 4
3290xd6 0x23 0x43 0x7c
330
331# CHECK: divw. 2, 3, 4
3320xd7 0x23 0x43 0x7c
333
334# CHECK: divwu 2, 3, 4
3350x96 0x23 0x43 0x7c
336
337# CHECK: divwu. 2, 3, 4
3380x97 0x23 0x43 0x7c
339
340# CHECK: divwe 2, 3, 4
3410x56 0x23 0x43 0x7c
342
343# CHECK: divwe. 2, 3, 4
3440x57 0x23 0x43 0x7c
345
346# CHECK: divweu 2, 3, 4
3470x16 0x23 0x43 0x7c
348
349# CHECK: divweu. 2, 3, 4
3500x17 0x23 0x43 0x7c
351
352# CHECK: mulld 2, 3, 4
3530xd2 0x21 0x43 0x7c
354
355# CHECK: mulld. 2, 3, 4
3560xd3 0x21 0x43 0x7c
357
358# CHECK: mulhd 2, 3, 4
3590x92 0x20 0x43 0x7c
360
361# CHECK: mulhd. 2, 3, 4
3620x93 0x20 0x43 0x7c
363
364# CHECK: mulhdu 2, 3, 4
3650x12 0x20 0x43 0x7c
366
367# CHECK: mulhdu. 2, 3, 4
3680x13 0x20 0x43 0x7c
369
370# CHECK: divd 2, 3, 4
3710xd2 0x23 0x43 0x7c
372
373# CHECK: divd. 2, 3, 4
3740xd3 0x23 0x43 0x7c
375
376# CHECK: divdu 2, 3, 4
3770x92 0x23 0x43 0x7c
378
379# CHECK: divdu. 2, 3, 4
3800x93 0x23 0x43 0x7c
381
382# CHECK: divde 2, 3, 4
3830x52 0x23 0x43 0x7c
384
385# CHECK: divde. 2, 3, 4
3860x53 0x23 0x43 0x7c
387
388# CHECK: divdeu 2, 3, 4
3890x12 0x23 0x43 0x7c
390
391# CHECK: divdeu. 2, 3, 4
3920x13 0x23 0x43 0x7c
393
394# CHECK: cmpdi 2, 3, 128
3950x80 0x00 0x23 0x2d
396
397# CHECK: cmpd 2, 3, 4
3980x00 0x20 0x23 0x7d
399
400# CHECK: cmpldi 2, 3, 128
4010x80 0x00 0x23 0x29
402
403# CHECK: cmpld 2, 3, 4
4040x40 0x20 0x23 0x7d
405
406# CHECK: cmpwi 2, 3, 128
4070x80 0x00 0x03 0x2d
408
409# CHECK: cmpw 2, 3, 4
4100x00 0x20 0x03 0x7d
411
412# CHECK: cmplwi 2, 3, 128
4130x80 0x00 0x03 0x29
414
415# CHECK: cmplw 2, 3, 4
4160x40 0x20 0x03 0x7d
417
418# CHECK: twllti 3, 4
4190x04 0x00 0x43 0x0c
420
421# CHECK: twllt 3, 4
4220x08 0x20 0x43 0x7c
423
424# CHECK: tdllti 3, 4
4250x04 0x00 0x43 0x08
426
427# CHECK: tdllt 3, 4
4280x88 0x20 0x43 0x7c
429
430# CHECK: isel 2, 3, 4, 5
4310x5e 0x21 0x43 0x7c
432
433# CHECK: andi. 2, 3, 128
4340x80 0x00 0x62 0x70
435
436# CHECK: andis. 2, 3, 128
4370x80 0x00 0x62 0x74
438
439# CHECK: ori 2, 3, 128
4400x80 0x00 0x62 0x60
441
442# CHECK: oris 2, 3, 128
4430x80 0x00 0x62 0x64
444
445# CHECK: xori 2, 3, 128
4460x80 0x00 0x62 0x68
447
448# CHECK: xoris 2, 3, 128
4490x80 0x00 0x62 0x6c
450
451# CHECK: and 2, 3, 4
4520x38 0x20 0x62 0x7c
453
454# CHECK: and. 2, 3, 4
4550x39 0x20 0x62 0x7c
456
457# CHECK: xor 2, 3, 4
4580x78 0x22 0x62 0x7c
459
460# CHECK: xor. 2, 3, 4
4610x79 0x22 0x62 0x7c
462
463# CHECK: nand 2, 3, 4
4640xb8 0x23 0x62 0x7c
465
466# CHECK: nand. 2, 3, 4
4670xb9 0x23 0x62 0x7c
468
469# CHECK: or 2, 3, 4
4700x78 0x23 0x62 0x7c
471
472# CHECK: or. 2, 3, 4
4730x79 0x23 0x62 0x7c
474
475# CHECK: nor 2, 3, 4
4760xf8 0x20 0x62 0x7c
477
478# CHECK: nor. 2, 3, 4
4790xf9 0x20 0x62 0x7c
480
481# CHECK: eqv 2, 3, 4
4820x38 0x22 0x62 0x7c
483
484# CHECK: eqv. 2, 3, 4
4850x39 0x22 0x62 0x7c
486
487# CHECK: andc 2, 3, 4
4880x78 0x20 0x62 0x7c
489
490# CHECK: andc. 2, 3, 4
4910x79 0x20 0x62 0x7c
492
493# CHECK: orc 2, 3, 4
4940x38 0x23 0x62 0x7c
495
496# CHECK: orc. 2, 3, 4
4970x39 0x23 0x62 0x7c
498
499# CHECK: extsb 2, 3
5000x74 0x07 0x62 0x7c
501
502# CHECK: extsb. 2, 3
5030x75 0x07 0x62 0x7c
504
505# CHECK: extsh 2, 3
5060x34 0x07 0x62 0x7c
507
508# CHECK: extsh. 2, 3
5090x35 0x07 0x62 0x7c
510
511# CHECK: cntlzw 2, 3
5120x34 0x00 0x62 0x7c
513
514# CHECK: cntlzw. 2, 3
5150x35 0x00 0x62 0x7c
516
517# CHECK: popcntw 2, 3
5180xf4 0x02 0x62 0x7c
519
520# CHECK: extsw 2, 3
5210xb4 0x07 0x62 0x7c
522
523# CHECK: extsw. 2, 3
5240xb5 0x07 0x62 0x7c
525
526# CHECK: cntlzd 2, 3
5270x74 0x00 0x62 0x7c
528
529# CHECK: cntlzd. 2, 3
5300x75 0x00 0x62 0x7c
531
532# CHECK: popcntd 2, 3
5330xf4 0x03 0x62 0x7c
534
535# CHECK: bpermd 2, 3, 4
5360xf8 0x21 0x62 0x7c
537
538# CHECK: cmpb 7, 21, 4
5390xf8 0x23 0xa7 0x7e
540
541# CHECK: rlwinm 2, 3, 4, 5, 6
5420x4c 0x21 0x62 0x54
543
544# CHECK: rlwinm. 2, 3, 4, 5, 6
5450x4d 0x21 0x62 0x54
546
547# CHECK: rlwnm 2, 3, 4, 5, 6
5480x4c 0x21 0x62 0x5c
549
550# CHECK: rlwnm. 2, 3, 4, 5, 6
5510x4d 0x21 0x62 0x5c
552
553# CHECK: rlwimi 2, 3, 4, 5, 6
5540x4c 0x21 0x62 0x50
555
556# CHECK: rlwimi. 2, 3, 4, 5, 6
5570x4d 0x21 0x62 0x50
558
559# CHECK: rldicl 2, 3, 4, 5
5600x40 0x21 0x62 0x78
561
562# CHECK: rldicl. 2, 3, 4, 5
5630x41 0x21 0x62 0x78
564
565# CHECK: rldicr 2, 3, 4, 5
5660x44 0x21 0x62 0x78
567
568# CHECK: rldicr. 2, 3, 4, 5
5690x45 0x21 0x62 0x78
570
571# CHECK: rldic 2, 3, 4, 5
5720x48 0x21 0x62 0x78
573
574# CHECK: rldic. 2, 3, 4, 5
5750x49 0x21 0x62 0x78
576
577# CHECK: rldcl 2, 3, 4, 5
5780x50 0x21 0x62 0x78
579
580# CHECK: rldcl. 2, 3, 4, 5
5810x51 0x21 0x62 0x78
582
583# CHECK: rldcr 2, 3, 4, 5
5840x52 0x21 0x62 0x78
585
586# CHECK: rldcr. 2, 3, 4, 5
5870x53 0x21 0x62 0x78
588
589# CHECK: rldimi 2, 3, 4, 5
5900x4c 0x21 0x62 0x78
591
592# CHECK: rldimi. 2, 3, 4, 5
5930x4d 0x21 0x62 0x78
594
595# CHECK: slw 2, 3, 4
5960x30 0x20 0x62 0x7c
597
598# CHECK: slw. 2, 3, 4
5990x31 0x20 0x62 0x7c
600
601# CHECK: srw 2, 3, 4
6020x30 0x24 0x62 0x7c
603
604# CHECK: srw. 2, 3, 4
6050x31 0x24 0x62 0x7c
606
607# CHECK: srawi 2, 3, 4
6080x70 0x26 0x62 0x7c
609
610# CHECK: srawi. 2, 3, 4
6110x71 0x26 0x62 0x7c
612
613# CHECK: sraw 2, 3, 4
6140x30 0x26 0x62 0x7c
615
616# CHECK: sraw. 2, 3, 4
6170x31 0x26 0x62 0x7c
618
619# CHECK: sld 2, 3, 4
6200x36 0x20 0x62 0x7c
621
622# CHECK: sld. 2, 3, 4
6230x37 0x20 0x62 0x7c
624
625# CHECK: srd 2, 3, 4
6260x36 0x24 0x62 0x7c
627
628# CHECK: srd. 2, 3, 4
6290x37 0x24 0x62 0x7c
630
631# CHECK: sradi 2, 3, 4
6320x74 0x26 0x62 0x7c
633
634# CHECK: sradi. 2, 3, 4
6350x75 0x26 0x62 0x7c
636
637# CHECK: srad 2, 3, 4
6380x34 0x26 0x62 0x7c
639
640# CHECK: srad. 2, 3, 4
6410x35 0x26 0x62 0x7c
642
643# CHECK: mtspr 600, 2
6440xa6 0x93 0x58 0x7c
645
646# CHECK: mfspr 2, 600
6470xa6 0x92 0x58 0x7c
648
649# CHECK: mtcrf 123, 2
6500x20 0xb1 0x47 0x7c
651
652# CHECK: mfcr 2
6530x26 0x00 0x40 0x7c
654
655# CHECK: mtocrf 16, 2
6560x20 0x01 0x51 0x7c
657
658# CHECK: mfocrf 16, 8
6590x26 0x80 0x10 0x7e
660
661# CHECK: mtsrin 10, 12
6620xe4 0x61 0x40 0x7d
663# CHECK: mfsrin 10, 12
6640x26 0x65 0x40 0x7d
665