1# RUN: llvm-mc --disassemble %s -triple=xcore-xmos-elf | FileCheck %s
2
3# 0r instructions
4
5# CHECK: clre
60xed 0x07
7
8# CHECK: get r11, id
90xee 0x17
10
11# CHECK: get r11, ed
120xfe 0x0f
13
14# CHECK: get r11, et
150xff 0x0f
16
17# CHECK: ssync
180xee 0x07
19
20# CHECK: waiteu
210xec 0x07
22
23# CHECK: dcall
240xfc 0x07
25
26# CHECK: dentsp
270xec 0x17
28
29# CHECK: drestsp
300xed 0x17
31
32# CHECK: dret
330xfe 0x07
34
35# CHECK: freet
360xef 0x07
37
38# CHECK: get r11, kep
390xef 0x17
40
41# CHECK: get r11, ksp
420xfc 0x17
43
44# CHECK: kret
450xfd 0x07
46
47# CHECK: ldw et, sp[4]
480xfe 0x17
49
50# CHECK: ldw sed, sp[3]
510xfd 0x17
52
53# CHECK: ldw spc, sp[1]
540xec 0x0f
55
56# CHECK: ldw ssr, sp[2]
570xee 0x0f
58
59# CHECK: set kep, r11
600xff 0x07
61
62# CHECK: stw et, sp[4]
630xfd 0x0f
64
65# CHECK: stw sed, sp[3]
660xfc 0x0f
67
68# CHECK: stw spc, sp[1]
690xed 0x0f
70
71# CHECK: stw ssr, sp[2]
720xef 0x0f
73
74# 1r instructions
75
76# CHECK: msync res[r0]
770xf0 0x1f
78
79# CHECK: mjoin res[r1]
800xf1 0x17
81
82# CHECK: bau r2
830xf2 0x27
84
85# CHECK: set sp, r3
860xf3 0x2f
87
88# CHECK: ecallt r4
890xf4 0x4f
90
91# CHECK: ecallf r5
920xe5 0x4f
93
94# CHECK: bla r6
950xe6 0x27
96
97# CHECK: bru r8
980xe8 0x2f
99
100# CHECK: syncr res[r7]
1010xf7 0x87
102
103# CHECK: freer res[r8]
1040xe8 0x17
105
106# CHECK: setv res[r9], r11
1070xf9 0x47
108
109# CHECK: setev res[r10], r11
1100xfa 0x3f
111
112# CHECK: eeu res[r11]
1130xfb 0x07
114
115# CHECK: set dp, r5
1160xe5 0x37
117
118# CHECK: set cp, r0
1190xf0 0x37
120
121# CHECK: dgetreg r11
1220xeb 0x3f
123
124# CHECK: edu res[r8]
1250xe8 0x07
126
127# CHECK: kcall r2
1280xe2 0x47
129
130# CHECK: waitef r10
1310xfa 0x0f
132
133# CHECK: waitet r7
1340xe7 0x0f
135
136# CHECK: start t[r4]
1370xe4 0x1f
138
139# CHECK: clrpt res[r9]
1400xe9 0x87
141
142# 2r instructions
143
144# CHECK: not r1, r8
1450x24 0x8f
146
147# CHECK: neg r7, r6
1480xce 0x97
149
150# CHECK: andnot r10, r11
1510xab 0x2f
152
153# CHECK: mkmsk r11, r0
1540x4c 0xa7
155
156# CHECK: getts r8, res[r1]
1570x41 0x3f
158
159# CHECK: setpt res[r2], r3
1600xde 0x3e
161
162# CHECK: outct res[r1], r2
1630xc6 0x4e
164
165# CHECK: outt res[r5], r4
1660xd1 0x0f
167
168# CHECK: out res[r9], r10
1690xa9 0xaf
170
171# CHECK: outshr res[r0], r2
1720xd8 0xae
173
174# CHECK: inct r7, res[r4]
1750xdc 0x87
176
177# CHECK: int r8, res[r3]
1780x53 0x8f
179
180# CHECK: in r10, res[r0]
1810x48 0xb7
182
183# CHECK: inshr r4, res[r2]
1840x12 0xb7
185
186# CHECK: chkct res[r6], r0
1870x08 0xcf
188
189# CHECK: testct r8, res[r3]
1900x53 0xbf
191
192# CHECK: testwct r2, res[r9]
1930x39 0xc7
194
195# CHECK: setd res[r3], r4
1960x13 0x17
197
198# CHECK: getst r7, res[r1]
1990x1d 0x07
200
201# CHECK: init t[r1]:sp, r2
2020xc9 0x16
203
204# CHECK: init t[r10]:pc, r1
2050x26 0x07
206
207# CHECK: init t[r2]:cp, r10
2080x4a 0x1f
209
210# CHECK: init t[r2]:dp, r3
2110xce 0x0e
212
213# CHECK: setpsc res[r8], r2
2140x28 0xc7
215
216# CHECK: zext r3, r8
2170x2c 0x47
218
219# CHECK: sext r9, r1
2200x45 0x37
221
222# CHECK: tsetmr r7, r3
2230x1f 0x1f
224
225# CHECK: eef r1, res[r6]
2260x96 0x2f
227
228# CHECK: eet r11, res[r0]
2290x5c 0x27
230
231# rus instructions
232
233# CHECK: chkct res[r1], 8
2340x34 0xcf
235
236# CHECK: getr r11, 2
2370x4e 0x87
238
239# CHECK: mkmsk r4, 24
2400x72 0xa7
241
242# CHECK: outct res[r3], 0
2430xdc 0x4e
244
245# CHECK: sext r8, 16
2460xb1 0x37
247
248# CHECK: zext r2, 32
2490xd8 0x46
250
251# CHECK: peek r0, res[r5]
2520x81 0xbf
253
254# CHECK: endin r10, res[r1]
2550x59 0x97
256
257# l2r instructions
258
259# CHECK: bitrev r1, r10
2600x26 0xff 0xec 0x07
261
262# CHECK: byterev r4, r1
2630x11 0xff 0xec 0x07
264
265# CHECK: clz r11, r10
2660xae 0xff 0xec 0x0f
267
268# CHECK: get r3, ps[r6]
2690x9e 0xff 0xec 0x17
270
271# CHECK: setc res[r5], r9
2720x75 0xff 0xec 0x2f
273
274# CHECK: init t[r2]:lr, r1
2750xc6 0xfe 0xec 0x17
276
277# CHECK: setclk res[r2], r1
2780xd6 0xfe 0xec 0x0f
279
280# CHECK: set ps[r9], r10
2810xa9 0xff 0xec 0x1f
282
283# CHECK: setrdy res[r3], r1
2840xc7 0xfe 0xec 0x2f
285
286# CHECK: settw res[r7], r2
2870x9b 0xff 0xec 0x27
288
289# CHECK: getd r8, res[r3]
2900x53 0xff 0xec 0x1f
291
292# CHECK: getn r10, res[r11]
2930xbb 0xff 0xec 0x37
294
295# CHECK: testlcl r2, res[r0]
2960xc8 0xfe 0xec 0x27
297
298# CHECK: setn res[r9], r7
2990x6d 0xff 0xec 0x37
300
301# 3r instructions
302
303# CHECK: add r1, r2, r3
3040x1b 0x10
305
306# CHECK: and r11, r10, r9
3070xb9 0x3e
308
309# CHECK: eq r6, r1, r2
3100x66 0x30
311
312# CHECK: ld16s r8, r3[r4]
3130xcc 0x82
314
315# CHECK: ld8u r9, r1[r10]
3160x16 0x8d
317
318# CHECK: ldw r9, r4[r5]
3190x91 0x4b
320
321# CHECK: lss r7, r3, r0
3220x7c 0xc0
323
324# CHECK: lsu r5, r8, r6
3250x12 0xcc
326
327# CHECK: or r1, r3, r2
3280x1e 0x40
329
330# CHECK: shl r8, r2, r4
3310xc8 0x22
332
333# CHECK: shr r9, r7, r1
3340x5d 0x29
335
336# CHECK: sub r4, r2, r5
3370x89 0x1a
338
339# CHECK: set t[r0]:r1, r2
3400x18 0xb8
341
342# 2rus instructions
343
344# CHECK: add r10, r2, 5
3450xe9 0x92
346
347# CHECK: eq r2, r1, 0
3480x24 0xb0
349
350# CHECK: ldw r5, r6[1]
3510x19 0x09
352
353# CHECK: shl r6, r5, 24
3540xa6 0xa5
355
356# CHECK: shr r3, r8, 5
3570xf1 0xab
358
359# CHECK: stw r3, r2[0]
3600x38 0x00
361
362# CHECK: sub r2, r4, 11
3630x63 0x9d
364
365# l3r instructions
366
367# CHECK: ashr r5, r1, r11
3680xd7 0xfc 0xec 0x17
369
370# CHECK: crc32 r5, r6, r1
3710x19 0xf9 0xec 0xaf
372
373# CHECK: divu r9, r1, r3
3740x97 0xf8 0xec 0x4f
375
376# CHECK: divs r6, r7, r2
3770x2e 0xf9 0xec 0x47
378
379# CHECK: lda16 r11, r2[r1]
3800xb9 0xf8 0xec 0x2f
381
382# CHECK: lda16 r9, r3[-r11]
3830x1f 0xfd 0xec 0x37
384
385# CHECK: ldaw r9, r1[r2]
3860x96 0xf8 0xec 0x1f
387
388# CHECK: ldaw r8, r7[-r11]
3890xcf 0xfd 0xec 0x27
390
391# CHECK: mul r0, r4, r2
3920xc2 0xf8 0xec 0x3f
393
394# CHECK: remu r1, r2, r3
3950x1b 0xf8 0xec 0xcf
396
397# CHECK: rems r11, r10, r9
3980xb9 0xfe 0xec 0xc7
399
400# CHECK: st16 r5, r3[r8]
4010xdc 0xfc 0xec 0x87
402
403# CHECK: st8 r9, r1[r3]
4040x97 0xf8 0xec 0x8f
405
406# CHECK: stw r7, r10[r1]
4070xf9 0xf9 0xec 0x07
408
409# CHECK: xor r4, r3, r9
4100xcd 0xfc 0xec 0x0f
411
412# l2rus instructions
413
414# CHECK: ashr r5, r1, 3
4150x57 0xf8 0xec 0x97
416
417# CHECK: ldaw r11, r10[6]
4180x7a 0xfc 0xec 0x9f
419
420# CHECK: ldaw r8, r2[-9]
4210x09 0xfd 0xec 0xa7
422
423# CHECK: inpw r6, res[r1], 8
4240xe4 0xfc 0xee 0x97
425
426# CHECK: outpw res[r3], r0, 2
4270x0e 0xf8 0xed 0x97
428
429# ru6 / lru6 instructions
430
431# CHECK: bt r6, -5
4320x85 0x75
433
434# CHECK: bt r10, -451
4350x07 0xf0 0x83 0x76
436
437# CHECK: bt r8, 10
4380x0a 0x72
439
440# CHECK: bt r1, 6451
4410x64 0xf0 0x73 0x70
442
443# CHECK: bf r5, 8
4440x48 0x79
445
446# CHECK: bf r6, 65
4470x01 0xf0 0x81 0x79
448
449# CHECK: bf r1, 53
4500x75 0x78
451
452# CHECK: bf r10, 101
4530x01 0xf0 0xa5 0x7a
454
455# CHECK: ldaw r11, dp[63]
4560xff 0x62
457
458# CHECK: ldaw r1, dp[456]
4590x07 0xf0 0x48 0x60
460
461# CHECK: ldaw cp, dp[5]
4620x05 0x63
463
464# CHECK: ldaw sp, dp[9929]
4650x9b 0xf0 0x89 0x63
466
467# CHECK: ldaw r3, sp[2]
4680xc2 0x64
469
470# CHECK: ldaw r8, sp[65535]
4710xff 0xf3 0x3f 0x66
472
473# CHECK: ldaw sp, sp[41]
4740xa9 0x67
475
476# CHECK: ldaw sp, sp[13121]
4770xcd 0xf0 0x81 0x67
478
479# CHECK: ldc r3, 30
4800xde 0x68
481
482# CHECK: ldc r11, 1000
4830x0f 0xf0 0xe8 0x6a
484
485# CHECK: ldc sp, 0
4860x80 0x6b
487
488# CHECK: ldc lr, 81
4890x01 0xf0 0xd1 0x6b
490
491# CHECK: ldw r0, cp[4]
4920x04 0x6c
493
494# CHECK: ldw r1, cp[32345]
4950xf9 0xf1 0x59 0x6c
496
497# CHECK: ldw cp, cp[8]
4980x08 0x6f
499
500# CHECK: ldw sp, cp[10222]
5010x9f 0xf0 0xae 0x6f
502
503# CHECK: ldw r10, dp[16]
5040x90 0x5a
505
506# CHECK: ldw r10, dp[76]
5070x01 0xf0 0x8c 0x5a
508
509# CHECK: ldw lr, dp[8]
5100xc8 0x5b
511
512# CHECK: ldw dp, dp[33221]
5130x07 0xf2 0x45 0x5b
514
515# CHECK: ldw r8, sp[51]
5160x33 0x5e
517
518# CHECK: ldw r8, sp[1225]
5190x13 0xf0 0x09 0x5e
520
521# CHECK: ldw cp, sp[31]
5220x1f 0x5f
523
524# CHECK: ldw sp, sp[1000]
5250x0f 0xf0 0xa8 0x5f
526
527# CHECK: setc res[r5], 36
5280x64 0xe9
529
530# CHECK: setc res[r2], 40312
5310x75 0xf2 0xb8 0xe8
532
533# CHECK: stw r8, dp[14]
5340x0e 0x52
535
536# CHECK: stw r9, dp[654]
5370x0a 0xf0 0x4e 0x52
538
539# CHECK: stw lr, dp[23]
5400xd7 0x53
541
542# CHECK: stw sp, dp[44442]
5430xb6 0xf2 0x9a 0x53
544
545# CHECK: stw r1, sp[32]
5460x60 0x54
547
548# CHECK: stw r0, sp[8761]
5490x88 0xf0 0x39 0x54
550
551# CHECK: stw cp, sp[63]
5520x3f 0x57
553
554# CHECK: stw lr, sp[4391]
5550x44 0xf0 0xe7 0x57
556
557# u6 / lu6 instructions
558
559# CHECK: bu -20
5600x14 0x77
561
562# CHECK: bu -1000
5630x0f 0xf0 0x28 0x77
564
565# CHECK: bu 24
5660x18 0x73
567
568# CHECK: bu 2231
5690x22 0xf0 0x37 0x73
570
571# CHECK: extsp 9
5720x89 0x77
573
574# CHECK: extsp 5721
5750x59 0xf0 0x99 0x77
576
577# CHECK: clrsr 60
5780x3c 0x7b
579
580# CHECK: clrsr 64391
5810xee 0xf3 0x07 0x7b
582
583# CHECK: entsp 1
5840x41 0x77
585
586# CHECK: entsp 70
5870x01 0xf0 0x46 0x77
588
589# CHECK: ldaw r11, cp[5]
5900x45 0x7f
591
592# CHECK: ldaw r11, cp[33000]
5930x03 0xf2 0x68 0x7f
594
595# CHECK: retsp 40
5960xe8 0x77
597
598# CHECK: retsp 52010
5990x2c 0xf3 0xea 0x77
600
601# CHECK: setsr 42
6020x6a 0x7b
603
604# CHECK: setsr 21863
6050x55 0xf1 0x67 0x7b
606
607# CHECK: extdp 4
6080x84 0x73
609
610# CHECK: extdp 554
6110x08 0xf0 0xaa 0x73
612
613# CHECK: blat 9
6140x49 0x73
615
616# CHECK: blat 61212
6170xbc 0xf3 0x5c 0x73
618
619# CHECK: getsr r11, 54
6200x36 0x7f
621
622# CHECK: getsr r11, 442
6230x06 0xf0 0x3a 0x7f
624
625# CHECK: kcall 11
6260xcb 0x73
627
628# CHECK: kcall 4001
6290x3e 0xf0 0xe1 0x73
630
631# CHECK: kentsp 22
6320x96 0x7b
633
634# CHECK: kentsp 8793
6350x89 0xf0 0x99 0x7b
636
637# CHECK: krestsp 0
6380xc0 0x7b
639
640# CHECK: krestsp 55312
6410x60 0xf3 0xd0 0x7b
642
643# u10 / lu10 instructions
644
645# CHECK: ldap r11, 40
6460x28 0xd8
647
648# CHECK: ldap r11, 53112
6490x33 0xf0 0x78 0xdb
650
651# CHECK: ldap r11, -22
6520x16 0xdc
653
654# CHECK: ldap r11, -9999
6550x09 0xf0 0x0f 0xdf
656
657# CHECK: bl 8
6580x08 0xd0
659
660# CHECK: bl 38631
6610x25 0xf0 0xe7 0xd2
662
663# CHECK: bl -222
6640xde 0xd4
665
666# CHECK: bl -55132
6670x35 0xf0 0x5c 0xd7
668
669# CHECK: bla cp[500]
6700xf4 0xe1
671
672# CHECK: bla cp[413742]
6730x94 0xf1 0x2e 0xe0
674
675# CHECK: ldw r11, cp[132]
6760x84 0xe4
677
678# CHECK: ldw r11, cp[102741]
6790x64 0xf0 0x55 0xe5
680
681# l6r instructions
682
683# CHECK: lmul r11, r0, r2, r5, r8, r10
6840xf9 0xfa 0x02 0x06
685
686# l5r instructions
687
688# CHECK: ladd r10, r2, r5, r1, r7
6890xe5 0xf8 0xfb 0x06
690
691# CHECK: ldivu r5, r6, r3, r9, r8
6920x54 0xfe 0x0b 0x07
693
694# CHECK: lsub r1, r8, r7, r11, r5
6950xcf 0xfd 0x85 0x0f
696
697# l4r instructions
698
699# CHECK: crc8 r6, r3, r4, r11
7000x73 0xfd 0xe6 0x07
701
702# CHECK: maccs r11, r8, r2, r4
7030xf8 0xfa 0xe8 0x0f
704
705# CHECK: maccu r0, r2, r5, r8
7060x44 0xfd 0xf2 0x07
707