-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdecodev10.c
More file actions
5712 lines (5230 loc) · 201 KB
/
decodev10.c
File metadata and controls
5712 lines (5230 loc) · 201 KB
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
/* Simulator instruction decoder for crisv10f.
THIS FILE IS MACHINE GENERATED WITH CGEN.
Copyright 1996-2017 Free Software Foundation, Inc.
This file is part of the GNU simulators.
This file 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, or (at your option)
any later version.
It 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/>.
*/
#define WANT_CPU crisv10f
#define WANT_CPU_CRISV10F
#include "sim-main.h"
#include "sim-assert.h"
#include "cgen-ops.h"
/* The instruction descriptor array.
This is computed at runtime. Space for it is not malloc'd to save a
teensy bit of cpu in the decoder. Moving it to malloc space is trivial
but won't be done until necessary (we don't currently support the runtime
addition of instructions nor an SMP machine with different cpus). */
static IDESC crisv10f_insn_data[CRISV10F_INSN__MAX];
/* Commas between elements are contained in the macros.
Some of these are conditionally compiled out. */
static const struct insn_sem crisv10f_insn_sem[] =
{
{ VIRTUAL_INSN_X_INVALID, CRISV10F_INSN_X_INVALID, CRISV10F_SFMT_EMPTY },
{ VIRTUAL_INSN_X_AFTER, CRISV10F_INSN_X_AFTER, CRISV10F_SFMT_EMPTY },
{ VIRTUAL_INSN_X_BEFORE, CRISV10F_INSN_X_BEFORE, CRISV10F_SFMT_EMPTY },
{ VIRTUAL_INSN_X_CTI_CHAIN, CRISV10F_INSN_X_CTI_CHAIN, CRISV10F_SFMT_EMPTY },
{ VIRTUAL_INSN_X_CHAIN, CRISV10F_INSN_X_CHAIN, CRISV10F_SFMT_EMPTY },
{ VIRTUAL_INSN_X_BEGIN, CRISV10F_INSN_X_BEGIN, CRISV10F_SFMT_EMPTY },
{ CRIS_INSN_NOP, CRISV10F_INSN_NOP, CRISV10F_SFMT_NOP },
{ CRIS_INSN_MOVE_B_R, CRISV10F_INSN_MOVE_B_R, CRISV10F_SFMT_MOVE_B_R },
{ CRIS_INSN_MOVE_W_R, CRISV10F_INSN_MOVE_W_R, CRISV10F_SFMT_MOVE_B_R },
{ CRIS_INSN_MOVE_D_R, CRISV10F_INSN_MOVE_D_R, CRISV10F_SFMT_MOVE_D_R },
{ CRIS_INSN_MOVEPCR, CRISV10F_INSN_MOVEPCR, CRISV10F_SFMT_MOVEPCR },
{ CRIS_INSN_MOVEQ, CRISV10F_INSN_MOVEQ, CRISV10F_SFMT_MOVEQ },
{ CRIS_INSN_MOVS_B_R, CRISV10F_INSN_MOVS_B_R, CRISV10F_SFMT_MOVS_B_R },
{ CRIS_INSN_MOVS_W_R, CRISV10F_INSN_MOVS_W_R, CRISV10F_SFMT_MOVS_B_R },
{ CRIS_INSN_MOVU_B_R, CRISV10F_INSN_MOVU_B_R, CRISV10F_SFMT_MOVS_B_R },
{ CRIS_INSN_MOVU_W_R, CRISV10F_INSN_MOVU_W_R, CRISV10F_SFMT_MOVS_B_R },
{ CRIS_INSN_MOVECBR, CRISV10F_INSN_MOVECBR, CRISV10F_SFMT_MOVECBR },
{ CRIS_INSN_MOVECWR, CRISV10F_INSN_MOVECWR, CRISV10F_SFMT_MOVECWR },
{ CRIS_INSN_MOVECDR, CRISV10F_INSN_MOVECDR, CRISV10F_SFMT_MOVECDR },
{ CRIS_INSN_MOVSCBR, CRISV10F_INSN_MOVSCBR, CRISV10F_SFMT_MOVSCBR },
{ CRIS_INSN_MOVSCWR, CRISV10F_INSN_MOVSCWR, CRISV10F_SFMT_MOVSCWR },
{ CRIS_INSN_MOVUCBR, CRISV10F_INSN_MOVUCBR, CRISV10F_SFMT_MOVUCBR },
{ CRIS_INSN_MOVUCWR, CRISV10F_INSN_MOVUCWR, CRISV10F_SFMT_MOVUCWR },
{ CRIS_INSN_ADDQ, CRISV10F_INSN_ADDQ, CRISV10F_SFMT_ADDQ },
{ CRIS_INSN_SUBQ, CRISV10F_INSN_SUBQ, CRISV10F_SFMT_ADDQ },
{ CRIS_INSN_CMP_R_B_R, CRISV10F_INSN_CMP_R_B_R, CRISV10F_SFMT_CMP_R_B_R },
{ CRIS_INSN_CMP_R_W_R, CRISV10F_INSN_CMP_R_W_R, CRISV10F_SFMT_CMP_R_B_R },
{ CRIS_INSN_CMP_R_D_R, CRISV10F_INSN_CMP_R_D_R, CRISV10F_SFMT_CMP_R_B_R },
{ CRIS_INSN_CMP_M_B_M, CRISV10F_INSN_CMP_M_B_M, CRISV10F_SFMT_CMP_M_B_M },
{ CRIS_INSN_CMP_M_W_M, CRISV10F_INSN_CMP_M_W_M, CRISV10F_SFMT_CMP_M_W_M },
{ CRIS_INSN_CMP_M_D_M, CRISV10F_INSN_CMP_M_D_M, CRISV10F_SFMT_CMP_M_D_M },
{ CRIS_INSN_CMPCBR, CRISV10F_INSN_CMPCBR, CRISV10F_SFMT_CMPCBR },
{ CRIS_INSN_CMPCWR, CRISV10F_INSN_CMPCWR, CRISV10F_SFMT_CMPCWR },
{ CRIS_INSN_CMPCDR, CRISV10F_INSN_CMPCDR, CRISV10F_SFMT_CMPCDR },
{ CRIS_INSN_CMPQ, CRISV10F_INSN_CMPQ, CRISV10F_SFMT_CMPQ },
{ CRIS_INSN_CMPS_M_B_M, CRISV10F_INSN_CMPS_M_B_M, CRISV10F_SFMT_CMP_M_B_M },
{ CRIS_INSN_CMPS_M_W_M, CRISV10F_INSN_CMPS_M_W_M, CRISV10F_SFMT_CMP_M_W_M },
{ CRIS_INSN_CMPSCBR, CRISV10F_INSN_CMPSCBR, CRISV10F_SFMT_CMPCBR },
{ CRIS_INSN_CMPSCWR, CRISV10F_INSN_CMPSCWR, CRISV10F_SFMT_CMPCWR },
{ CRIS_INSN_CMPU_M_B_M, CRISV10F_INSN_CMPU_M_B_M, CRISV10F_SFMT_CMP_M_B_M },
{ CRIS_INSN_CMPU_M_W_M, CRISV10F_INSN_CMPU_M_W_M, CRISV10F_SFMT_CMP_M_W_M },
{ CRIS_INSN_CMPUCBR, CRISV10F_INSN_CMPUCBR, CRISV10F_SFMT_CMPUCBR },
{ CRIS_INSN_CMPUCWR, CRISV10F_INSN_CMPUCWR, CRISV10F_SFMT_CMPUCWR },
{ CRIS_INSN_MOVE_M_B_M, CRISV10F_INSN_MOVE_M_B_M, CRISV10F_SFMT_MOVE_M_B_M },
{ CRIS_INSN_MOVE_M_W_M, CRISV10F_INSN_MOVE_M_W_M, CRISV10F_SFMT_MOVE_M_W_M },
{ CRIS_INSN_MOVE_M_D_M, CRISV10F_INSN_MOVE_M_D_M, CRISV10F_SFMT_MOVE_M_D_M },
{ CRIS_INSN_MOVS_M_B_M, CRISV10F_INSN_MOVS_M_B_M, CRISV10F_SFMT_MOVS_M_B_M },
{ CRIS_INSN_MOVS_M_W_M, CRISV10F_INSN_MOVS_M_W_M, CRISV10F_SFMT_MOVS_M_W_M },
{ CRIS_INSN_MOVU_M_B_M, CRISV10F_INSN_MOVU_M_B_M, CRISV10F_SFMT_MOVS_M_B_M },
{ CRIS_INSN_MOVU_M_W_M, CRISV10F_INSN_MOVU_M_W_M, CRISV10F_SFMT_MOVS_M_W_M },
{ CRIS_INSN_MOVE_R_SPRV10, CRISV10F_INSN_MOVE_R_SPRV10, CRISV10F_SFMT_MOVE_R_SPRV10 },
{ CRIS_INSN_MOVE_SPR_RV10, CRISV10F_INSN_MOVE_SPR_RV10, CRISV10F_SFMT_MOVE_SPR_RV10 },
{ CRIS_INSN_RET_TYPE, CRISV10F_INSN_RET_TYPE, CRISV10F_SFMT_RET_TYPE },
{ CRIS_INSN_MOVE_M_SPRV10, CRISV10F_INSN_MOVE_M_SPRV10, CRISV10F_SFMT_MOVE_M_SPRV10 },
{ CRIS_INSN_MOVE_C_SPRV10_P5, CRISV10F_INSN_MOVE_C_SPRV10_P5, CRISV10F_SFMT_MOVE_C_SPRV10_P5 },
{ CRIS_INSN_MOVE_C_SPRV10_P9, CRISV10F_INSN_MOVE_C_SPRV10_P9, CRISV10F_SFMT_MOVE_C_SPRV10_P9 },
{ CRIS_INSN_MOVE_C_SPRV10_P10, CRISV10F_INSN_MOVE_C_SPRV10_P10, CRISV10F_SFMT_MOVE_C_SPRV10_P9 },
{ CRIS_INSN_MOVE_C_SPRV10_P11, CRISV10F_INSN_MOVE_C_SPRV10_P11, CRISV10F_SFMT_MOVE_C_SPRV10_P9 },
{ CRIS_INSN_MOVE_C_SPRV10_P12, CRISV10F_INSN_MOVE_C_SPRV10_P12, CRISV10F_SFMT_MOVE_C_SPRV10_P9 },
{ CRIS_INSN_MOVE_C_SPRV10_P13, CRISV10F_INSN_MOVE_C_SPRV10_P13, CRISV10F_SFMT_MOVE_C_SPRV10_P9 },
{ CRIS_INSN_MOVE_C_SPRV10_P7, CRISV10F_INSN_MOVE_C_SPRV10_P7, CRISV10F_SFMT_MOVE_C_SPRV10_P9 },
{ CRIS_INSN_MOVE_C_SPRV10_P14, CRISV10F_INSN_MOVE_C_SPRV10_P14, CRISV10F_SFMT_MOVE_C_SPRV10_P9 },
{ CRIS_INSN_MOVE_C_SPRV10_P15, CRISV10F_INSN_MOVE_C_SPRV10_P15, CRISV10F_SFMT_MOVE_C_SPRV10_P9 },
{ CRIS_INSN_MOVE_SPR_MV10, CRISV10F_INSN_MOVE_SPR_MV10, CRISV10F_SFMT_MOVE_SPR_MV10 },
{ CRIS_INSN_SBFS, CRISV10F_INSN_SBFS, CRISV10F_SFMT_SBFS },
{ CRIS_INSN_MOVEM_R_M, CRISV10F_INSN_MOVEM_R_M, CRISV10F_SFMT_MOVEM_R_M },
{ CRIS_INSN_MOVEM_M_R, CRISV10F_INSN_MOVEM_M_R, CRISV10F_SFMT_MOVEM_M_R },
{ CRIS_INSN_MOVEM_M_PC, CRISV10F_INSN_MOVEM_M_PC, CRISV10F_SFMT_MOVEM_M_PC },
{ CRIS_INSN_ADD_B_R, CRISV10F_INSN_ADD_B_R, CRISV10F_SFMT_ADD_B_R },
{ CRIS_INSN_ADD_W_R, CRISV10F_INSN_ADD_W_R, CRISV10F_SFMT_ADD_B_R },
{ CRIS_INSN_ADD_D_R, CRISV10F_INSN_ADD_D_R, CRISV10F_SFMT_ADD_D_R },
{ CRIS_INSN_ADD_M_B_M, CRISV10F_INSN_ADD_M_B_M, CRISV10F_SFMT_ADD_M_B_M },
{ CRIS_INSN_ADD_M_W_M, CRISV10F_INSN_ADD_M_W_M, CRISV10F_SFMT_ADD_M_W_M },
{ CRIS_INSN_ADD_M_D_M, CRISV10F_INSN_ADD_M_D_M, CRISV10F_SFMT_ADD_M_D_M },
{ CRIS_INSN_ADDCBR, CRISV10F_INSN_ADDCBR, CRISV10F_SFMT_ADDCBR },
{ CRIS_INSN_ADDCWR, CRISV10F_INSN_ADDCWR, CRISV10F_SFMT_ADDCWR },
{ CRIS_INSN_ADDCDR, CRISV10F_INSN_ADDCDR, CRISV10F_SFMT_ADDCDR },
{ CRIS_INSN_ADDCPC, CRISV10F_INSN_ADDCPC, CRISV10F_SFMT_ADDCPC },
{ CRIS_INSN_ADDS_B_R, CRISV10F_INSN_ADDS_B_R, CRISV10F_SFMT_ADD_D_R },
{ CRIS_INSN_ADDS_W_R, CRISV10F_INSN_ADDS_W_R, CRISV10F_SFMT_ADD_D_R },
{ CRIS_INSN_ADDS_M_B_M, CRISV10F_INSN_ADDS_M_B_M, CRISV10F_SFMT_ADDS_M_B_M },
{ CRIS_INSN_ADDS_M_W_M, CRISV10F_INSN_ADDS_M_W_M, CRISV10F_SFMT_ADDS_M_W_M },
{ CRIS_INSN_ADDSCBR, CRISV10F_INSN_ADDSCBR, CRISV10F_SFMT_ADDSCBR },
{ CRIS_INSN_ADDSCWR, CRISV10F_INSN_ADDSCWR, CRISV10F_SFMT_ADDSCWR },
{ CRIS_INSN_ADDSPCPC, CRISV10F_INSN_ADDSPCPC, CRISV10F_SFMT_ADDSPCPC },
{ CRIS_INSN_ADDU_B_R, CRISV10F_INSN_ADDU_B_R, CRISV10F_SFMT_ADD_D_R },
{ CRIS_INSN_ADDU_W_R, CRISV10F_INSN_ADDU_W_R, CRISV10F_SFMT_ADD_D_R },
{ CRIS_INSN_ADDU_M_B_M, CRISV10F_INSN_ADDU_M_B_M, CRISV10F_SFMT_ADDS_M_B_M },
{ CRIS_INSN_ADDU_M_W_M, CRISV10F_INSN_ADDU_M_W_M, CRISV10F_SFMT_ADDS_M_W_M },
{ CRIS_INSN_ADDUCBR, CRISV10F_INSN_ADDUCBR, CRISV10F_SFMT_ADDSCBR },
{ CRIS_INSN_ADDUCWR, CRISV10F_INSN_ADDUCWR, CRISV10F_SFMT_ADDSCWR },
{ CRIS_INSN_SUB_B_R, CRISV10F_INSN_SUB_B_R, CRISV10F_SFMT_ADD_B_R },
{ CRIS_INSN_SUB_W_R, CRISV10F_INSN_SUB_W_R, CRISV10F_SFMT_ADD_B_R },
{ CRIS_INSN_SUB_D_R, CRISV10F_INSN_SUB_D_R, CRISV10F_SFMT_ADD_D_R },
{ CRIS_INSN_SUB_M_B_M, CRISV10F_INSN_SUB_M_B_M, CRISV10F_SFMT_ADD_M_B_M },
{ CRIS_INSN_SUB_M_W_M, CRISV10F_INSN_SUB_M_W_M, CRISV10F_SFMT_ADD_M_W_M },
{ CRIS_INSN_SUB_M_D_M, CRISV10F_INSN_SUB_M_D_M, CRISV10F_SFMT_ADD_M_D_M },
{ CRIS_INSN_SUBCBR, CRISV10F_INSN_SUBCBR, CRISV10F_SFMT_ADDCBR },
{ CRIS_INSN_SUBCWR, CRISV10F_INSN_SUBCWR, CRISV10F_SFMT_ADDCWR },
{ CRIS_INSN_SUBCDR, CRISV10F_INSN_SUBCDR, CRISV10F_SFMT_ADDCDR },
{ CRIS_INSN_SUBS_B_R, CRISV10F_INSN_SUBS_B_R, CRISV10F_SFMT_ADD_D_R },
{ CRIS_INSN_SUBS_W_R, CRISV10F_INSN_SUBS_W_R, CRISV10F_SFMT_ADD_D_R },
{ CRIS_INSN_SUBS_M_B_M, CRISV10F_INSN_SUBS_M_B_M, CRISV10F_SFMT_ADDS_M_B_M },
{ CRIS_INSN_SUBS_M_W_M, CRISV10F_INSN_SUBS_M_W_M, CRISV10F_SFMT_ADDS_M_W_M },
{ CRIS_INSN_SUBSCBR, CRISV10F_INSN_SUBSCBR, CRISV10F_SFMT_ADDSCBR },
{ CRIS_INSN_SUBSCWR, CRISV10F_INSN_SUBSCWR, CRISV10F_SFMT_ADDSCWR },
{ CRIS_INSN_SUBU_B_R, CRISV10F_INSN_SUBU_B_R, CRISV10F_SFMT_ADD_D_R },
{ CRIS_INSN_SUBU_W_R, CRISV10F_INSN_SUBU_W_R, CRISV10F_SFMT_ADD_D_R },
{ CRIS_INSN_SUBU_M_B_M, CRISV10F_INSN_SUBU_M_B_M, CRISV10F_SFMT_ADDS_M_B_M },
{ CRIS_INSN_SUBU_M_W_M, CRISV10F_INSN_SUBU_M_W_M, CRISV10F_SFMT_ADDS_M_W_M },
{ CRIS_INSN_SUBUCBR, CRISV10F_INSN_SUBUCBR, CRISV10F_SFMT_ADDSCBR },
{ CRIS_INSN_SUBUCWR, CRISV10F_INSN_SUBUCWR, CRISV10F_SFMT_ADDSCWR },
{ CRIS_INSN_ADDI_B_R, CRISV10F_INSN_ADDI_B_R, CRISV10F_SFMT_ADDI_B_R },
{ CRIS_INSN_ADDI_W_R, CRISV10F_INSN_ADDI_W_R, CRISV10F_SFMT_ADDI_B_R },
{ CRIS_INSN_ADDI_D_R, CRISV10F_INSN_ADDI_D_R, CRISV10F_SFMT_ADDI_B_R },
{ CRIS_INSN_NEG_B_R, CRISV10F_INSN_NEG_B_R, CRISV10F_SFMT_NEG_B_R },
{ CRIS_INSN_NEG_W_R, CRISV10F_INSN_NEG_W_R, CRISV10F_SFMT_NEG_B_R },
{ CRIS_INSN_NEG_D_R, CRISV10F_INSN_NEG_D_R, CRISV10F_SFMT_NEG_D_R },
{ CRIS_INSN_TEST_M_B_M, CRISV10F_INSN_TEST_M_B_M, CRISV10F_SFMT_TEST_M_B_M },
{ CRIS_INSN_TEST_M_W_M, CRISV10F_INSN_TEST_M_W_M, CRISV10F_SFMT_TEST_M_W_M },
{ CRIS_INSN_TEST_M_D_M, CRISV10F_INSN_TEST_M_D_M, CRISV10F_SFMT_TEST_M_D_M },
{ CRIS_INSN_MOVE_R_M_B_M, CRISV10F_INSN_MOVE_R_M_B_M, CRISV10F_SFMT_MOVE_R_M_B_M },
{ CRIS_INSN_MOVE_R_M_W_M, CRISV10F_INSN_MOVE_R_M_W_M, CRISV10F_SFMT_MOVE_R_M_W_M },
{ CRIS_INSN_MOVE_R_M_D_M, CRISV10F_INSN_MOVE_R_M_D_M, CRISV10F_SFMT_MOVE_R_M_D_M },
{ CRIS_INSN_MULS_B, CRISV10F_INSN_MULS_B, CRISV10F_SFMT_MULS_B },
{ CRIS_INSN_MULS_W, CRISV10F_INSN_MULS_W, CRISV10F_SFMT_MULS_B },
{ CRIS_INSN_MULS_D, CRISV10F_INSN_MULS_D, CRISV10F_SFMT_MULS_B },
{ CRIS_INSN_MULU_B, CRISV10F_INSN_MULU_B, CRISV10F_SFMT_MULS_B },
{ CRIS_INSN_MULU_W, CRISV10F_INSN_MULU_W, CRISV10F_SFMT_MULS_B },
{ CRIS_INSN_MULU_D, CRISV10F_INSN_MULU_D, CRISV10F_SFMT_MULS_B },
{ CRIS_INSN_MSTEP, CRISV10F_INSN_MSTEP, CRISV10F_SFMT_MSTEP },
{ CRIS_INSN_DSTEP, CRISV10F_INSN_DSTEP, CRISV10F_SFMT_DSTEP },
{ CRIS_INSN_ABS, CRISV10F_INSN_ABS, CRISV10F_SFMT_MOVS_B_R },
{ CRIS_INSN_AND_B_R, CRISV10F_INSN_AND_B_R, CRISV10F_SFMT_AND_B_R },
{ CRIS_INSN_AND_W_R, CRISV10F_INSN_AND_W_R, CRISV10F_SFMT_AND_B_R },
{ CRIS_INSN_AND_D_R, CRISV10F_INSN_AND_D_R, CRISV10F_SFMT_AND_D_R },
{ CRIS_INSN_AND_M_B_M, CRISV10F_INSN_AND_M_B_M, CRISV10F_SFMT_AND_M_B_M },
{ CRIS_INSN_AND_M_W_M, CRISV10F_INSN_AND_M_W_M, CRISV10F_SFMT_AND_M_W_M },
{ CRIS_INSN_AND_M_D_M, CRISV10F_INSN_AND_M_D_M, CRISV10F_SFMT_AND_M_D_M },
{ CRIS_INSN_ANDCBR, CRISV10F_INSN_ANDCBR, CRISV10F_SFMT_ANDCBR },
{ CRIS_INSN_ANDCWR, CRISV10F_INSN_ANDCWR, CRISV10F_SFMT_ANDCWR },
{ CRIS_INSN_ANDCDR, CRISV10F_INSN_ANDCDR, CRISV10F_SFMT_ANDCDR },
{ CRIS_INSN_ANDQ, CRISV10F_INSN_ANDQ, CRISV10F_SFMT_ANDQ },
{ CRIS_INSN_ORR_B_R, CRISV10F_INSN_ORR_B_R, CRISV10F_SFMT_AND_B_R },
{ CRIS_INSN_ORR_W_R, CRISV10F_INSN_ORR_W_R, CRISV10F_SFMT_AND_B_R },
{ CRIS_INSN_ORR_D_R, CRISV10F_INSN_ORR_D_R, CRISV10F_SFMT_AND_D_R },
{ CRIS_INSN_OR_M_B_M, CRISV10F_INSN_OR_M_B_M, CRISV10F_SFMT_AND_M_B_M },
{ CRIS_INSN_OR_M_W_M, CRISV10F_INSN_OR_M_W_M, CRISV10F_SFMT_AND_M_W_M },
{ CRIS_INSN_OR_M_D_M, CRISV10F_INSN_OR_M_D_M, CRISV10F_SFMT_AND_M_D_M },
{ CRIS_INSN_ORCBR, CRISV10F_INSN_ORCBR, CRISV10F_SFMT_ANDCBR },
{ CRIS_INSN_ORCWR, CRISV10F_INSN_ORCWR, CRISV10F_SFMT_ANDCWR },
{ CRIS_INSN_ORCDR, CRISV10F_INSN_ORCDR, CRISV10F_SFMT_ANDCDR },
{ CRIS_INSN_ORQ, CRISV10F_INSN_ORQ, CRISV10F_SFMT_ANDQ },
{ CRIS_INSN_XOR, CRISV10F_INSN_XOR, CRISV10F_SFMT_DSTEP },
{ CRIS_INSN_SWAP, CRISV10F_INSN_SWAP, CRISV10F_SFMT_SWAP },
{ CRIS_INSN_ASRR_B_R, CRISV10F_INSN_ASRR_B_R, CRISV10F_SFMT_AND_B_R },
{ CRIS_INSN_ASRR_W_R, CRISV10F_INSN_ASRR_W_R, CRISV10F_SFMT_AND_B_R },
{ CRIS_INSN_ASRR_D_R, CRISV10F_INSN_ASRR_D_R, CRISV10F_SFMT_AND_D_R },
{ CRIS_INSN_ASRQ, CRISV10F_INSN_ASRQ, CRISV10F_SFMT_ASRQ },
{ CRIS_INSN_LSRR_B_R, CRISV10F_INSN_LSRR_B_R, CRISV10F_SFMT_LSRR_B_R },
{ CRIS_INSN_LSRR_W_R, CRISV10F_INSN_LSRR_W_R, CRISV10F_SFMT_LSRR_B_R },
{ CRIS_INSN_LSRR_D_R, CRISV10F_INSN_LSRR_D_R, CRISV10F_SFMT_LSRR_D_R },
{ CRIS_INSN_LSRQ, CRISV10F_INSN_LSRQ, CRISV10F_SFMT_ASRQ },
{ CRIS_INSN_LSLR_B_R, CRISV10F_INSN_LSLR_B_R, CRISV10F_SFMT_LSRR_B_R },
{ CRIS_INSN_LSLR_W_R, CRISV10F_INSN_LSLR_W_R, CRISV10F_SFMT_LSRR_B_R },
{ CRIS_INSN_LSLR_D_R, CRISV10F_INSN_LSLR_D_R, CRISV10F_SFMT_LSRR_D_R },
{ CRIS_INSN_LSLQ, CRISV10F_INSN_LSLQ, CRISV10F_SFMT_ASRQ },
{ CRIS_INSN_BTST, CRISV10F_INSN_BTST, CRISV10F_SFMT_BTST },
{ CRIS_INSN_BTSTQ, CRISV10F_INSN_BTSTQ, CRISV10F_SFMT_BTSTQ },
{ CRIS_INSN_SETF, CRISV10F_INSN_SETF, CRISV10F_SFMT_SETF },
{ CRIS_INSN_CLEARF, CRISV10F_INSN_CLEARF, CRISV10F_SFMT_SETF },
{ CRIS_INSN_BCC_B, CRISV10F_INSN_BCC_B, CRISV10F_SFMT_BCC_B },
{ CRIS_INSN_BA_B, CRISV10F_INSN_BA_B, CRISV10F_SFMT_BA_B },
{ CRIS_INSN_BCC_W, CRISV10F_INSN_BCC_W, CRISV10F_SFMT_BCC_W },
{ CRIS_INSN_BA_W, CRISV10F_INSN_BA_W, CRISV10F_SFMT_BA_W },
{ CRIS_INSN_JUMP_R, CRISV10F_INSN_JUMP_R, CRISV10F_SFMT_JUMP_R },
{ CRIS_INSN_JUMP_M, CRISV10F_INSN_JUMP_M, CRISV10F_SFMT_JUMP_M },
{ CRIS_INSN_JUMP_C, CRISV10F_INSN_JUMP_C, CRISV10F_SFMT_JUMP_C },
{ CRIS_INSN_BREAK, CRISV10F_INSN_BREAK, CRISV10F_SFMT_BREAK },
{ CRIS_INSN_BOUND_R_B_R, CRISV10F_INSN_BOUND_R_B_R, CRISV10F_SFMT_DSTEP },
{ CRIS_INSN_BOUND_R_W_R, CRISV10F_INSN_BOUND_R_W_R, CRISV10F_SFMT_DSTEP },
{ CRIS_INSN_BOUND_R_D_R, CRISV10F_INSN_BOUND_R_D_R, CRISV10F_SFMT_DSTEP },
{ CRIS_INSN_BOUND_M_B_M, CRISV10F_INSN_BOUND_M_B_M, CRISV10F_SFMT_BOUND_M_B_M },
{ CRIS_INSN_BOUND_M_W_M, CRISV10F_INSN_BOUND_M_W_M, CRISV10F_SFMT_BOUND_M_W_M },
{ CRIS_INSN_BOUND_M_D_M, CRISV10F_INSN_BOUND_M_D_M, CRISV10F_SFMT_BOUND_M_D_M },
{ CRIS_INSN_BOUND_CB, CRISV10F_INSN_BOUND_CB, CRISV10F_SFMT_BOUND_CB },
{ CRIS_INSN_BOUND_CW, CRISV10F_INSN_BOUND_CW, CRISV10F_SFMT_BOUND_CW },
{ CRIS_INSN_BOUND_CD, CRISV10F_INSN_BOUND_CD, CRISV10F_SFMT_BOUND_CD },
{ CRIS_INSN_SCC, CRISV10F_INSN_SCC, CRISV10F_SFMT_SCC },
{ CRIS_INSN_LZ, CRISV10F_INSN_LZ, CRISV10F_SFMT_MOVS_B_R },
{ CRIS_INSN_ADDOQ, CRISV10F_INSN_ADDOQ, CRISV10F_SFMT_ADDOQ },
{ CRIS_INSN_BDAPQPC, CRISV10F_INSN_BDAPQPC, CRISV10F_SFMT_BDAPQPC },
{ CRIS_INSN_BDAP_32_PC, CRISV10F_INSN_BDAP_32_PC, CRISV10F_SFMT_BDAP_32_PC },
{ CRIS_INSN_MOVE_M_PCPLUS_P0, CRISV10F_INSN_MOVE_M_PCPLUS_P0, CRISV10F_SFMT_MOVE_M_PCPLUS_P0 },
{ CRIS_INSN_MOVE_M_SPPLUS_P8, CRISV10F_INSN_MOVE_M_SPPLUS_P8, CRISV10F_SFMT_MOVE_M_SPPLUS_P8 },
{ CRIS_INSN_ADDO_M_B_M, CRISV10F_INSN_ADDO_M_B_M, CRISV10F_SFMT_ADDO_M_B_M },
{ CRIS_INSN_ADDO_M_W_M, CRISV10F_INSN_ADDO_M_W_M, CRISV10F_SFMT_ADDO_M_W_M },
{ CRIS_INSN_ADDO_M_D_M, CRISV10F_INSN_ADDO_M_D_M, CRISV10F_SFMT_ADDO_M_D_M },
{ CRIS_INSN_ADDO_CB, CRISV10F_INSN_ADDO_CB, CRISV10F_SFMT_ADDO_CB },
{ CRIS_INSN_ADDO_CW, CRISV10F_INSN_ADDO_CW, CRISV10F_SFMT_ADDO_CW },
{ CRIS_INSN_ADDO_CD, CRISV10F_INSN_ADDO_CD, CRISV10F_SFMT_ADDO_CD },
{ CRIS_INSN_DIP_M, CRISV10F_INSN_DIP_M, CRISV10F_SFMT_DIP_M },
{ CRIS_INSN_DIP_C, CRISV10F_INSN_DIP_C, CRISV10F_SFMT_DIP_C },
{ CRIS_INSN_ADDI_ACR_B_R, CRISV10F_INSN_ADDI_ACR_B_R, CRISV10F_SFMT_ADDI_ACR_B_R },
{ CRIS_INSN_ADDI_ACR_W_R, CRISV10F_INSN_ADDI_ACR_W_R, CRISV10F_SFMT_ADDI_ACR_B_R },
{ CRIS_INSN_ADDI_ACR_D_R, CRISV10F_INSN_ADDI_ACR_D_R, CRISV10F_SFMT_ADDI_ACR_B_R },
{ CRIS_INSN_BIAP_PC_B_R, CRISV10F_INSN_BIAP_PC_B_R, CRISV10F_SFMT_BIAP_PC_B_R },
{ CRIS_INSN_BIAP_PC_W_R, CRISV10F_INSN_BIAP_PC_W_R, CRISV10F_SFMT_BIAP_PC_B_R },
{ CRIS_INSN_BIAP_PC_D_R, CRISV10F_INSN_BIAP_PC_D_R, CRISV10F_SFMT_BIAP_PC_B_R },
};
static const struct insn_sem crisv10f_insn_sem_invalid =
{
VIRTUAL_INSN_X_INVALID, CRISV10F_INSN_X_INVALID, CRISV10F_SFMT_EMPTY
};
/* Initialize an IDESC from the compile-time computable parts. */
static INLINE void
init_idesc (SIM_CPU *cpu, IDESC *id, const struct insn_sem *t)
{
const CGEN_INSN *insn_table = CGEN_CPU_INSN_TABLE (CPU_CPU_DESC (cpu))->init_entries;
id->num = t->index;
id->sfmt = t->sfmt;
if ((int) t->type <= 0)
id->idata = & cgen_virtual_insn_table[- (int) t->type];
else
id->idata = & insn_table[t->type];
id->attrs = CGEN_INSN_ATTRS (id->idata);
/* Oh my god, a magic number. */
id->length = CGEN_INSN_BITSIZE (id->idata) / 8;
#if WITH_PROFILE_MODEL_P
id->timing = & MODEL_TIMING (CPU_MODEL (cpu)) [t->index];
{
SIM_DESC sd = CPU_STATE (cpu);
SIM_ASSERT (t->index == id->timing->num);
}
#endif
/* Semantic pointers are initialized elsewhere. */
}
/* Initialize the instruction descriptor table. */
void
crisv10f_init_idesc_table (SIM_CPU *cpu)
{
IDESC *id,*tabend;
const struct insn_sem *t,*tend;
int tabsize = CRISV10F_INSN__MAX;
IDESC *table = crisv10f_insn_data;
memset (table, 0, tabsize * sizeof (IDESC));
/* First set all entries to the `invalid insn'. */
t = & crisv10f_insn_sem_invalid;
for (id = table, tabend = table + tabsize; id < tabend; ++id)
init_idesc (cpu, id, t);
/* Now fill in the values for the chosen cpu. */
for (t = crisv10f_insn_sem, tend = t + ARRAY_SIZE (crisv10f_insn_sem);
t != tend; ++t)
{
init_idesc (cpu, & table[t->index], t);
}
/* Link the IDESC table into the cpu. */
CPU_IDESC (cpu) = table;
}
/* Given an instruction, return a pointer to its IDESC entry. */
const IDESC *
crisv10f_decode (SIM_CPU *current_cpu, IADDR pc,
CGEN_INSN_WORD base_insn,
ARGBUF *abuf)
{
/* Result of decoder. */
CRISV10F_INSN_TYPE itype;
{
CGEN_INSN_WORD insn = base_insn;
{
unsigned int val = (((insn >> 4) & (255 << 0)));
switch (val)
{
case 0 : /* fall through */
case 1 : /* fall through */
case 2 : /* fall through */
case 3 : /* fall through */
case 4 : /* fall through */
case 5 : /* fall through */
case 6 : /* fall through */
case 7 : /* fall through */
case 8 : /* fall through */
case 9 : /* fall through */
case 10 : /* fall through */
case 11 : /* fall through */
case 12 : /* fall through */
case 13 : /* fall through */
case 14 : /* fall through */
case 15 :
{
unsigned int val = (((insn >> 12) & (15 << 0)));
switch (val)
{
case 0 : /* fall through */
case 1 : /* fall through */
case 2 : /* fall through */
case 3 : /* fall through */
case 4 : /* fall through */
case 5 : /* fall through */
case 6 : /* fall through */
case 7 : /* fall through */
case 8 : /* fall through */
case 9 : /* fall through */
case 10 : /* fall through */
case 11 : /* fall through */
case 12 : /* fall through */
case 13 : /* fall through */
case 15 : itype = CRISV10F_INSN_BCC_B; goto extract_sfmt_bcc_b;
case 14 : itype = CRISV10F_INSN_BA_B; goto extract_sfmt_ba_b;
default : itype = CRISV10F_INSN_X_INVALID; goto extract_sfmt_empty;
}
}
case 16 : /* fall through */
case 17 : /* fall through */
case 18 : /* fall through */
case 19 : /* fall through */
case 20 : /* fall through */
case 21 : /* fall through */
case 22 : /* fall through */
case 23 : /* fall through */
case 24 : /* fall through */
case 25 : /* fall through */
case 26 : /* fall through */
case 27 : /* fall through */
case 28 : /* fall through */
case 29 : /* fall through */
case 30 : /* fall through */
case 31 :
{
unsigned int val = (((insn >> 12) & (15 << 0)));
switch (val)
{
case 0 : /* fall through */
case 1 : /* fall through */
case 2 : /* fall through */
case 3 : /* fall through */
case 4 : /* fall through */
case 5 : /* fall through */
case 6 : /* fall through */
case 7 : /* fall through */
case 8 : /* fall through */
case 9 : /* fall through */
case 10 : /* fall through */
case 11 : /* fall through */
case 12 : /* fall through */
case 13 : /* fall through */
case 14 : itype = CRISV10F_INSN_ADDOQ; goto extract_sfmt_addoq;
case 15 : itype = CRISV10F_INSN_BDAPQPC; goto extract_sfmt_bdapqpc;
default : itype = CRISV10F_INSN_X_INVALID; goto extract_sfmt_empty;
}
}
case 32 : /* fall through */
case 33 : /* fall through */
case 34 : /* fall through */
case 35 : itype = CRISV10F_INSN_ADDQ; goto extract_sfmt_addq;
case 36 : /* fall through */
case 37 : /* fall through */
case 38 : /* fall through */
case 39 : itype = CRISV10F_INSN_MOVEQ; goto extract_sfmt_moveq;
case 40 : /* fall through */
case 41 : /* fall through */
case 42 : /* fall through */
case 43 : itype = CRISV10F_INSN_SUBQ; goto extract_sfmt_addq;
case 44 : /* fall through */
case 45 : /* fall through */
case 46 : /* fall through */
case 47 : itype = CRISV10F_INSN_CMPQ; goto extract_sfmt_cmpq;
case 48 : /* fall through */
case 49 : /* fall through */
case 50 : /* fall through */
case 51 : itype = CRISV10F_INSN_ANDQ; goto extract_sfmt_andq;
case 52 : /* fall through */
case 53 : /* fall through */
case 54 : /* fall through */
case 55 : itype = CRISV10F_INSN_ORQ; goto extract_sfmt_andq;
case 56 : /* fall through */
case 57 : itype = CRISV10F_INSN_BTSTQ; goto extract_sfmt_btstq;
case 58 : /* fall through */
case 59 : itype = CRISV10F_INSN_ASRQ; goto extract_sfmt_asrq;
case 60 : /* fall through */
case 61 : itype = CRISV10F_INSN_LSLQ; goto extract_sfmt_asrq;
case 62 : /* fall through */
case 63 : itype = CRISV10F_INSN_LSRQ; goto extract_sfmt_asrq;
case 64 : itype = CRISV10F_INSN_ADDU_B_R; goto extract_sfmt_add_d_r;
case 65 : itype = CRISV10F_INSN_ADDU_W_R; goto extract_sfmt_add_d_r;
case 66 : itype = CRISV10F_INSN_ADDS_B_R; goto extract_sfmt_add_d_r;
case 67 : itype = CRISV10F_INSN_ADDS_W_R; goto extract_sfmt_add_d_r;
case 68 : itype = CRISV10F_INSN_MOVU_B_R; goto extract_sfmt_movs_b_r;
case 69 : itype = CRISV10F_INSN_MOVU_W_R; goto extract_sfmt_movs_b_r;
case 70 : itype = CRISV10F_INSN_MOVS_B_R; goto extract_sfmt_movs_b_r;
case 71 : itype = CRISV10F_INSN_MOVS_W_R; goto extract_sfmt_movs_b_r;
case 72 : itype = CRISV10F_INSN_SUBU_B_R; goto extract_sfmt_add_d_r;
case 73 : itype = CRISV10F_INSN_SUBU_W_R; goto extract_sfmt_add_d_r;
case 74 : itype = CRISV10F_INSN_SUBS_B_R; goto extract_sfmt_add_d_r;
case 75 : itype = CRISV10F_INSN_SUBS_W_R; goto extract_sfmt_add_d_r;
case 76 : itype = CRISV10F_INSN_LSLR_B_R; goto extract_sfmt_lsrr_b_r;
case 77 : itype = CRISV10F_INSN_LSLR_W_R; goto extract_sfmt_lsrr_b_r;
case 78 : itype = CRISV10F_INSN_LSLR_D_R; goto extract_sfmt_lsrr_d_r;
case 79 : itype = CRISV10F_INSN_BTST; goto extract_sfmt_btst;
case 80 :
{
unsigned int val = (((insn >> 8) & (7 << 4)) | ((insn >> 0) & (15 << 0)));
switch (val)
{
case 0 : /* fall through */
case 1 : /* fall through */
case 2 : /* fall through */
case 3 : /* fall through */
case 4 : /* fall through */
case 5 : /* fall through */
case 6 : /* fall through */
case 7 : /* fall through */
case 8 : /* fall through */
case 9 : /* fall through */
case 10 : /* fall through */
case 11 : /* fall through */
case 12 : /* fall through */
case 13 : /* fall through */
case 14 : /* fall through */
case 16 : /* fall through */
case 17 : /* fall through */
case 18 : /* fall through */
case 19 : /* fall through */
case 20 : /* fall through */
case 21 : /* fall through */
case 22 : /* fall through */
case 23 : /* fall through */
case 24 : /* fall through */
case 25 : /* fall through */
case 26 : /* fall through */
case 27 : /* fall through */
case 28 : /* fall through */
case 29 : /* fall through */
case 30 : /* fall through */
case 31 : /* fall through */
case 32 : /* fall through */
case 33 : /* fall through */
case 34 : /* fall through */
case 35 : /* fall through */
case 36 : /* fall through */
case 37 : /* fall through */
case 38 : /* fall through */
case 39 : /* fall through */
case 40 : /* fall through */
case 41 : /* fall through */
case 42 : /* fall through */
case 43 : /* fall through */
case 44 : /* fall through */
case 45 : /* fall through */
case 46 : /* fall through */
case 47 : /* fall through */
case 48 : /* fall through */
case 49 : /* fall through */
case 50 : /* fall through */
case 51 : /* fall through */
case 52 : /* fall through */
case 53 : /* fall through */
case 54 : /* fall through */
case 55 : /* fall through */
case 56 : /* fall through */
case 57 : /* fall through */
case 58 : /* fall through */
case 59 : /* fall through */
case 60 : /* fall through */
case 61 : /* fall through */
case 62 : /* fall through */
case 63 : /* fall through */
case 64 : /* fall through */
case 65 : /* fall through */
case 66 : /* fall through */
case 67 : /* fall through */
case 68 : /* fall through */
case 69 : /* fall through */
case 70 : /* fall through */
case 71 : /* fall through */
case 72 : /* fall through */
case 73 : /* fall through */
case 74 : /* fall through */
case 75 : /* fall through */
case 76 : /* fall through */
case 77 : /* fall through */
case 78 : /* fall through */
case 79 : /* fall through */
case 80 : /* fall through */
case 81 : /* fall through */
case 82 : /* fall through */
case 83 : /* fall through */
case 84 : /* fall through */
case 85 : /* fall through */
case 86 : /* fall through */
case 87 : /* fall through */
case 88 : /* fall through */
case 89 : /* fall through */
case 90 : /* fall through */
case 91 : /* fall through */
case 92 : /* fall through */
case 93 : /* fall through */
case 94 : /* fall through */
case 95 : /* fall through */
case 96 : /* fall through */
case 97 : /* fall through */
case 98 : /* fall through */
case 99 : /* fall through */
case 100 : /* fall through */
case 101 : /* fall through */
case 102 : /* fall through */
case 103 : /* fall through */
case 104 : /* fall through */
case 105 : /* fall through */
case 106 : /* fall through */
case 107 : /* fall through */
case 108 : /* fall through */
case 109 : /* fall through */
case 110 : /* fall through */
case 111 : /* fall through */
case 112 : /* fall through */
case 113 : /* fall through */
case 114 : /* fall through */
case 115 : /* fall through */
case 116 : /* fall through */
case 117 : /* fall through */
case 118 : /* fall through */
case 119 : /* fall through */
case 120 : /* fall through */
case 121 : /* fall through */
case 122 : /* fall through */
case 123 : /* fall through */
case 124 : /* fall through */
case 125 : /* fall through */
case 126 : /* fall through */
case 127 : itype = CRISV10F_INSN_ADDI_B_R; goto extract_sfmt_addi_b_r;
case 15 :
{
unsigned int val = (((insn >> 15) & (1 << 0)));
switch (val)
{
case 0 : itype = CRISV10F_INSN_NOP; goto extract_sfmt_nop;
case 1 : itype = CRISV10F_INSN_ADDI_B_R; goto extract_sfmt_addi_b_r;
default : itype = CRISV10F_INSN_X_INVALID; goto extract_sfmt_empty;
}
}
default : itype = CRISV10F_INSN_X_INVALID; goto extract_sfmt_empty;
}
}
case 81 : itype = CRISV10F_INSN_ADDI_W_R; goto extract_sfmt_addi_b_r;
case 82 : itype = CRISV10F_INSN_ADDI_D_R; goto extract_sfmt_addi_b_r;
case 83 : itype = CRISV10F_INSN_SCC; goto extract_sfmt_scc;
case 84 :
{
unsigned int val = (((insn >> 0) & (15 << 0)));
switch (val)
{
case 0 : /* fall through */
case 1 : /* fall through */
case 2 : /* fall through */
case 3 : /* fall through */
case 4 : /* fall through */
case 5 : /* fall through */
case 6 : /* fall through */
case 7 : /* fall through */
case 8 : /* fall through */
case 9 : /* fall through */
case 10 : /* fall through */
case 11 : /* fall through */
case 12 : /* fall through */
case 13 : /* fall through */
case 14 : itype = CRISV10F_INSN_ADDI_ACR_B_R; goto extract_sfmt_addi_acr_b_r;
case 15 : itype = CRISV10F_INSN_BIAP_PC_B_R; goto extract_sfmt_biap_pc_b_r;
default : itype = CRISV10F_INSN_X_INVALID; goto extract_sfmt_empty;
}
}
case 85 :
{
unsigned int val = (((insn >> 0) & (15 << 0)));
switch (val)
{
case 0 : /* fall through */
case 1 : /* fall through */
case 2 : /* fall through */
case 3 : /* fall through */
case 4 : /* fall through */
case 5 : /* fall through */
case 6 : /* fall through */
case 7 : /* fall through */
case 8 : /* fall through */
case 9 : /* fall through */
case 10 : /* fall through */
case 11 : /* fall through */
case 12 : /* fall through */
case 13 : /* fall through */
case 14 : itype = CRISV10F_INSN_ADDI_ACR_W_R; goto extract_sfmt_addi_acr_b_r;
case 15 : itype = CRISV10F_INSN_BIAP_PC_W_R; goto extract_sfmt_biap_pc_b_r;
default : itype = CRISV10F_INSN_X_INVALID; goto extract_sfmt_empty;
}
}
case 86 :
{
unsigned int val = (((insn >> 0) & (15 << 0)));
switch (val)
{
case 0 : /* fall through */
case 1 : /* fall through */
case 2 : /* fall through */
case 3 : /* fall through */
case 4 : /* fall through */
case 5 : /* fall through */
case 6 : /* fall through */
case 7 : /* fall through */
case 8 : /* fall through */
case 9 : /* fall through */
case 10 : /* fall through */
case 11 : /* fall through */
case 12 : /* fall through */
case 13 : /* fall through */
case 14 : itype = CRISV10F_INSN_ADDI_ACR_D_R; goto extract_sfmt_addi_acr_b_r;
case 15 : itype = CRISV10F_INSN_BIAP_PC_D_R; goto extract_sfmt_biap_pc_b_r;
default : itype = CRISV10F_INSN_X_INVALID; goto extract_sfmt_empty;
}
}
case 88 : itype = CRISV10F_INSN_NEG_B_R; goto extract_sfmt_neg_b_r;
case 89 : itype = CRISV10F_INSN_NEG_W_R; goto extract_sfmt_neg_b_r;
case 90 : itype = CRISV10F_INSN_NEG_D_R; goto extract_sfmt_neg_d_r;
case 91 : itype = CRISV10F_INSN_SETF; goto extract_sfmt_setf;
case 92 : itype = CRISV10F_INSN_BOUND_R_B_R; goto extract_sfmt_dstep;
case 93 : itype = CRISV10F_INSN_BOUND_R_W_R; goto extract_sfmt_dstep;
case 94 : itype = CRISV10F_INSN_BOUND_R_D_R; goto extract_sfmt_dstep;
case 95 : itype = CRISV10F_INSN_CLEARF; goto extract_sfmt_setf;
case 96 : itype = CRISV10F_INSN_ADD_B_R; goto extract_sfmt_add_b_r;
case 97 : itype = CRISV10F_INSN_ADD_W_R; goto extract_sfmt_add_b_r;
case 98 : itype = CRISV10F_INSN_ADD_D_R; goto extract_sfmt_add_d_r;
case 99 : itype = CRISV10F_INSN_MOVE_R_SPRV10; goto extract_sfmt_move_r_sprv10;
case 100 : itype = CRISV10F_INSN_MOVE_B_R; goto extract_sfmt_move_b_r;
case 101 : itype = CRISV10F_INSN_MOVE_W_R; goto extract_sfmt_move_b_r;
case 102 :
{
unsigned int val = (((insn >> 0) & (15 << 0)));
switch (val)
{
case 0 : /* fall through */
case 1 : /* fall through */
case 2 : /* fall through */
case 3 : /* fall through */
case 4 : /* fall through */
case 5 : /* fall through */
case 6 : /* fall through */
case 7 : /* fall through */
case 8 : /* fall through */
case 9 : /* fall through */
case 10 : /* fall through */
case 11 : /* fall through */
case 12 : /* fall through */
case 13 : /* fall through */
case 14 : itype = CRISV10F_INSN_MOVE_D_R; goto extract_sfmt_move_d_r;
case 15 : itype = CRISV10F_INSN_MOVEPCR; goto extract_sfmt_movepcr;
default : itype = CRISV10F_INSN_X_INVALID; goto extract_sfmt_empty;
}
}
case 103 :
{
unsigned int val = (((insn >> 0) & (15 << 0)));
switch (val)
{
case 0 : /* fall through */
case 1 : /* fall through */
case 2 : /* fall through */
case 3 : /* fall through */
case 4 : /* fall through */
case 5 : /* fall through */
case 6 : /* fall through */
case 7 : /* fall through */
case 8 : /* fall through */
case 9 : /* fall through */
case 10 : /* fall through */
case 11 : /* fall through */
case 12 : /* fall through */
case 13 : /* fall through */
case 14 : itype = CRISV10F_INSN_MOVE_SPR_RV10; goto extract_sfmt_move_spr_rv10;
case 15 : itype = CRISV10F_INSN_RET_TYPE; goto extract_sfmt_ret_type;
default : itype = CRISV10F_INSN_X_INVALID; goto extract_sfmt_empty;
}
}
case 104 : itype = CRISV10F_INSN_SUB_B_R; goto extract_sfmt_add_b_r;
case 105 : itype = CRISV10F_INSN_SUB_W_R; goto extract_sfmt_add_b_r;
case 106 : itype = CRISV10F_INSN_SUB_D_R; goto extract_sfmt_add_d_r;
case 107 : itype = CRISV10F_INSN_ABS; goto extract_sfmt_movs_b_r;
case 108 : itype = CRISV10F_INSN_CMP_R_B_R; goto extract_sfmt_cmp_r_b_r;
case 109 : itype = CRISV10F_INSN_CMP_R_W_R; goto extract_sfmt_cmp_r_b_r;
case 110 : itype = CRISV10F_INSN_CMP_R_D_R; goto extract_sfmt_cmp_r_b_r;
case 111 : itype = CRISV10F_INSN_DSTEP; goto extract_sfmt_dstep;
case 112 : itype = CRISV10F_INSN_AND_B_R; goto extract_sfmt_and_b_r;
case 113 : itype = CRISV10F_INSN_AND_W_R; goto extract_sfmt_and_b_r;
case 114 : itype = CRISV10F_INSN_AND_D_R; goto extract_sfmt_and_d_r;
case 115 : itype = CRISV10F_INSN_LZ; goto extract_sfmt_movs_b_r;
case 116 : itype = CRISV10F_INSN_ORR_B_R; goto extract_sfmt_and_b_r;
case 117 : itype = CRISV10F_INSN_ORR_W_R; goto extract_sfmt_and_b_r;
case 118 : itype = CRISV10F_INSN_ORR_D_R; goto extract_sfmt_and_d_r;
case 119 : itype = CRISV10F_INSN_SWAP; goto extract_sfmt_swap;
case 120 : itype = CRISV10F_INSN_ASRR_B_R; goto extract_sfmt_and_b_r;
case 121 : itype = CRISV10F_INSN_ASRR_W_R; goto extract_sfmt_and_b_r;
case 122 : itype = CRISV10F_INSN_ASRR_D_R; goto extract_sfmt_and_d_r;
case 123 : itype = CRISV10F_INSN_XOR; goto extract_sfmt_dstep;
case 124 : itype = CRISV10F_INSN_LSRR_B_R; goto extract_sfmt_lsrr_b_r;
case 125 : itype = CRISV10F_INSN_LSRR_W_R; goto extract_sfmt_lsrr_b_r;
case 126 : itype = CRISV10F_INSN_LSRR_D_R; goto extract_sfmt_lsrr_d_r;
case 127 : itype = CRISV10F_INSN_MSTEP; goto extract_sfmt_mstep;
case 128 : itype = CRISV10F_INSN_ADDU_M_B_M; goto extract_sfmt_adds_m_b_m;
case 129 : itype = CRISV10F_INSN_ADDU_M_W_M; goto extract_sfmt_adds_m_w_m;
case 130 : itype = CRISV10F_INSN_ADDS_M_B_M; goto extract_sfmt_adds_m_b_m;
case 131 :
{
unsigned int val = (((insn >> 8) & (7 << 4)) | ((insn >> 0) & (15 << 0)));
switch (val)
{
case 0 : /* fall through */
case 1 : /* fall through */
case 2 : /* fall through */
case 3 : /* fall through */
case 4 : /* fall through */
case 5 : /* fall through */
case 6 : /* fall through */
case 7 : /* fall through */
case 8 : /* fall through */
case 9 : /* fall through */
case 10 : /* fall through */
case 11 : /* fall through */
case 12 : /* fall through */
case 13 : /* fall through */
case 14 : /* fall through */
case 15 : /* fall through */
case 16 : /* fall through */
case 17 : /* fall through */
case 18 : /* fall through */
case 19 : /* fall through */
case 20 : /* fall through */
case 21 : /* fall through */
case 22 : /* fall through */
case 23 : /* fall through */
case 24 : /* fall through */
case 25 : /* fall through */
case 26 : /* fall through */
case 27 : /* fall through */
case 28 : /* fall through */
case 29 : /* fall through */
case 30 : /* fall through */
case 31 : /* fall through */
case 32 : /* fall through */
case 33 : /* fall through */
case 34 : /* fall through */
case 35 : /* fall through */
case 36 : /* fall through */
case 37 : /* fall through */
case 38 : /* fall through */
case 39 : /* fall through */
case 40 : /* fall through */
case 41 : /* fall through */
case 42 : /* fall through */
case 43 : /* fall through */
case 44 : /* fall through */
case 45 : /* fall through */
case 46 : /* fall through */
case 47 : /* fall through */
case 48 : /* fall through */
case 49 : /* fall through */
case 50 : /* fall through */
case 51 : /* fall through */
case 52 : /* fall through */
case 53 : /* fall through */
case 54 : /* fall through */
case 55 : /* fall through */
case 56 : /* fall through */
case 57 : /* fall through */
case 58 : /* fall through */
case 59 : /* fall through */
case 60 : /* fall through */
case 61 : /* fall through */
case 62 : /* fall through */
case 63 : /* fall through */
case 64 : /* fall through */
case 65 : /* fall through */
case 66 : /* fall through */
case 67 : /* fall through */
case 68 : /* fall through */
case 69 : /* fall through */
case 70 : /* fall through */
case 71 : /* fall through */
case 72 : /* fall through */
case 73 : /* fall through */
case 74 : /* fall through */
case 75 : /* fall through */
case 76 : /* fall through */
case 77 : /* fall through */
case 78 : /* fall through */
case 79 : /* fall through */
case 80 : /* fall through */
case 81 : /* fall through */
case 82 : /* fall through */
case 83 : /* fall through */
case 84 : /* fall through */
case 85 : /* fall through */
case 86 : /* fall through */
case 87 : /* fall through */
case 88 : /* fall through */
case 89 : /* fall through */
case 90 : /* fall through */
case 91 : /* fall through */
case 92 : /* fall through */
case 93 : /* fall through */
case 94 : /* fall through */
case 95 : /* fall through */
case 96 : /* fall through */
case 97 : /* fall through */
case 98 : /* fall through */
case 99 : /* fall through */
case 100 : /* fall through */
case 101 : /* fall through */
case 102 : /* fall through */
case 103 : /* fall through */
case 104 : /* fall through */
case 105 : /* fall through */
case 106 : /* fall through */
case 107 : /* fall through */
case 108 : /* fall through */
case 109 : /* fall through */
case 110 : /* fall through */
case 111 : /* fall through */
case 112 : /* fall through */
case 113 : /* fall through */
case 114 : /* fall through */
case 115 : /* fall through */
case 116 : /* fall through */
case 117 : /* fall through */
case 118 : /* fall through */
case 119 : /* fall through */
case 120 : /* fall through */
case 121 : /* fall through */
case 122 : /* fall through */
case 123 : /* fall through */
case 124 : /* fall through */
case 125 : /* fall through */
case 126 : itype = CRISV10F_INSN_ADDS_M_W_M; goto extract_sfmt_adds_m_w_m;
case 127 :
{
unsigned int val = (((insn >> 15) & (1 << 0)));
switch (val)
{
case 0 : itype = CRISV10F_INSN_ADDS_M_W_M; goto extract_sfmt_adds_m_w_m;
case 1 : itype = CRISV10F_INSN_ADDSPCPC; goto extract_sfmt_addspcpc;
default : itype = CRISV10F_INSN_X_INVALID; goto extract_sfmt_empty;
}
}
default : itype = CRISV10F_INSN_X_INVALID; goto extract_sfmt_empty;
}
}
case 132 : itype = CRISV10F_INSN_MOVU_M_B_M; goto extract_sfmt_movs_m_b_m;
case 133 : itype = CRISV10F_INSN_MOVU_M_W_M; goto extract_sfmt_movs_m_w_m;
case 134 : itype = CRISV10F_INSN_MOVS_M_B_M; goto extract_sfmt_movs_m_b_m;
case 135 : itype = CRISV10F_INSN_MOVS_M_W_M; goto extract_sfmt_movs_m_w_m;
case 136 : itype = CRISV10F_INSN_SUBU_M_B_M; goto extract_sfmt_adds_m_b_m;
case 137 : itype = CRISV10F_INSN_SUBU_M_W_M; goto extract_sfmt_adds_m_w_m;
case 138 : itype = CRISV10F_INSN_SUBS_M_B_M; goto extract_sfmt_adds_m_b_m;
case 139 : itype = CRISV10F_INSN_SUBS_M_W_M; goto extract_sfmt_adds_m_w_m;
case 140 : itype = CRISV10F_INSN_CMPU_M_B_M; goto extract_sfmt_cmp_m_b_m;
case 141 : itype = CRISV10F_INSN_CMPU_M_W_M; goto extract_sfmt_cmp_m_w_m;
case 142 : itype = CRISV10F_INSN_CMPS_M_B_M; goto extract_sfmt_cmp_m_b_m;
case 143 : itype = CRISV10F_INSN_CMPS_M_W_M; goto extract_sfmt_cmp_m_w_m;
case 144 : itype = CRISV10F_INSN_MULU_B; goto extract_sfmt_muls_b;
case 145 : itype = CRISV10F_INSN_MULU_W; goto extract_sfmt_muls_b;
case 146 : itype = CRISV10F_INSN_MULU_D; goto extract_sfmt_muls_b;
case 147 :
{
unsigned int val = (((insn >> 12) & (15 << 0)));
switch (val)
{
case 0 : /* fall through */
case 1 : /* fall through */
case 2 : /* fall through */
case 3 : /* fall through */
case 4 : /* fall through */
case 5 : /* fall through */
case 6 : /* fall through */
case 7 : /* fall through */
case 8 : /* fall through */
case 9 : /* fall through */
case 10 : /* fall through */
case 11 : /* fall through */
case 12 : /* fall through */
case 13 : /* fall through */
case 15 : itype = CRISV10F_INSN_JUMP_M; goto extract_sfmt_jump_m;
case 14 : itype = CRISV10F_INSN_BREAK; goto extract_sfmt_break;
default : itype = CRISV10F_INSN_X_INVALID; goto extract_sfmt_empty;
}
}
case 148 : itype = CRISV10F_INSN_ADDO_M_B_M; goto extract_sfmt_addo_m_b_m;
case 149 : itype = CRISV10F_INSN_ADDO_M_W_M; goto extract_sfmt_addo_m_w_m;
case 150 : itype = CRISV10F_INSN_ADDO_M_D_M; goto extract_sfmt_addo_m_d_m;
case 151 :
if ((base_insn & 0xfbf0) == 0x970)
{ itype = CRISV10F_INSN_DIP_M; goto extract_sfmt_dip_m; }
itype = CRISV10F_INSN_X_INVALID; goto extract_sfmt_empty;
case 155 : itype = CRISV10F_INSN_JUMP_R; goto extract_sfmt_jump_r;
case 156 : itype = CRISV10F_INSN_BOUND_M_B_M; goto extract_sfmt_bound_m_b_m;
case 157 : itype = CRISV10F_INSN_BOUND_M_W_M; goto extract_sfmt_bound_m_w_m;
case 158 : itype = CRISV10F_INSN_BOUND_M_D_M; goto extract_sfmt_bound_m_d_m;
case 160 : itype = CRISV10F_INSN_ADD_M_B_M; goto extract_sfmt_add_m_b_m;
case 161 : itype = CRISV10F_INSN_ADD_M_W_M; goto extract_sfmt_add_m_w_m;
case 162 : itype = CRISV10F_INSN_ADD_M_D_M; goto extract_sfmt_add_m_d_m;
case 163 : itype = CRISV10F_INSN_MOVE_M_SPRV10; goto extract_sfmt_move_m_sprv10;
case 164 : itype = CRISV10F_INSN_MOVE_M_B_M; goto extract_sfmt_move_m_b_m;
case 165 : itype = CRISV10F_INSN_MOVE_M_W_M; goto extract_sfmt_move_m_w_m;
case 166 : itype = CRISV10F_INSN_MOVE_M_D_M; goto extract_sfmt_move_m_d_m;
case 167 : /* fall through */
case 231 : itype = CRISV10F_INSN_MOVE_SPR_MV10; goto extract_sfmt_move_spr_mv10;
case 168 : itype = CRISV10F_INSN_SUB_M_B_M; goto extract_sfmt_add_m_b_m;
case 169 : itype = CRISV10F_INSN_SUB_M_W_M; goto extract_sfmt_add_m_w_m;
case 170 : itype = CRISV10F_INSN_SUB_M_D_M; goto extract_sfmt_add_m_d_m;
case 172 : itype = CRISV10F_INSN_CMP_M_B_M; goto extract_sfmt_cmp_m_b_m;
case 173 : itype = CRISV10F_INSN_CMP_M_W_M; goto extract_sfmt_cmp_m_w_m;
case 174 : itype = CRISV10F_INSN_CMP_M_D_M; goto extract_sfmt_cmp_m_d_m;
case 176 : itype = CRISV10F_INSN_AND_M_B_M; goto extract_sfmt_and_m_b_m;
case 177 : itype = CRISV10F_INSN_AND_M_W_M; goto extract_sfmt_and_m_w_m;
case 178 : itype = CRISV10F_INSN_AND_M_D_M; goto extract_sfmt_and_m_d_m;
case 180 : itype = CRISV10F_INSN_OR_M_B_M; goto extract_sfmt_and_m_b_m;
case 181 : itype = CRISV10F_INSN_OR_M_W_M; goto extract_sfmt_and_m_w_m;
case 182 : itype = CRISV10F_INSN_OR_M_D_M; goto extract_sfmt_and_m_d_m;
case 183 : /* fall through */
case 247 :
if ((base_insn & 0xfbf0) == 0x3b70)
{ itype = CRISV10F_INSN_SBFS; goto extract_sfmt_sbfs; }
itype = CRISV10F_INSN_X_INVALID; goto extract_sfmt_empty;
case 184 : /* fall through */
case 248 :
if ((base_insn & 0xfbf0) == 0xb80)
{ itype = CRISV10F_INSN_TEST_M_B_M; goto extract_sfmt_test_m_b_m; }
itype = CRISV10F_INSN_X_INVALID; goto extract_sfmt_empty;
case 185 : /* fall through */
case 249 :
if ((base_insn & 0xfbf0) == 0xb90)
{ itype = CRISV10F_INSN_TEST_M_W_M; goto extract_sfmt_test_m_w_m; }
itype = CRISV10F_INSN_X_INVALID; goto extract_sfmt_empty;
case 186 : /* fall through */
case 250 :
if ((base_insn & 0xfbf0) == 0xba0)