summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.arch/arc-decode-insn.S
blob: f20842e32b94b8a23cb5481b24828d0f5e388669 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
; This testcase is part of GDB, the GNU debugger.

; Copyright 2017-2020 Free Software Foundation, Inc.

; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program.  If not, see <http://www.gnu.org/licenses/>.

.section .text
.global main

#define TEST_J
#define TEST_JCC
#define TEST_JL
#define TEST_JLCC
#define TEST_B
#define TEST_BBIT
#define TEST_BCC
#define TEST_BI
#define TEST_BL
#define TEST_BRCC
#define TEST_JLI
#define TEST_LEAVE_S
#define TEST_LPCC

; JLI-specific stuff
#ifdef TEST_JLI
jli_table:
    .word 0xdeadbeea
    .word 0xdeadbeea
jli_target:
    .word 0xdeadbeea
    .word 0xdeadbeea

.set jli_offset, 3
#endif
main:

; Each test case requires several symbols to be set, that identify expected
; parameters of this instruction.  Required symbols:
;   ${test}_start: symbol points to start of the test
;   ${test}_end: symbol points to the instruction after the jump/branch
;      instruction.
;   ${test}_target: branch target address.
;   ${test}_has_delay_slot: whether instruction has delay slot.
;   ${test}_cc: condition code numeric value.

    .set r12_value, 0xdead0000
    .set blink_value, 0xdead0004
    .set limm_value, 0xdead0008
    ; Just an integer
    .set r4_value, 0xdead000c
    ; Just an integer
    .set r5_value, 0xdead0010
    ; offset index for BI [c]
    .set r7_value, 4
    .set u6_value, 0x20
    .set s12_target, 0x100

    mov r12, @r12_value
    mov r4, @r4_value
    mov r5, @r5_value
    mov r7, @r7_value
    mov blink, @blink_value
#ifdef TEST_JLI
    ; jli_base aux regnum = 0x290
    sr jli_table, [0x290]
#endif

start_branch_tests:

#ifdef TEST_J

#define TEST_NAME j_c
    ; j [c]
    .set j_c_target, @r4_value
    .set j_c_has_delay_slot,   0
    .set j_c_cc, 0
    j_c_start:
	j [r4]
    j_c_end:

    ; j [blink]
    .set j_blink_target, @blink_value
    .set j_blink_has_delay_slot,   0
    .set j_blink_cc, 0
    mov blink, @j_blink_target
    j_blink_start:
	j [blink]
    j_blink_end:

    ; j limm
    .set j_limm_target, @limm_value
    .set j_limm_has_delay_slot,   0
    .set j_limm_cc, 0
    j_limm_start:
	j @j_limm_target
    j_limm_end:

    ; j u6
    .set j_u6_target, @u6_value
    .set j_u6_has_delay_slot,   0
    .set j_u6_cc, 0
    j_u6_start:
	j @j_u6_target
    j_u6_end:

    ; j s12
    .set j_s12_target, @s12_target
    .set j_s12_has_delay_slot,   0
    .set j_s12_cc, 0
    j_s12_start:
	j @j_s12_target
    j_s12_end:

    ; j.d [c]
    .set j_d_c_target, @r4_value
    .set j_d_c_has_delay_slot,   1
    .set j_d_c_cc, 0
    j_d_c_start:
	j.d [r4]
    j_d_c_end:
	nop_s

    ; j.d [blink]
    .set j_d_blink_target, @blink_value
    .set j_d_blink_has_delay_slot,   1
    .set j_d_blink_cc, 0
    j_d_blink_start:
	j.d [blink]
    j_d_blink_end:
	nop_s

    ; j.d u6
    .set j_d_u6_target, @u6_value
    .set j_d_u6_has_delay_slot,   1
    .set j_d_u6_cc, 0
    j_d_u6_start:
	j.d @j_d_u6_target
    j_d_u6_end:
	nop_s

    ; j.d s12
    .set j_d_s12_target, @s12_target
    .set j_d_s12_has_delay_slot,   1
    .set j_d_s12_cc, 0
    j_d_s12_start:
	j.d @j_d_s12_target
    j_d_s12_end:
	nop_s

    ; j_s [b]
    .set j_s_b_target, @r12_value
    .set j_s_b_has_delay_slot,   0
    .set j_s_b_cc, 0
    j_s_b_start:
	j_s [r12]
    j_s_b_end:

    ; j_s.d [b]
    .set j_s_d_b_target, @r12_value
    .set j_s_d_b_has_delay_slot,   1
    .set j_s_d_b_cc, 0
    j_s_d_b_start:
	j_s.d [r12]
    j_s_d_b_end:
	nop_s

    ; j_s [blink]
    .set j_s_blink_target, @blink_value
    .set j_s_blink_has_delay_slot,   0
    .set j_s_blink_cc, 0
    j_s_blink_start:
	j_s [blink]
    j_s_blink_end:

    ; j_s.d [blink]
    .set j_s_d_blink_target, @blink_value
    .set j_s_d_blink_has_delay_slot,   1
    .set j_c_cc, 0
    j_s_d_blink_start:
	j_s.d [blink]
    j_s_d_blink_end:
	nop_s
#endif /* TEST_J */

#ifdef TEST_JCC
    ; jcc [c]
    .set jcc_c_target, @r4_value
    .set jcc_c_has_delay_slot,   0
    .set jcc_c_cc, 1
    jcc_c_start:
	jeq [r4]
    jcc_c_end:

    ; jcc [blink]
    .set jcc_blink_target, @blink_value
    .set jcc_blink_has_delay_slot,   0
    .set jcc_blink_cc, 2
    jcc_blink_start:
	jnz [blink]
    jcc_blink_end:

    ; jcc limm
    .set jcc_limm_target, @limm_value
    .set jcc_limm_has_delay_slot,   0
    .set jcc_limm_cc, 9
    jcc_limm_start:
	jgt @jcc_limm_target
    jcc_limm_end:

    ; jcc u6
    .set jcc_u6_target, @u6_value
    .set jcc_u6_has_delay_slot,   0
    .set jcc_u6_cc, 0xA
    jcc_u6_start:
	jge @jcc_u6_target
    jcc_u6_end:

    ; jcc.d [c]
    .set jcc_d_c_target, @r4_value
    .set jcc_d_c_has_delay_slot,   1
    .set jcc_d_c_cc, 0xB
    jcc_d_c_start:
	jlt.d [r4]
    jcc_d_c_end:
	nop_s

    ; jcc.d [blink]
    .set jcc_d_blink_target, @blink_value
    .set jcc_d_blink_has_delay_slot,   1
    .set jcc_d_blink_cc, 0xC
    jcc_d_blink_start:
	jle.d [blink]
    jcc_d_blink_end:
	nop_s

    ; jcc.d u6
    .set jcc_d_u6_target, @u6_value
    .set jcc_d_u6_has_delay_slot,   1
    .set jcc_d_u6_cc, 0xE
    jcc_d_u6_start:
	jls.d @jcc_d_u6_target
    jcc_d_u6_end:
	nop_s

    ; jeq_s [blink]
    .set jcc_eq_s_blink_target, @blink_value
    .set jcc_eq_s_blink_has_delay_slot,   0
    .set jcc_eq_s_blink_cc, 1
    jcc_eq_s_blink_start:
	jeq_s [blink]
    jcc_eq_s_blink_end:

    ; jne_s [blink]
    .set jcc_ne_s_blink_target, @blink_value
    .set jcc_ne_s_blink_has_delay_slot,   0
    .set jcc_ne_s_blink_cc, 2
    jcc_ne_s_blink_start:
	jne_s [blink]
    jcc_ne_s_blink_end:
#endif /* TEST_JCC */

#ifdef TEST_JL
    ; jl [c]
    .set jl_c_target, @r4_value
    .set jl_c_has_delay_slot,   0
    .set jl_c_cc, 0
    jl_c_start:
	jl [r4]
    jl_c_end:

    ; jl limm
    .set jl_limm_target, @limm_value
    .set jl_limm_has_delay_slot,   0
    .set jl_limm_cc, 0
    jl_limm_start:
	jl @jl_limm_target
    jl_limm_end:

    ; jl u6
    .set jl_u6_target, @u6_value
    .set jl_u6_has_delay_slot,   0
    .set jl_u6_cc, 0
    jl_u6_start:
	jl @jl_u6_target
    jl_u6_end:

    ; jl s12
    .set jl_s12_target, @s12_target
    .set jl_s12_has_delay_slot,   0
    .set jl_s12_cc, 0
    jl_s12_start:
	jl @jl_s12_target
    jl_s12_end:

    ; jl.d [c]
    .set jl_d_c_target, @r4_value
    .set jl_d_c_has_delay_slot,   1
    .set jl_d_c_cc, 0
    jl_d_c_start:
	jl.d [r4]
    jl_d_c_end:
	nop_s

    ; jl.d u6
    .set jl_d_u6_target, @u6_value
    .set jl_d_u6_has_delay_slot,   1
    .set jl_d_u6_cc, 0
    jl_d_u6_start:
	jl.d @jl_d_u6_target
    jl_d_u6_end:
	nop_s

    ; jl.d s12
    .set jl_d_s12_target, @s12_target
    .set jl_d_s12_has_delay_slot,   1
    .set jl_d_s12_cc, 0
    jl_d_s12_start:
	jl.d @jl_d_s12_target
    jl_d_s12_end:
	nop_s

    ; jl_s [b]
    .set jl_s_b_target, @r12_value
    .set jl_s_b_has_delay_slot,   0
    .set jl_s_b_cc, 0
    jl_s_b_start:
	jl_s [r12]
    jl_s_b_end:

    ; jl_s.d [b]
    .set jl_s_d_b_target, @r12_value
    .set jl_s_d_b_has_delay_slot,   1
    .set jl_s_d_b_cc, 0
    jl_s_d_b_start:
	jl_s.d [r12]
    jl_s_d_b_end:
	nop_s
#endif /* TEST_JL */

#ifdef TEST_JLCC
    ; jlcc [c]
    .set jlcc_c_target, @r4_value
    .set jlcc_c_has_delay_slot,   0
    .set jlcc_c_cc, 1
    jlcc_c_start:
	jleq [r4]
    jlcc_c_end:

    ; jlcc limm
    .set jlcc_limm_target, @limm_value
    .set jlcc_limm_has_delay_slot,   0
    .set jlcc_limm_cc, 0x9
    jlcc_limm_start:
	jlgt @jlcc_limm_target
    jlcc_limm_end:

    ; jlcc u6
    .set jlcc_u6_target, @u6_value
    .set jlcc_u6_has_delay_slot,   0
    .set jlcc_u6_cc, 0xA
    jlcc_u6_start:
	jlge @jlcc_u6_target
    jlcc_u6_end:

    ; jlcc.d [c]
    .set jlcc_d_c_target, @r4_value
    .set jlcc_d_c_has_delay_slot,   1
    .set jlcc_d_c_cc, 0xB
    jlcc_d_c_start:
	jllt.d [r4]
    jlcc_d_c_end:
	nop_s

    ; jlcc.d u6
    .set jlcc_d_u6_target, @u6_value
    .set jlcc_d_u6_has_delay_slot,   1
    .set jlcc_d_u6_cc, 0xE
    jlcc_d_u6_start:
	jlls.d @jlcc_d_u6_target
    jlcc_d_u6_end:
	nop_s
#endif /* TEST_JLCC */

#ifdef TEST_B
.Lb_target:
    ; Artifical nop, so that first b will not branch to itself.
    nop_s
    ; b s25
    .set b_s25_target, @.Lb_target
    .set b_s25_has_delay_slot,   0
    .set b_s25_cc, 0
    b_s25_start:
	b @b_s25_target
    b_s25_end:

    ; b.d s25
    .set b_d_s25_target, @.Lb_target
    .set b_d_s25_has_delay_slot,   1
    .set b_d_s25_cc, 0
    b_d_s25_start:
	b.d @b_d_s25_target
    b_d_s25_end:
	nop_s

    ; b_s s10
    .set b_s_s10_target, @.Lb_target
    .set b_s_s10_has_delay_slot,   0
    .set b_s_s10_cc, 0
    b_s_s10_start:
	b_s @b_s_s10_target
    b_s_s10_end:
#endif /* TEST_B */

#ifdef TEST_BBIT

; Due to specifics of bbit implementation in assembler, only local symbols can
; be used as a branch targets for bbit and brcc.
; bbits and brcc don't have condition code set to anything.
.Lbbit_target:
    nop_s

    ; bbit0.nt b,c,s9
    .set bbit0_nt_b_c_s9_target, @.Lbbit_target
    .set bbit0_nt_b_c_s9_has_delay_slot,   0
    .set bbit0_nt_b_c_s9_cc, 0
    bbit0_nt_b_c_s9_start:
	bbit0.nt r4,r5,@bbit0_nt_b_c_s9_target
    bbit0_nt_b_c_s9_end:

    ; bbit0.d.nt b,c,s9
    .set bbit0_d_nt_b_c_s9_target, @.Lbbit_target
    .set bbit0_d_nt_b_c_s9_has_delay_slot,   1
    .set bbit0_d_nt_b_c_s9_cc, 0
    bbit0_d_nt_b_c_s9_start:
	bbit0.d.nt r4,r5,@.Lbbit_target
    bbit0_d_nt_b_c_s9_end:
	nop_s

    ; bbit0.t b,c,s9
    .set bbit0_t_b_c_s9_target, @.Lbbit_target
    .set bbit0_t_b_c_s9_has_delay_slot,   0
    .set bbit0_t_b_c_s9_cc, 0
    bbit0_t_b_c_s9_start:
	bbit0.t r4,r5,@.Lbbit_target
    bbit0_t_b_c_s9_end:

    ; bbit0.d.t b,c,s9
    .set bbit0_d_t_b_c_s9_target, @.Lbbit_target
    .set bbit0_d_t_b_c_s9_has_delay_slot,   1
    .set bbit0_d_t_b_c_s9_cc, 0
    bbit0_d_t_b_c_s9_start:
	bbit0.d.t r4,r5,@.Lbbit_target
    bbit0_d_t_b_c_s9_end:
	nop_s

    ; bbit0.nt b,u6,s9
    .set bbit0_nt_b_u6_s9_target, @.Lbbit_target
    .set bbit0_nt_b_u6_s9_has_delay_slot,   0
    .set bbit0_nt_b_u6_s9_cc, 0
    bbit0_nt_b_u6_s9_start:
	bbit0.nt r4,u6_value,@.Lbbit_target
    bbit0_nt_b_u6_s9_end:

    ; bbit0.d.nt b,u6,s9
    .set bbit0_d_nt_b_u6_s9_target, @.Lbbit_target
    .set bbit0_d_nt_b_u6_s9_has_delay_slot,   1
    .set bbit0_d_nt_b_u6_s9_cc, 0
    bbit0_d_nt_b_u6_s9_start:
	bbit0.d.nt r4,u6_value,@.Lbbit_target
    bbit0_d_nt_b_u6_s9_end:
	nop_s

    ; bbit0.nt b,u6,s9
    .set bbit0_t_b_u6_s9_target, @.Lbbit_target
    .set bbit0_t_b_u6_s9_has_delay_slot,   0
    .set bbit0_t_b_u6_s9_cc, 0
    bbit0_t_b_u6_s9_start:
	bbit0.t r4,u6_value,@.Lbbit_target
    bbit0_t_b_u6_s9_end:

    ; bbit0.d.nt b,u6,s9
    .set bbit0_d_t_b_u6_s9_target, @.Lbbit_target
    .set bbit0_d_t_b_u6_s9_has_delay_slot,   1
    .set bbit0_d_t_b_u6_s9_cc, 0
    bbit0_d_t_b_u6_s9_start:
	bbit0.d.t r4,u6_value,@.Lbbit_target
    bbit0_d_t_b_u6_s9_end:
	nop_s

    ; bbit0.nt b,limm,s9
    .set bbit0_nt_b_limm_s9_target, @.Lbbit_target
    .set bbit0_nt_b_limm_s9_has_delay_slot,   0
    .set bbit0_nt_b_limm_s9_cc, 0
    bbit0_nt_b_limm_s9_start:
	bbit0.nt r4,limm_value,@.Lbbit_target
    bbit0_nt_b_limm_s9_end:

    ; bbit0.t b,limm,s9
    .set bbit0_t_b_limm_s9_target, @.Lbbit_target
    .set bbit0_t_b_limm_s9_has_delay_slot,   0
    .set bbit0_t_b_limm_s9_cc, 0
    bbit0_t_b_limm_s9_start:
	bbit0.t r4,limm_value,@.Lbbit_target
    bbit0_t_b_limm_s9_end:

    ; bbit0.nt limm,c,s9
    .set bbit0_nt_limm_c_s9_target, @.Lbbit_target
    .set bbit0_nt_limm_c_s9_has_delay_slot,   0
    .set bbit0_nt_limm_c_s9_cc, 0
    bbit0_nt_limm_c_s9_start:
	bbit0.nt limm_value,r4,@.Lbbit_target
    bbit0_nt_limm_c_s9_end:

    ; bbit0.t limm,c,s9
    .set bbit0_t_limm_c_s9_target, @.Lbbit_target
    .set bbit0_t_limm_c_s9_has_delay_slot,   0
    .set bbit0_t_limm_c_s9_cc, 0
    bbit0_t_limm_c_s9_start:
	bbit0.t limm_value,r4,@.Lbbit_target
    bbit0_t_limm_c_s9_end:

    ; bbit0.nt limm,u6,s9
    .set bbit0_nt_limm_u6_s9_target, @.Lbbit_target
    .set bbit0_nt_limm_u6_s9_has_delay_slot,   0
    .set bbit0_nt_limm_u6_s9_cc, 0
    bbit0_nt_limm_u6_s9_start:
	bbit0.nt limm_value,u6_value,@.Lbbit_target
    bbit0_nt_limm_u6_s9_end:

    ; bbit0.t limm,u6,s9
    .set bbit0_t_limm_u6_s9_target, @.Lbbit_target
    .set bbit0_t_limm_u6_s9_has_delay_slot,   0
    .set bbit0_t_limm_u6_s9_cc, 0
    bbit0_t_limm_u6_s9_start:
	bbit0.t limm_value,u6_value,@.Lbbit_target
    bbit0_t_limm_u6_s9_end:

    ; bbit1.nt b,c,s9
    .set bbit1_nt_b_c_s9_target, @.Lbbit_target
    .set bbit1_nt_b_c_s9_has_delay_slot,   0
    .set bbit1_nt_b_c_s9_cc, 0
    bbit1_nt_b_c_s9_start:
	bbit1.nt r4,r5,@.Lbbit_target
    bbit1_nt_b_c_s9_end:

    ; bbit1.d.nt b,c,s9
    .set bbit1_d_nt_b_c_s9_target, @.Lbbit_target
    .set bbit1_d_nt_b_c_s9_has_delay_slot,   1
    .set bbit1_d_nt_b_c_s9_cc, 0
    bbit1_d_nt_b_c_s9_start:
	bbit1.d.nt r4,r5,@.Lbbit_target
    bbit1_d_nt_b_c_s9_end:
	nop_s

    ; bbit1.t b,c,s9
    .set bbit1_t_b_c_s9_target, @.Lbbit_target
    .set bbit1_t_b_c_s9_has_delay_slot,   0
    .set bbit1_t_b_c_s9_cc, 0
    bbit1_t_b_c_s9_start:
	bbit1.t r4,r5,@.Lbbit_target
    bbit1_t_b_c_s9_end:

    ; bbit1.d.t b,c,s9
    .set bbit1_d_t_b_c_s9_target, @.Lbbit_target
    .set bbit1_d_t_b_c_s9_has_delay_slot,   1
    .set bbit1_d_t_b_c_s9_cc, 0
    bbit1_d_t_b_c_s9_start:
	bbit1.d.t r4,r5,@.Lbbit_target
    bbit1_d_t_b_c_s9_end:
	nop_s

    ; bbit1.nt b,u6,s9
    .set bbit1_nt_b_u6_s9_target, @.Lbbit_target
    .set bbit1_nt_b_u6_s9_has_delay_slot,   0
    .set bbit1_nt_b_u6_s9_cc, 0
    bbit1_nt_b_u6_s9_start:
	bbit1.nt r4,u6_value,@.Lbbit_target
    bbit1_nt_b_u6_s9_end:

    ; bbit1.d.nt b,u6,s9
    .set bbit1_d_nt_b_u6_s9_target, @.Lbbit_target
    .set bbit1_d_nt_b_u6_s9_has_delay_slot,   1
    .set bbit1_d_nt_b_u6_s9_cc, 0
    bbit1_d_nt_b_u6_s9_start:
	bbit1.d.nt r4,u6_value,@.Lbbit_target
    bbit1_d_nt_b_u6_s9_end:
	nop_s

    ; bbit1.nt b,u6,s9
    .set bbit1_t_b_u6_s9_target, @.Lbbit_target
    .set bbit1_t_b_u6_s9_has_delay_slot,   0
    .set bbit1_t_b_u6_s9_cc, 0
    bbit1_t_b_u6_s9_start:
	bbit1.t r4,u6_value,@.Lbbit_target
    bbit1_t_b_u6_s9_end:

    ; bbit1.d.nt b,u6,s9
    .set bbit1_d_t_b_u6_s9_target, @.Lbbit_target
    .set bbit1_d_t_b_u6_s9_has_delay_slot,   1
    .set bbit1_d_t_b_u6_s9_cc, 0
    bbit1_d_t_b_u6_s9_start:
	bbit1.d.t r4,u6_value,@.Lbbit_target
    bbit1_d_t_b_u6_s9_end:
	nop_s

    ; bbit1.nt b,limm,s9
    .set bbit1_nt_b_limm_s9_target, @.Lbbit_target
    .set bbit1_nt_b_limm_s9_has_delay_slot,   0
    .set bbit1_nt_b_limm_s9_cc, 0
    bbit1_nt_b_limm_s9_start:
	bbit1.nt r4,limm_value,@.Lbbit_target
    bbit1_nt_b_limm_s9_end:

    ; bbit1.t b,limm,s9
    .set bbit1_t_b_limm_s9_target, @.Lbbit_target
    .set bbit1_t_b_limm_s9_has_delay_slot,   0
    .set bbit1_t_b_limm_s9_cc, 0
    bbit1_t_b_limm_s9_start:
	bbit1.t r4,limm_value,@.Lbbit_target
    bbit1_t_b_limm_s9_end:

    ; bbit1.nt limm,c,s9
    .set bbit1_nt_limm_c_s9_target, @.Lbbit_target
    .set bbit1_nt_limm_c_s9_has_delay_slot,   0
    .set bbit1_nt_limm_c_s9_cc, 0
    bbit1_nt_limm_c_s9_start:
	bbit1.nt limm_value,r4,@.Lbbit_target
    bbit1_nt_limm_c_s9_end:

    ; bbit1.t limm,c,s9
    .set bbit1_t_limm_c_s9_target, @.Lbbit_target
    .set bbit1_t_limm_c_s9_has_delay_slot,   0
    .set bbit1_t_limm_c_s9_cc, 0
    bbit1_t_limm_c_s9_start:
	bbit1.t limm_value,r4,@.Lbbit_target
    bbit1_t_limm_c_s9_end:

    ; bbit1.nt limm,u6,s9
    .set bbit1_nt_limm_u6_s9_target, @.Lbbit_target
    .set bbit1_nt_limm_u6_s9_has_delay_slot,   0
    .set bbit1_nt_limm_u6_s9_cc, 0
    bbit1_nt_limm_u6_s9_start:
	bbit1.nt limm_value,u6_value,@.Lbbit_target
    bbit1_nt_limm_u6_s9_end:

    ; bbit1.t limm,u6,s9
    .set bbit1_t_limm_u6_s9_target, @.Lbbit_target
    .set bbit1_t_limm_u6_s9_has_delay_slot,   0
    .set bbit1_t_limm_u6_s9_cc, 0
    bbit1_t_limm_u6_s9_start:
	bbit1.t limm_value,u6_value,@.Lbbit_target
    bbit1_t_limm_u6_s9_end:
#endif /* TEST_BBIT */

#ifdef TEST_BCC
.Lbcc_target:
    ; bcc s21
    .set bcc_s21_target, @.Lbcc_target
    .set bcc_s21_has_delay_slot,   0
    .set bcc_s21_cc, 1
    bcc_s21_start:
	; beq @bcc_s21_target
	beq @.Lbcc_target
    bcc_s21_end:

    ; bcc.d s21
    .set bcc_d_s21_target, @.Lbcc_target
    .set bcc_d_s21_has_delay_slot,   1
    .set bcc_d_s21_cc, 1
    bcc_d_s21_start:
	beq.d @bcc_d_s21_target
    bcc_d_s21_end:
	nop_s

.Lbcc_s_target:
    ; beq_s s10
    .set beq_s_s10_target, @.Lbcc_s_target
    .set beq_s_s10_has_delay_slot,   0
    .set beq_s_s10_cc, 1
    beq_s_s10_start:
	# beq_s.d @beq_s_s10_target
	beq_s @.Lbcc_s_target
    beq_s_s10_end:

    ; bne_s s10
    .set bne_s_s10_target, @.Lbcc_s_target
    .set bne_s_s10_has_delay_slot,   0
    .set bne_s_s10_cc, 2
    bne_s_s10_start:
	bne_s @bne_s_s10_target
    bne_s_s10_end:

    ; bgt_s s7
    .set bgt_s_s7_target, @.Lbcc_s_target
    .set bgt_s_s7_has_delay_slot,   0
    .set bgt_s_s7_cc, 0x9
    bgt_s_s7_start:
	bgt_s @bgt_s_s7_target
    bgt_s_s7_end:

    ; bge_s s7
    .set bge_s_s7_target, @.Lbcc_s_target
    .set bge_s_s7_has_delay_slot,   0
    .set bge_s_s7_cc, 0xA
    bge_s_s7_start:
	bge_s @bge_s_s7_target
    bge_s_s7_end:

    ; blt_s s7
    .set blt_s_s7_target, @.Lbcc_s_target
    .set blt_s_s7_has_delay_slot,   0
    .set blt_s_s7_cc, 0xB
    blt_s_s7_start:
	blt_s @blt_s_s7_target
    blt_s_s7_end:

    ; ble_s s7
    .set ble_s_s7_target, @.Lbcc_s_target
    .set ble_s_s7_has_delay_slot,   0
    .set ble_s_s7_cc, 0xC
    ble_s_s7_start:
	ble_s @ble_s_s7_target
    ble_s_s7_end:

    ; bhi_s s7
    .set bhi_s_s7_target, @.Lbcc_s_target
    .set bhi_s_s7_has_delay_slot,   0
    .set bhi_s_s7_cc, 0xD
    bhi_s_s7_start:
	bhi_s @bhi_s_s7_target
    bhi_s_s7_end:

    ; bhs_s s7
    .set bhs_s_s7_target, @.Lbcc_s_target
    .set bhs_s_s7_has_delay_slot,   0
    .set bhs_s_s7_cc, 0x6
    bhs_s_s7_start:
	bhs_s @bhs_s_s7_target
    bhs_s_s7_end:

    ; blo_s s7
    .set blo_s_s7_target, @.Lbcc_s_target
    .set blo_s_s7_has_delay_slot,   0
    .set blo_s_s7_cc, 0x5
    blo_s_s7_start:
	blo_s @blo_s_s7_target
    blo_s_s7_end:

    ; bls_s s7
    .set bls_s_s7_target, @.Lbcc_s_target
    .set bls_s_s7_has_delay_slot,   0
    .set bls_s_s7_cc, 0xE
    bls_s_s7_start:
	bls_s @bls_s_s7_target
    bls_s_s7_end:
#endif /* TEST_BCC */

#ifdef TEST_BI
    ; bi [c]
    .set bi_c_target, @bi_c_end + (@r7_value << 2)
    .set bi_c_has_delay_slot,   0
    .set bi_c_cc, 0
    bi_c_start:
	bi [r7]
    bi_c_end:

    ; bih [c]
    .set bih_c_target, @bih_c_end + (@r7_value << 1)
    .set bih_c_has_delay_slot,   0
    .set bih_c_cc, 0
    bih_c_start:
	bih [r7]
    bih_c_end:
#endif /* TEST_BI */

#ifdef TEST_BL
.Lbl_target:
    ; bl s25
    .set bl_s25_target, @.Lbl_target
    .set bl_s25_has_delay_slot,   0
    .set bl_s25_cc, 0
    bl_s25_start:
	bl @bl_s25_target
    bl_s25_end:

    ; bl.d s25
    .set bl_d_s25_target, @.Lbl_target
    .set bl_d_s25_has_delay_slot,   1
    .set bl_d_s25_cc, 0
    bl_d_s25_start:
	bl.d @bl_d_s25_target
    bl_d_s25_end:
	nop_s

    ; bl_s s13
    .set bl_s_s13_target, @.Lbl_target
    .set bl_s_s13_has_delay_slot,   0
    .set bl_s_s13_cc, 0
    bl_s_s13_start:
	bl_s @bl_s_s13_target
    bl_s_s13_end:

    ; blcc s21
    .set blcc_s21_target, @.Lbl_target
    .set blcc_s21_has_delay_slot,   0
    .set blcc_s21_cc, 1
    blcc_s21_start:
	bleq @blcc_s21_target
    blcc_s21_end:

    ; blcc.d s21
    .set blcc_d_s21_target, @.Lbl_target
    .set blcc_d_s21_has_delay_slot,   1
    .set blcc_d_s21_cc, 2
    blcc_d_s21_start:
	blnz.d @blcc_d_s21_target
    blcc_d_s21_end:
	nop_s
#endif /* TEST_BL */

#ifdef TEST_BRCC
.Lbrcc_target:
    ; breq.nt b,c,s9
    .set breq_nt_b_c_s9_target, @.Lbrcc_target
    .set breq_nt_b_c_s9_has_delay_slot,   0
    .set breq_nt_b_c_s9_cc, 1
    breq_nt_b_c_s9_start:
	breq.nt r4,r5,@.Lbrcc_target
    breq_nt_b_c_s9_end:

    ; breq.d.nt b,c,s9
    .set breq_d_nt_b_c_s9_target, @.Lbrcc_target
    .set breq_d_nt_b_c_s9_has_delay_slot,   1
    .set breq_d_nt_b_c_s9_cc, 1
    breq_d_nt_b_c_s9_start:
	breq.d.nt r4,r5,@.Lbrcc_target
    breq_d_nt_b_c_s9_end:
	nop_s

    ; breq.t b,c,s9
    .set breq_t_b_c_s9_target, @.Lbrcc_target
    .set breq_t_b_c_s9_has_delay_slot,   0
    .set breq_t_b_c_s9_cc, 1
    breq_t_b_c_s9_start:
	breq.t r4,r5,@.Lbrcc_target
    breq_t_b_c_s9_end:

    ; breq.d.t b,c,s9
    .set breq_d_t_b_c_s9_target, @.Lbrcc_target
    .set breq_d_t_b_c_s9_has_delay_slot,   1
    .set breq_d_t_b_c_s9_cc, 1
    breq_d_t_b_c_s9_start:
	breq.d.t r4,r5,@.Lbrcc_target
    breq_d_t_b_c_s9_end:
	nop_s

    ; breq.nt b,u6,s9
    .set breq_nt_b_u6_s9_target, @.Lbrcc_target
    .set breq_nt_b_u6_s9_has_delay_slot,   0
    .set breq_nt_b_u6_s9_cc, 1
    breq_nt_b_u6_s9_start:
	breq.nt r4,u6_value,@.Lbrcc_target
    breq_nt_b_u6_s9_end:

    ; breq.d.nt b,u6,s9
    .set breq_d_nt_b_u6_s9_target, @.Lbrcc_target
    .set breq_d_nt_b_u6_s9_has_delay_slot,   1
    .set breq_d_nt_b_u6_s9_cc, 1
    breq_d_nt_b_u6_s9_start:
	breq.d.nt r4,u6_value,@.Lbrcc_target
    breq_d_nt_b_u6_s9_end:
	nop_s

    ; breq.nt b,u6,s9
    .set breq_t_b_u6_s9_target, @.Lbrcc_target
    .set breq_t_b_u6_s9_has_delay_slot,   0
    .set breq_t_b_u6_s9_cc, 1
    breq_t_b_u6_s9_start:
	breq.t r4,u6_value,@.Lbrcc_target
    breq_t_b_u6_s9_end:

    ; breq.d.nt b,u6,s9
    .set breq_d_t_b_u6_s9_target, @.Lbrcc_target
    .set breq_d_t_b_u6_s9_has_delay_slot,   1
    .set breq_d_t_b_u6_s9_cc, 1
    breq_d_t_b_u6_s9_start:
	breq.d.t r4,u6_value,@.Lbrcc_target
    breq_d_t_b_u6_s9_end:
	nop_s

    ; breq.nt b,limm,s9
    .set breq_nt_b_limm_s9_target, @.Lbrcc_target
    .set breq_nt_b_limm_s9_has_delay_slot,   0
    .set breq_nt_b_limm_s9_cc, 1
    breq_nt_b_limm_s9_start:
	breq.nt r4,limm_value,@.Lbrcc_target
    breq_nt_b_limm_s9_end:

    ; breq.t b,limm,s9
    .set breq_t_b_limm_s9_target, @.Lbrcc_target
    .set breq_t_b_limm_s9_has_delay_slot,   0
    .set breq_t_b_limm_s9_cc, 1
    breq_t_b_limm_s9_start:
	breq.t r4,limm_value,@.Lbrcc_target
    breq_t_b_limm_s9_end:

    ; breq.nt limm,c,s9
    .set breq_nt_limm_c_s9_target, @.Lbrcc_target
    .set breq_nt_limm_c_s9_has_delay_slot,   0
    .set breq_nt_limm_c_s9_cc, 1
    breq_nt_limm_c_s9_start:
	breq.nt limm_value,r4,@.Lbrcc_target
    breq_nt_limm_c_s9_end:

    ; breq.t limm,c,s9
    .set breq_t_limm_c_s9_target, @.Lbrcc_target
    .set breq_t_limm_c_s9_has_delay_slot,   0
    .set breq_t_limm_c_s9_cc, 1
    breq_t_limm_c_s9_start:
	breq.t limm_value,r4,@.Lbrcc_target
    breq_t_limm_c_s9_end:

    ; breq.nt limm,u6,s9
    .set breq_nt_limm_u6_s9_target, @.Lbrcc_target
    .set breq_nt_limm_u6_s9_has_delay_slot,   0
    .set breq_nt_limm_u6_s9_cc, 1
    breq_nt_limm_u6_s9_start:
	breq.nt limm_value,u6_value,@.Lbrcc_target
    breq_nt_limm_u6_s9_end:

    ; breq.t limm,u6,s9
    .set breq_t_limm_u6_s9_target, @.Lbrcc_target
    .set breq_t_limm_u6_s9_has_delay_slot,   0
    .set breq_t_limm_u6_s9_cc, 1
    breq_t_limm_u6_s9_start:
	breq.t limm_value,u6_value,@.Lbrcc_target
    breq_t_limm_u6_s9_end:

    ; brne_s b,0,s8
    .set brne_s_b_0_s8_target, @.Lbrcc_target
    .set brne_s_b_0_s8_has_delay_slot,   0
    .set brne_s_b_0_s8_cc, 1
    brne_s_b_0_s8_start:
	brne r12,0,@.Lbrcc_target
    brne_s_b_0_s8_end:

    ; breq_s b,0,s8
    .set breq_s_b_0_s8_target, @.Lbrcc_target
    .set breq_s_b_0_s8_has_delay_slot,   0
    .set breq_s_b_0_s8_cc, 1
    breq_s_b_0_s8_start:
	breq r12,0,@.Lbrcc_target
    breq_s_b_0_s8_end:
#endif /* TEST_BRCC */

#ifdef TEST_JLI
    ; jli_s u10
    .set jli_s_u10_target, @jli_target
    .set jli_s_u10_has_delay_slot,   0
    .set jli_s_u10_cc, 0
    jli_s_u10_start:
	jli_s jli_offset
    jli_s_u10_end:
#endif

#ifdef TEST_LEAVE_S
    ; leave_s
    .set leave_s_target, @blink_value
    .set leave_s_has_delay_slot,   0
    .set leave_s_cc, 0
    leave_s_start:
	; leave_s [r13-gp,fp,blink,pcl]
	leave_s (14 + 16 + 32 + 64)
    leave_s_end:
#endif

#ifdef TEST_LPCC
    ; lpcc
    .set lpcc_u7_target, @.Llpcc_end
    .set lpcc_u7_has_delay_slot,   0
    .set lpcc_u7_cc, 1
    lpcc_u7_start:
	lpeq @lpcc_u7_target
    lpcc_u7_end:
	nop
	nop
.Llpcc_end:
#endif

.Lend: