summaryrefslogtreecommitdiff
path: root/bfd/xtensa-modules.c
blob: e5d7682f09a3b97885eb994851c6b91420a8c31e (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
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
/* Xtensa configuration-specific ISA information.
   Copyright 2003 Free Software Foundation, Inc.

   This file is part of BFD, the Binary File Descriptor library.

   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 2 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, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */

#include <xtensa-isa.h>
#include "xtensa-isa-internal.h"
#include "ansidecl.h"

#define BPW 32
#define WINDEX(_n) ((_n) / BPW)
#define BINDEX(_n) ((_n) %% BPW)

static uint32 tie_do_reloc_l (uint32, uint32) ATTRIBUTE_UNUSED;
static uint32 tie_undo_reloc_l (uint32, uint32) ATTRIBUTE_UNUSED;

static uint32
tie_do_reloc_l (uint32 addr, uint32 pc)
{
  return (addr - pc);
}

static uint32
tie_undo_reloc_l (uint32 offset, uint32 pc)
{
  return (pc + offset);
}

xtensa_opcode_internal** get_opcodes (void);
int get_num_opcodes (void);
int decode_insn (const xtensa_insnbuf);
int interface_version (void);

uint32 get_bbi_field (const xtensa_insnbuf);
void set_bbi_field (xtensa_insnbuf, uint32);
uint32 get_bbi4_field (const xtensa_insnbuf);
void set_bbi4_field (xtensa_insnbuf, uint32);
uint32 get_i_field (const xtensa_insnbuf);
void set_i_field (xtensa_insnbuf, uint32);
uint32 get_imm12_field (const xtensa_insnbuf);
void set_imm12_field (xtensa_insnbuf, uint32);
uint32 get_imm12b_field (const xtensa_insnbuf);
void set_imm12b_field (xtensa_insnbuf, uint32);
uint32 get_imm16_field (const xtensa_insnbuf);
void set_imm16_field (xtensa_insnbuf, uint32);
uint32 get_imm4_field (const xtensa_insnbuf);
void set_imm4_field (xtensa_insnbuf, uint32);
uint32 get_imm6_field (const xtensa_insnbuf);
void set_imm6_field (xtensa_insnbuf, uint32);
uint32 get_imm6hi_field (const xtensa_insnbuf);
void set_imm6hi_field (xtensa_insnbuf, uint32);
uint32 get_imm6lo_field (const xtensa_insnbuf);
void set_imm6lo_field (xtensa_insnbuf, uint32);
uint32 get_imm7_field (const xtensa_insnbuf);
void set_imm7_field (xtensa_insnbuf, uint32);
uint32 get_imm7hi_field (const xtensa_insnbuf);
void set_imm7hi_field (xtensa_insnbuf, uint32);
uint32 get_imm7lo_field (const xtensa_insnbuf);
void set_imm7lo_field (xtensa_insnbuf, uint32);
uint32 get_imm8_field (const xtensa_insnbuf);
void set_imm8_field (xtensa_insnbuf, uint32);
uint32 get_m_field (const xtensa_insnbuf);
void set_m_field (xtensa_insnbuf, uint32);
uint32 get_mn_field (const xtensa_insnbuf);
void set_mn_field (xtensa_insnbuf, uint32);
uint32 get_n_field (const xtensa_insnbuf);
void set_n_field (xtensa_insnbuf, uint32);
uint32 get_none_field (const xtensa_insnbuf);
void set_none_field (xtensa_insnbuf, uint32);
uint32 get_offset_field (const xtensa_insnbuf);
void set_offset_field (xtensa_insnbuf, uint32);
uint32 get_op0_field (const xtensa_insnbuf);
void set_op0_field (xtensa_insnbuf, uint32);
uint32 get_op1_field (const xtensa_insnbuf);
void set_op1_field (xtensa_insnbuf, uint32);
uint32 get_op2_field (const xtensa_insnbuf);
void set_op2_field (xtensa_insnbuf, uint32);
uint32 get_r_field (const xtensa_insnbuf);
void set_r_field (xtensa_insnbuf, uint32);
uint32 get_s_field (const xtensa_insnbuf);
void set_s_field (xtensa_insnbuf, uint32);
uint32 get_sa4_field (const xtensa_insnbuf);
void set_sa4_field (xtensa_insnbuf, uint32);
uint32 get_sae_field (const xtensa_insnbuf);
void set_sae_field (xtensa_insnbuf, uint32);
uint32 get_sae4_field (const xtensa_insnbuf);
void set_sae4_field (xtensa_insnbuf, uint32);
uint32 get_sal_field (const xtensa_insnbuf);
void set_sal_field (xtensa_insnbuf, uint32);
uint32 get_sar_field (const xtensa_insnbuf);
void set_sar_field (xtensa_insnbuf, uint32);
uint32 get_sas_field (const xtensa_insnbuf);
void set_sas_field (xtensa_insnbuf, uint32);
uint32 get_sas4_field (const xtensa_insnbuf);
void set_sas4_field (xtensa_insnbuf, uint32);
uint32 get_sr_field (const xtensa_insnbuf);
void set_sr_field (xtensa_insnbuf, uint32);
uint32 get_t_field (const xtensa_insnbuf);
void set_t_field (xtensa_insnbuf, uint32);
uint32 get_thi3_field (const xtensa_insnbuf);
void set_thi3_field (xtensa_insnbuf, uint32);
uint32 get_z_field (const xtensa_insnbuf);
void set_z_field (xtensa_insnbuf, uint32);


uint32
get_bbi_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xf0000) >> 16) |
         ((insn[0] & 0x100) >> 4);
}

void
set_bbi_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfff0ffff) | ((val << 16) & 0xf0000);
  insn[0] = (insn[0] & 0xfffffeff) | ((val << 4) & 0x100);
}

uint32
get_bbi4_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0x100) >> 8);
}

void
set_bbi4_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfffffeff) | ((val << 8) & 0x100);
}

uint32
get_i_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0x80000) >> 19);
}

void
set_i_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfff7ffff) | ((val << 19) & 0x80000);
}

uint32
get_imm12_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xfff));
}

void
set_imm12_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfffff000) | (val & 0xfff);
}

uint32
get_imm12b_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xff)) |
         ((insn[0] & 0xf000) >> 4);
}

void
set_imm12b_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xffffff00) | (val & 0xff);
  insn[0] = (insn[0] & 0xffff0fff) | ((val << 4) & 0xf000);
}

uint32
get_imm16_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xffff));
}

void
set_imm16_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xffff0000) | (val & 0xffff);
}

uint32
get_imm4_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xf00) >> 8);
}

void
set_imm4_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfffff0ff) | ((val << 8) & 0xf00);
}

uint32
get_imm6_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xf00) >> 8) |
         ((insn[0] & 0x30000) >> 12);
}

void
set_imm6_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfffff0ff) | ((val << 8) & 0xf00);
  insn[0] = (insn[0] & 0xfffcffff) | ((val << 12) & 0x30000);
}

uint32
get_imm6hi_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0x30000) >> 16);
}

void
set_imm6hi_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfffcffff) | ((val << 16) & 0x30000);
}

uint32
get_imm6lo_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xf00) >> 8);
}

void
set_imm6lo_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfffff0ff) | ((val << 8) & 0xf00);
}

uint32
get_imm7_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xf00) >> 8) |
         ((insn[0] & 0x70000) >> 12);
}

void
set_imm7_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfffff0ff) | ((val << 8) & 0xf00);
  insn[0] = (insn[0] & 0xfff8ffff) | ((val << 12) & 0x70000);
}

uint32
get_imm7hi_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0x70000) >> 16);
}

void
set_imm7hi_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfff8ffff) | ((val << 16) & 0x70000);
}

uint32
get_imm7lo_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xf00) >> 8);
}

void
set_imm7lo_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfffff0ff) | ((val << 8) & 0xf00);
}

uint32
get_imm8_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xff));
}

void
set_imm8_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xffffff00) | (val & 0xff);
}

uint32
get_m_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0x30000) >> 16);
}

void
set_m_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfffcffff) | ((val << 16) & 0x30000);
}

uint32
get_mn_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0x30000) >> 16) |
         ((insn[0] & 0xc0000) >> 16);
}

void
set_mn_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfffcffff) | ((val << 16) & 0x30000);
  insn[0] = (insn[0] & 0xfff3ffff) | ((val << 16) & 0xc0000);
}

uint32
get_n_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xc0000) >> 18);
}

void
set_n_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfff3ffff) | ((val << 18) & 0xc0000);
}

uint32
get_none_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0x0));
}

void
set_none_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xffffffff) | (val & 0x0);
}

uint32
get_offset_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0x3ffff));
}

void
set_offset_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfffc0000) | (val & 0x3ffff);
}

uint32
get_op0_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xf00000) >> 20);
}

void
set_op0_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xff0fffff) | ((val << 20) & 0xf00000);
}

uint32
get_op1_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xf0) >> 4);
}

void
set_op1_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xffffff0f) | ((val << 4) & 0xf0);
}

uint32
get_op2_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xf));
}

void
set_op2_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfffffff0) | (val & 0xf);
}

uint32
get_r_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xf00) >> 8);
}

void
set_r_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfffff0ff) | ((val << 8) & 0xf00);
}

uint32
get_s_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xf000) >> 12);
}

void
set_s_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xffff0fff) | ((val << 12) & 0xf000);
}

uint32
get_sa4_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0x1));
}

void
set_sa4_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfffffffe) | (val & 0x1);
}

uint32
get_sae_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xf000) >> 12) |
         ((insn[0] & 0x10));
}

void
set_sae_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xffff0fff) | ((val << 12) & 0xf000);
  insn[0] = (insn[0] & 0xffffffef) | (val & 0x10);
}

uint32
get_sae4_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0x10) >> 4);
}

void
set_sae4_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xffffffef) | ((val << 4) & 0x10);
}

uint32
get_sal_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xf0000) >> 16) |
         ((insn[0] & 0x1) << 4);
}

void
set_sal_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfff0ffff) | ((val << 16) & 0xf0000);
  insn[0] = (insn[0] & 0xfffffffe) | ((val >> 4) & 0x1);
}

uint32
get_sar_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xf000) >> 12) |
         ((insn[0] & 0x1) << 4);
}

void
set_sar_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xffff0fff) | ((val << 12) & 0xf000);
  insn[0] = (insn[0] & 0xfffffffe) | ((val >> 4) & 0x1);
}

uint32
get_sas_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xf000) >> 12) |
         ((insn[0] & 0x10000) >> 12);
}

void
set_sas_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xffff0fff) | ((val << 12) & 0xf000);
  insn[0] = (insn[0] & 0xfffeffff) | ((val << 12) & 0x10000);
}

uint32
get_sas4_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0x10000) >> 16);
}

void
set_sas4_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfffeffff) | ((val << 16) & 0x10000);
}

uint32
get_sr_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xf00) >> 8) |
         ((insn[0] & 0xf000) >> 8);
}

void
set_sr_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfffff0ff) | ((val << 8) & 0xf00);
  insn[0] = (insn[0] & 0xffff0fff) | ((val << 8) & 0xf000);
}

uint32
get_t_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xf0000) >> 16);
}

void
set_t_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfff0ffff) | ((val << 16) & 0xf0000);
}

uint32
get_thi3_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0xe0000) >> 17);
}

void
set_thi3_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfff1ffff) | ((val << 17) & 0xe0000);
}

uint32
get_z_field (const xtensa_insnbuf insn)
{
  return ((insn[0] & 0x40000) >> 18);
}

void
set_z_field (xtensa_insnbuf insn, uint32 val)
{
  insn[0] = (insn[0] & 0xfffbffff) | ((val << 18) & 0x40000);
}

uint32 decode_b4constu (uint32);
xtensa_encode_result encode_b4constu (uint32 *);
uint32 decode_simm8x256 (uint32);
xtensa_encode_result encode_simm8x256 (uint32 *);
uint32 decode_soffset (uint32);
xtensa_encode_result encode_soffset (uint32 *);
uint32 decode_imm4 (uint32);
xtensa_encode_result encode_imm4 (uint32 *);
uint32 decode_op0 (uint32);
xtensa_encode_result encode_op0 (uint32 *);
uint32 decode_op1 (uint32);
xtensa_encode_result encode_op1 (uint32 *);
uint32 decode_imm6 (uint32);
xtensa_encode_result encode_imm6 (uint32 *);
uint32 decode_op2 (uint32);
xtensa_encode_result encode_op2 (uint32 *);
uint32 decode_imm7 (uint32);
xtensa_encode_result encode_imm7 (uint32 *);
uint32 decode_simm4 (uint32);
xtensa_encode_result encode_simm4 (uint32 *);
uint32 decode_ai4const (uint32);
xtensa_encode_result encode_ai4const (uint32 *);
uint32 decode_imm8 (uint32);
xtensa_encode_result encode_imm8 (uint32 *);
uint32 decode_sae (uint32);
xtensa_encode_result encode_sae (uint32 *);
uint32 decode_imm7lo (uint32);
xtensa_encode_result encode_imm7lo (uint32 *);
uint32 decode_simm7 (uint32);
xtensa_encode_result encode_simm7 (uint32 *);
uint32 decode_simm8 (uint32);
xtensa_encode_result encode_simm8 (uint32 *);
uint32 decode_uimm12x8 (uint32);
xtensa_encode_result encode_uimm12x8 (uint32 *);
uint32 decode_sal (uint32);
xtensa_encode_result encode_sal (uint32 *);
uint32 decode_uimm6 (uint32);
xtensa_encode_result encode_uimm6 (uint32 *);
uint32 decode_sas4 (uint32);
xtensa_encode_result encode_sas4 (uint32 *);
uint32 decode_uimm8 (uint32);
xtensa_encode_result encode_uimm8 (uint32 *);
uint32 decode_uimm16x4 (uint32);
xtensa_encode_result encode_uimm16x4 (uint32 *);
uint32 decode_sar (uint32);
xtensa_encode_result encode_sar (uint32 *);
uint32 decode_sa4 (uint32);
xtensa_encode_result encode_sa4 (uint32 *);
uint32 decode_sas (uint32);
xtensa_encode_result encode_sas (uint32 *);
uint32 decode_imm6hi (uint32);
xtensa_encode_result encode_imm6hi (uint32 *);
uint32 decode_bbi (uint32);
xtensa_encode_result encode_bbi (uint32 *);
uint32 decode_uimm8x2 (uint32);
xtensa_encode_result encode_uimm8x2 (uint32 *);
uint32 decode_uimm8x4 (uint32);
xtensa_encode_result encode_uimm8x4 (uint32 *);
uint32 decode_msalp32 (uint32);
xtensa_encode_result encode_msalp32 (uint32 *);
uint32 decode_bbi4 (uint32);
xtensa_encode_result encode_bbi4 (uint32 *);
uint32 decode_op2p1 (uint32);
xtensa_encode_result encode_op2p1 (uint32 *);
uint32 decode_soffsetx4 (uint32);
xtensa_encode_result encode_soffsetx4 (uint32 *);
uint32 decode_imm6lo (uint32);
xtensa_encode_result encode_imm6lo (uint32 *);
uint32 decode_imm12 (uint32);
xtensa_encode_result encode_imm12 (uint32 *);
uint32 decode_b4const (uint32);
xtensa_encode_result encode_b4const (uint32 *);
uint32 decode_i (uint32);
xtensa_encode_result encode_i (uint32 *);
uint32 decode_imm16 (uint32);
xtensa_encode_result encode_imm16 (uint32 *);
uint32 decode_mn (uint32);
xtensa_encode_result encode_mn (uint32 *);
uint32 decode_m (uint32);
xtensa_encode_result encode_m (uint32 *);
uint32 decode_n (uint32);
xtensa_encode_result encode_n (uint32 *);
uint32 decode_none (uint32);
xtensa_encode_result encode_none (uint32 *);
uint32 decode_imm12b (uint32);
xtensa_encode_result encode_imm12b (uint32 *);
uint32 decode_r (uint32);
xtensa_encode_result encode_r (uint32 *);
uint32 decode_s (uint32);
xtensa_encode_result encode_s (uint32 *);
uint32 decode_t (uint32);
xtensa_encode_result encode_t (uint32 *);
uint32 decode_thi3 (uint32);
xtensa_encode_result encode_thi3 (uint32 *);
uint32 decode_sae4 (uint32);
xtensa_encode_result encode_sae4 (uint32 *);
uint32 decode_offset (uint32);
xtensa_encode_result encode_offset (uint32 *);
uint32 decode_imm7hi (uint32);
xtensa_encode_result encode_imm7hi (uint32 *);
uint32 decode_uimm4x16 (uint32);
xtensa_encode_result encode_uimm4x16 (uint32 *);
uint32 decode_simm12b (uint32);
xtensa_encode_result encode_simm12b (uint32 *);
uint32 decode_lsi4x4 (uint32);
xtensa_encode_result encode_lsi4x4 (uint32 *);
uint32 decode_z (uint32);
xtensa_encode_result encode_z (uint32 *);
uint32 decode_simm12 (uint32);
xtensa_encode_result encode_simm12 (uint32 *);
uint32 decode_sr (uint32);
xtensa_encode_result encode_sr (uint32 *);
uint32 decode_nimm4x2 (uint32);
xtensa_encode_result encode_nimm4x2 (uint32 *);


static const uint32 b4constu_table[] = {
  32768,
  65536,
  2,
  3,
  4,
  5,
  6,
  7,
  8,
  10,
  12,
  16,
  32,
  64,
  128,
  256
};

uint32
decode_b4constu (uint32 val)
{
  val = b4constu_table[val];
  return val;
}

xtensa_encode_result
encode_b4constu (uint32 *valp)
{
  uint32 val = *valp;
  unsigned i;
  for (i = 0; i < (1 << 4); i += 1)
    if (b4constu_table[i] == val) goto found;
  return xtensa_encode_result_not_in_table;
 found:
  val = i;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_simm8x256 (uint32 val)
{
  val = (val ^ 0x80) - 0x80;
  val <<= 8;
  return val;
}

xtensa_encode_result
encode_simm8x256 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val & ((1 << 8) - 1)) != 0)
    return xtensa_encode_result_align;
  val = (signed int) val >> 8;
  if (((val + (1 << 7)) >> 8) != 0)
    {
      if ((signed int) val > 0)
        return xtensa_encode_result_too_high;
      else
        return xtensa_encode_result_too_low;
    }
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_soffset (uint32 val)
{
  val = (val ^ 0x20000) - 0x20000;
  return val;
}

xtensa_encode_result
encode_soffset (uint32 *valp)
{
  uint32 val = *valp;
  if (((val + (1 << 17)) >> 18) != 0)
    {
      if ((signed int) val > 0)
        return xtensa_encode_result_too_high;
      else
        return xtensa_encode_result_too_low;
    }
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_imm4 (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_imm4 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 4) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_op0 (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_op0 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 4) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_op1 (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_op1 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 4) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_imm6 (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_imm6 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 6) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_op2 (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_op2 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 4) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_imm7 (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_imm7 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 7) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_simm4 (uint32 val)
{
  val = (val ^ 0x8) - 0x8;
  return val;
}

xtensa_encode_result
encode_simm4 (uint32 *valp)
{
  uint32 val = *valp;
  if (((val + (1 << 3)) >> 4) != 0)
    {
      if ((signed int) val > 0)
        return xtensa_encode_result_too_high;
      else
        return xtensa_encode_result_too_low;
    }
  *valp = val;
  return xtensa_encode_result_ok;
}

static const uint32 ai4const_table[] = {
  -1,
  1,
  2,
  3,
  4,
  5,
  6,
  7,
  8,
  9,
  10,
  11,
  12,
  13,
  14,
  15
};

uint32
decode_ai4const (uint32 val)
{
  val = ai4const_table[val];
  return val;
}

xtensa_encode_result
encode_ai4const (uint32 *valp)
{
  uint32 val = *valp;
  unsigned i;
  for (i = 0; i < (1 << 4); i += 1)
    if (ai4const_table[i] == val) goto found;
  return xtensa_encode_result_not_in_table;
 found:
  val = i;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_imm8 (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_imm8 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 8) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_sae (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_sae (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 5) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_imm7lo (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_imm7lo (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 4) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_simm7 (uint32 val)
{
  if (val > 95)
      val |= -32;
  return val;
}

xtensa_encode_result
encode_simm7 (uint32 *valp)
{
  uint32 val = *valp;
  if ((signed int) val < -32)
    return xtensa_encode_result_too_low;
  if ((signed int) val > 95)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_simm8 (uint32 val)
{
  val = (val ^ 0x80) - 0x80;
  return val;
}

xtensa_encode_result
encode_simm8 (uint32 *valp)
{
  uint32 val = *valp;
  if (((val + (1 << 7)) >> 8) != 0)
    {
      if ((signed int) val > 0)
        return xtensa_encode_result_too_high;
      else
        return xtensa_encode_result_too_low;
    }
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_uimm12x8 (uint32 val)
{
  val <<= 3;
  return val;
}

xtensa_encode_result
encode_uimm12x8 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val & ((1 << 3) - 1)) != 0)
    return xtensa_encode_result_align;
  val = (signed int) val >> 3;
  if ((val >> 12) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_sal (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_sal (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 5) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_uimm6 (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_uimm6 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 6) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_sas4 (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_sas4 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 1) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_uimm8 (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_uimm8 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 8) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_uimm16x4 (uint32 val)
{
  val |= -1 << 16;
  val <<= 2;
  return val;
}

xtensa_encode_result
encode_uimm16x4 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val & ((1 << 2) - 1)) != 0)
    return xtensa_encode_result_align;
  val = (signed int) val >> 2;
  if ((signed int) val >> 16 != -1)
    {
      if ((signed int) val >= 0)
        return xtensa_encode_result_too_high;
      else
        return xtensa_encode_result_too_low;
    }
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_sar (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_sar (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 5) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_sa4 (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_sa4 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 1) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_sas (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_sas (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 5) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_imm6hi (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_imm6hi (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 2) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_bbi (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_bbi (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 5) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_uimm8x2 (uint32 val)
{
  val <<= 1;
  return val;
}

xtensa_encode_result
encode_uimm8x2 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val & ((1 << 1) - 1)) != 0)
    return xtensa_encode_result_align;
  val = (signed int) val >> 1;
  if ((val >> 8) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_uimm8x4 (uint32 val)
{
  val <<= 2;
  return val;
}

xtensa_encode_result
encode_uimm8x4 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val & ((1 << 2) - 1)) != 0)
    return xtensa_encode_result_align;
  val = (signed int) val >> 2;
  if ((val >> 8) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

static const uint32 mip32const_table[] = {
  32,
  31,
  30,
  29,
  28,
  27,
  26,
  25,
  24,
  23,
  22,
  21,
  20,
  19,
  18,
  17,
  16,
  15,
  14,
  13,
  12,
  11,
  10,
  9,
  8,
  7,
  6,
  5,
  4,
  3,
  2,
  1
};

uint32
decode_msalp32 (uint32 val)
{
  val = mip32const_table[val];
  return val;
}

xtensa_encode_result
encode_msalp32 (uint32 *valp)
{
  uint32 val = *valp;
  unsigned i;
  for (i = 0; i < (1 << 5); i += 1)
    if (mip32const_table[i] == val) goto found;
  return xtensa_encode_result_not_in_table;
 found:
  val = i;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_bbi4 (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_bbi4 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 1) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

static const uint32 i4p1const_table[] = {
  1,
  2,
  3,
  4,
  5,
  6,
  7,
  8,
  9,
  10,
  11,
  12,
  13,
  14,
  15,
  16
};

uint32
decode_op2p1 (uint32 val)
{
  val = i4p1const_table[val];
  return val;
}

xtensa_encode_result
encode_op2p1 (uint32 *valp)
{
  uint32 val = *valp;
  unsigned i;
  for (i = 0; i < (1 << 4); i += 1)
    if (i4p1const_table[i] == val) goto found;
  return xtensa_encode_result_not_in_table;
 found:
  val = i;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_soffsetx4 (uint32 val)
{
  val = (val ^ 0x20000) - 0x20000;
  val <<= 2;
  return val;
}

xtensa_encode_result
encode_soffsetx4 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val & ((1 << 2) - 1)) != 0)
    return xtensa_encode_result_align;
  val = (signed int) val >> 2;
  if (((val + (1 << 17)) >> 18) != 0)
    {
      if ((signed int) val > 0)
        return xtensa_encode_result_too_high;
      else
        return xtensa_encode_result_too_low;
    }
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_imm6lo (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_imm6lo (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 4) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_imm12 (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_imm12 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 12) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

static const uint32 b4const_table[] = {
  -1,
  1,
  2,
  3,
  4,
  5,
  6,
  7,
  8,
  10,
  12,
  16,
  32,
  64,
  128,
  256
};

uint32
decode_b4const (uint32 val)
{
  val = b4const_table[val];
  return val;
}

xtensa_encode_result
encode_b4const (uint32 *valp)
{
  uint32 val = *valp;
  unsigned i;
  for (i = 0; i < (1 << 4); i += 1)
    if (b4const_table[i] == val) goto found;
  return xtensa_encode_result_not_in_table;
 found:
  val = i;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_i (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_i (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 1) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_imm16 (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_imm16 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 16) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_mn (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_mn (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 4) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_m (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_m (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 2) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_n (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_n (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 2) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_none (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_none (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 0) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_imm12b (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_imm12b (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 12) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_r (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_r (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 4) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_s (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_s (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 4) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_t (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_t (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 4) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_thi3 (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_thi3 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 3) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_sae4 (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_sae4 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 1) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_offset (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_offset (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 18) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_imm7hi (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_imm7hi (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 3) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_uimm4x16 (uint32 val)
{
  val <<= 4;
  return val;
}

xtensa_encode_result
encode_uimm4x16 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val & ((1 << 4) - 1)) != 0)
    return xtensa_encode_result_align;
  val = (signed int) val >> 4;
  if ((val >> 4) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_simm12b (uint32 val)
{
  val = (val ^ 0x800) - 0x800;
  return val;
}

xtensa_encode_result
encode_simm12b (uint32 *valp)
{
  uint32 val = *valp;
  if (((val + (1 << 11)) >> 12) != 0)
    {
      if ((signed int) val > 0)
        return xtensa_encode_result_too_high;
      else
        return xtensa_encode_result_too_low;
    }
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_lsi4x4 (uint32 val)
{
  val <<= 2;
  return val;
}

xtensa_encode_result
encode_lsi4x4 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val & ((1 << 2) - 1)) != 0)
    return xtensa_encode_result_align;
  val = (signed int) val >> 2;
  if ((val >> 4) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_z (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_z (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 1) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_simm12 (uint32 val)
{
  val = (val ^ 0x800) - 0x800;
  return val;
}

xtensa_encode_result
encode_simm12 (uint32 *valp)
{
  uint32 val = *valp;
  if (((val + (1 << 11)) >> 12) != 0)
    {
      if ((signed int) val > 0)
        return xtensa_encode_result_too_high;
      else
        return xtensa_encode_result_too_low;
    }
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_sr (uint32 val)
{
  return val;
}

xtensa_encode_result
encode_sr (uint32 *valp)
{
  uint32 val = *valp;
  if ((val >> 8) != 0)
    return xtensa_encode_result_too_high;
  *valp = val;
  return xtensa_encode_result_ok;
}

uint32
decode_nimm4x2 (uint32 val)
{
  val |= -1 << 4;
  val <<= 2;
  return val;
}

xtensa_encode_result
encode_nimm4x2 (uint32 *valp)
{
  uint32 val = *valp;
  if ((val & ((1 << 2) - 1)) != 0)
    return xtensa_encode_result_align;
  val = (signed int) val >> 2;
  if ((signed int) val >> 4 != -1)
    {
      if ((signed int) val >= 0)
        return xtensa_encode_result_too_high;
      else
        return xtensa_encode_result_too_low;
    }
  *valp = val;
  return xtensa_encode_result_ok;
}



uint32 do_reloc_l (uint32, uint32);
uint32 undo_reloc_l (uint32, uint32);
uint32 do_reloc_L (uint32, uint32);
uint32 undo_reloc_L (uint32, uint32);
uint32 do_reloc_r (uint32, uint32);
uint32 undo_reloc_r (uint32, uint32);


uint32
do_reloc_l (uint32 addr, uint32 pc)
{
  return addr - pc - 4;
}

uint32
undo_reloc_l (uint32 offset, uint32 pc)
{
  return pc + offset + 4;
}

uint32
do_reloc_L (uint32 addr, uint32 pc)
{
  return addr - (pc & -4) - 4;
}

uint32
undo_reloc_L (uint32 offset, uint32 pc)
{
  return (pc & -4) + offset + 4;
}

uint32
do_reloc_r (uint32 addr, uint32 pc)
{
  return addr - ((pc+3) & -4);
}

uint32
undo_reloc_r (uint32 offset, uint32 pc)
{
  return ((pc+3) & -4) + offset;
}

static xtensa_operand_internal iib4const_operand = {
  "i",
  '<',
  0,
  get_r_field,
  set_r_field,
  encode_b4const,
  decode_b4const,
  0,
  0
};

static xtensa_operand_internal iiuimm8_operand = {
  "i",
  '<',
  0,
  get_imm8_field,
  set_imm8_field,
  encode_uimm8,
  decode_uimm8,
  0,
  0
};

static xtensa_operand_internal lisoffsetx4_operand = {
  "L",
  '<',
  1,
  get_offset_field,
  set_offset_field,
  encode_soffsetx4,
  decode_soffsetx4,
  do_reloc_L,
  undo_reloc_L,
};

static xtensa_operand_internal iisimm8x256_operand = {
  "i",
  '<',
  0,
  get_imm8_field,
  set_imm8_field,
  encode_simm8x256,
  decode_simm8x256,
  0,
  0
};

static xtensa_operand_internal lisimm12_operand = {
  "l",
  '<',
  1,
  get_imm12_field,
  set_imm12_field,
  encode_simm12,
  decode_simm12,
  do_reloc_l,
  undo_reloc_l,
};

static xtensa_operand_internal iiop2p1_operand = {
  "i",
  '<',
  0,
  get_op2_field,
  set_op2_field,
  encode_op2p1,
  decode_op2p1,
  0,
  0
};

static xtensa_operand_internal iisae_operand = {
  "i",
  '<',
  0,
  get_sae_field,
  set_sae_field,
  encode_sae,
  decode_sae,
  0,
  0
};

static xtensa_operand_internal iis_operand = {
  "i",
  '<',
  0,
  get_s_field,
  set_s_field,
  encode_s,
  decode_s,
  0,
  0
};

static xtensa_operand_internal iit_operand = {
  "i",
  '<',
  0,
  get_t_field,
  set_t_field,
  encode_t,
  decode_t,
  0,
  0
};

static xtensa_operand_internal iisimm12b_operand = {
  "i",
  '<',
  0,
  get_imm12b_field,
  set_imm12b_field,
  encode_simm12b,
  decode_simm12b,
  0,
  0
};

static xtensa_operand_internal iinimm4x2_operand = {
  "i",
  '<',
  0,
  get_imm4_field,
  set_imm4_field,
  encode_nimm4x2,
  decode_nimm4x2,
  0,
  0
};

static xtensa_operand_internal iiuimm4x16_operand = {
  "i",
  '<',
  0,
  get_op2_field,
  set_op2_field,
  encode_uimm4x16,
  decode_uimm4x16,
  0,
  0
};

static xtensa_operand_internal abs_operand = {
  "a",
  '=',
  0,
  get_s_field,
  set_s_field,
  encode_s,
  decode_s,
  0,
  0
};

static xtensa_operand_internal iisar_operand = {
  "i",
  '<',
  0,
  get_sar_field,
  set_sar_field,
  encode_sar,
  decode_sar,
  0,
  0
};

static xtensa_operand_internal abt_operand = {
  "a",
  '=',
  0,
  get_t_field,
  set_t_field,
  encode_t,
  decode_t,
  0,
  0
};

static xtensa_operand_internal iisas_operand = {
  "i",
  '<',
  0,
  get_sas_field,
  set_sas_field,
  encode_sas,
  decode_sas,
  0,
  0
};

static xtensa_operand_internal amr_operand = {
  "a",
  '=',
  0,
  get_r_field,
  set_r_field,
  encode_r,
  decode_r,
  0,
  0
};

static xtensa_operand_internal iib4constu_operand = {
  "i",
  '<',
  0,
  get_r_field,
  set_r_field,
  encode_b4constu,
  decode_b4constu,
  0,
  0
};

static xtensa_operand_internal iisr_operand = {
  "i",
  '<',
  0,
  get_sr_field,
  set_sr_field,
  encode_sr,
  decode_sr,
  0,
  0
};

static xtensa_operand_internal iibbi_operand = {
  "i",
  '<',
  0,
  get_bbi_field,
  set_bbi_field,
  encode_bbi,
  decode_bbi,
  0,
  0
};

static xtensa_operand_internal iiai4const_operand = {
  "i",
  '<',
  0,
  get_t_field,
  set_t_field,
  encode_ai4const,
  decode_ai4const,
  0,
  0
};

static xtensa_operand_internal iiuimm12x8_operand = {
  "i",
  '<',
  0,
  get_imm12_field,
  set_imm12_field,
  encode_uimm12x8,
  decode_uimm12x8,
  0,
  0
};

static xtensa_operand_internal riuimm16x4_operand = {
  "r",
  '<',
  1,
  get_imm16_field,
  set_imm16_field,
  encode_uimm16x4,
  decode_uimm16x4,
  do_reloc_r,
  undo_reloc_r,
};

static xtensa_operand_internal lisimm8_operand = {
  "l",
  '<',
  1,
  get_imm8_field,
  set_imm8_field,
  encode_simm8,
  decode_simm8,
  do_reloc_l,
  undo_reloc_l,
};

static xtensa_operand_internal iilsi4x4_operand = {
  "i",
  '<',
  0,
  get_r_field,
  set_r_field,
  encode_lsi4x4,
  decode_lsi4x4,
  0,
  0
};

static xtensa_operand_internal iiuimm8x2_operand = {
  "i",
  '<',
  0,
  get_imm8_field,
  set_imm8_field,
  encode_uimm8x2,
  decode_uimm8x2,
  0,
  0
};

static xtensa_operand_internal iisimm4_operand = {
  "i",
  '<',
  0,
  get_mn_field,
  set_mn_field,
  encode_simm4,
  decode_simm4,
  0,
  0
};

static xtensa_operand_internal iimsalp32_operand = {
  "i",
  '<',
  0,
  get_sal_field,
  set_sal_field,
  encode_msalp32,
  decode_msalp32,
  0,
  0
};

static xtensa_operand_internal liuimm6_operand = {
  "l",
  '<',
  1,
  get_imm6_field,
  set_imm6_field,
  encode_uimm6,
  decode_uimm6,
  do_reloc_l,
  undo_reloc_l,
};

static xtensa_operand_internal iiuimm8x4_operand = {
  "i",
  '<',
  0,
  get_imm8_field,
  set_imm8_field,
  encode_uimm8x4,
  decode_uimm8x4,
  0,
  0
};

static xtensa_operand_internal lisoffset_operand = {
  "l",
  '<',
  1,
  get_offset_field,
  set_offset_field,
  encode_soffset,
  decode_soffset,
  do_reloc_l,
  undo_reloc_l,
};

static xtensa_operand_internal iisimm7_operand = {
  "i",
  '<',
  0,
  get_imm7_field,
  set_imm7_field,
  encode_simm7,
  decode_simm7,
  0,
  0
};

static xtensa_operand_internal ais_operand = {
  "a",
  '<',
  0,
  get_s_field,
  set_s_field,
  encode_s,
  decode_s,
  0,
  0
};

static xtensa_operand_internal liuimm8_operand = {
  "l",
  '<',
  1,
  get_imm8_field,
  set_imm8_field,
  encode_uimm8,
  decode_uimm8,
  do_reloc_l,
  undo_reloc_l,
};

static xtensa_operand_internal ait_operand = {
  "a",
  '<',
  0,
  get_t_field,
  set_t_field,
  encode_t,
  decode_t,
  0,
  0
};

static xtensa_operand_internal iisimm8_operand = {
  "i",
  '<',
  0,
  get_imm8_field,
  set_imm8_field,
  encode_simm8,
  decode_simm8,
  0,
  0
};

static xtensa_operand_internal aor_operand = {
  "a",
  '>',
  0,
  get_r_field,
  set_r_field,
  encode_r,
  decode_r,
  0,
  0
};

static xtensa_operand_internal aos_operand = {
  "a",
  '>',
  0,
  get_s_field,
  set_s_field,
  encode_s,
  decode_s,
  0,
  0
};

static xtensa_operand_internal aot_operand = {
  "a",
  '>',
  0,
  get_t_field,
  set_t_field,
  encode_t,
  decode_t,
  0,
  0
};

static xtensa_iclass_internal nopn_iclass = {
  0,
  0
};

static xtensa_operand_internal *movi_operand_list[] = {
  &aot_operand,
  &iisimm12b_operand
};

static xtensa_iclass_internal movi_iclass = {
  2,
  &movi_operand_list[0]
};

static xtensa_operand_internal *bsi8u_operand_list[] = {
  &ais_operand,
  &iib4constu_operand,
  &lisimm8_operand
};

static xtensa_iclass_internal bsi8u_iclass = {
  3,
  &bsi8u_operand_list[0]
};

static xtensa_operand_internal *itlb_operand_list[] = {
  &ais_operand
};

static xtensa_iclass_internal itlb_iclass = {
  1,
  &itlb_operand_list[0]
};

static xtensa_operand_internal *shiftst_operand_list[] = {
  &aor_operand,
  &ais_operand,
  &ait_operand
};

static xtensa_iclass_internal shiftst_iclass = {
  3,
  &shiftst_operand_list[0]
};

static xtensa_operand_internal *l32r_operand_list[] = {
  &aot_operand,
  &riuimm16x4_operand
};

static xtensa_iclass_internal l32r_iclass = {
  2,
  &l32r_operand_list[0]
};

static xtensa_iclass_internal rfe_iclass = {
  0,
  0
};

static xtensa_operand_internal *wait_operand_list[] = {
  &iis_operand
};

static xtensa_iclass_internal wait_iclass = {
  1,
  &wait_operand_list[0]
};

static xtensa_operand_internal *rfi_operand_list[] = {
  &iis_operand
};

static xtensa_iclass_internal rfi_iclass = {
  1,
  &rfi_operand_list[0]
};

static xtensa_operand_internal *movz_operand_list[] = {
  &amr_operand,
  &ais_operand,
  &ait_operand
};

static xtensa_iclass_internal movz_iclass = {
  3,
  &movz_operand_list[0]
};

static xtensa_operand_internal *callx_operand_list[] = {
  &ais_operand
};

static xtensa_iclass_internal callx_iclass = {
  1,
  &callx_operand_list[0]
};

static xtensa_operand_internal *mov_n_operand_list[] = {
  &aot_operand,
  &ais_operand
};

static xtensa_iclass_internal mov_n_iclass = {
  2,
  &mov_n_operand_list[0]
};

static xtensa_operand_internal *loadi4_operand_list[] = {
  &aot_operand,
  &ais_operand,
  &iilsi4x4_operand
};

static xtensa_iclass_internal loadi4_iclass = {
  3,
  &loadi4_operand_list[0]
};

static xtensa_operand_internal *exti_operand_list[] = {
  &aor_operand,
  &ait_operand,
  &iisae_operand,
  &iiop2p1_operand
};

static xtensa_iclass_internal exti_iclass = {
  4,
  &exti_operand_list[0]
};

static xtensa_operand_internal *break_operand_list[] = {
  &iis_operand,
  &iit_operand
};

static xtensa_iclass_internal break_iclass = {
  2,
  &break_operand_list[0]
};

static xtensa_operand_internal *slli_operand_list[] = {
  &aor_operand,
  &ais_operand,
  &iimsalp32_operand
};

static xtensa_iclass_internal slli_iclass = {
  3,
  &slli_operand_list[0]
};

static xtensa_operand_internal *s16i_operand_list[] = {
  &ait_operand,
  &ais_operand,
  &iiuimm8x2_operand
};

static xtensa_iclass_internal s16i_iclass = {
  3,
  &s16i_operand_list[0]
};

static xtensa_operand_internal *call_operand_list[] = {
  &lisoffsetx4_operand
};

static xtensa_iclass_internal call_iclass = {
  1,
  &call_operand_list[0]
};

static xtensa_operand_internal *shifts_operand_list[] = {
  &aor_operand,
  &ais_operand
};

static xtensa_iclass_internal shifts_iclass = {
  2,
  &shifts_operand_list[0]
};

static xtensa_operand_internal *shiftt_operand_list[] = {
  &aor_operand,
  &ait_operand
};

static xtensa_iclass_internal shiftt_iclass = {
  2,
  &shiftt_operand_list[0]
};

static xtensa_operand_internal *rotw_operand_list[] = {
  &iisimm4_operand
};

static xtensa_iclass_internal rotw_iclass = {
  1,
  &rotw_operand_list[0]
};

static xtensa_operand_internal *addsub_operand_list[] = {
  &aor_operand,
  &ais_operand,
  &ait_operand
};

static xtensa_iclass_internal addsub_iclass = {
  3,
  &addsub_operand_list[0]
};

static xtensa_operand_internal *l8i_operand_list[] = {
  &aot_operand,
  &ais_operand,
  &iiuimm8_operand
};

static xtensa_iclass_internal l8i_iclass = {
  3,
  &l8i_operand_list[0]
};

static xtensa_operand_internal *sari_operand_list[] = {
  &iisas_operand
};

static xtensa_iclass_internal sari_iclass = {
  1,
  &sari_operand_list[0]
};

static xtensa_operand_internal *xsr_operand_list[] = {
  &abt_operand,
  &iisr_operand
};

static xtensa_iclass_internal xsr_iclass = {
  2,
  &xsr_operand_list[0]
};

static xtensa_operand_internal *rsil_operand_list[] = {
  &aot_operand,
  &iis_operand
};

static xtensa_iclass_internal rsil_iclass = {
  2,
  &rsil_operand_list[0]
};

static xtensa_operand_internal *bst8_operand_list[] = {
  &ais_operand,
  &ait_operand,
  &lisimm8_operand
};

static xtensa_iclass_internal bst8_iclass = {
  3,
  &bst8_operand_list[0]
};

static xtensa_operand_internal *addi_operand_list[] = {
  &aot_operand,
  &ais_operand,
  &iisimm8_operand
};

static xtensa_iclass_internal addi_iclass = {
  3,
  &addi_operand_list[0]
};

static xtensa_operand_internal *callx12_operand_list[] = {
  &ais_operand
};

static xtensa_iclass_internal callx12_iclass = {
  1,
  &callx12_operand_list[0]
};

static xtensa_operand_internal *bsi8_operand_list[] = {
  &ais_operand,
  &iib4const_operand,
  &lisimm8_operand
};

static xtensa_iclass_internal bsi8_iclass = {
  3,
  &bsi8_operand_list[0]
};

static xtensa_operand_internal *jumpx_operand_list[] = {
  &ais_operand
};

static xtensa_iclass_internal jumpx_iclass = {
  1,
  &jumpx_operand_list[0]
};

static xtensa_iclass_internal retn_iclass = {
  0,
  0
};

static xtensa_operand_internal *nsa_operand_list[] = {
  &aot_operand,
  &ais_operand
};

static xtensa_iclass_internal nsa_iclass = {
  2,
  &nsa_operand_list[0]
};

static xtensa_operand_internal *storei4_operand_list[] = {
  &ait_operand,
  &ais_operand,
  &iilsi4x4_operand
};

static xtensa_iclass_internal storei4_iclass = {
  3,
  &storei4_operand_list[0]
};

static xtensa_operand_internal *wtlb_operand_list[] = {
  &ait_operand,
  &ais_operand
};

static xtensa_iclass_internal wtlb_iclass = {
  2,
  &wtlb_operand_list[0]
};

static xtensa_operand_internal *dce_operand_list[] = {
  &ais_operand,
  &iiuimm4x16_operand
};

static xtensa_iclass_internal dce_iclass = {
  2,
  &dce_operand_list[0]
};

static xtensa_operand_internal *l16i_operand_list[] = {
  &aot_operand,
  &ais_operand,
  &iiuimm8x2_operand
};

static xtensa_iclass_internal l16i_iclass = {
  3,
  &l16i_operand_list[0]
};

static xtensa_operand_internal *callx4_operand_list[] = {
  &ais_operand
};

static xtensa_iclass_internal callx4_iclass = {
  1,
  &callx4_operand_list[0]
};

static xtensa_operand_internal *callx8_operand_list[] = {
  &ais_operand
};

static xtensa_iclass_internal callx8_iclass = {
  1,
  &callx8_operand_list[0]
};

static xtensa_operand_internal *movsp_operand_list[] = {
  &aot_operand,
  &ais_operand
};

static xtensa_iclass_internal movsp_iclass = {
  2,
  &movsp_operand_list[0]
};

static xtensa_operand_internal *wsr_operand_list[] = {
  &ait_operand,
  &iisr_operand
};

static xtensa_iclass_internal wsr_iclass = {
  2,
  &wsr_operand_list[0]
};

static xtensa_operand_internal *call12_operand_list[] = {
  &lisoffsetx4_operand
};

static xtensa_iclass_internal call12_iclass = {
  1,
  &call12_operand_list[0]
};

static xtensa_operand_internal *call4_operand_list[] = {
  &lisoffsetx4_operand
};

static xtensa_iclass_internal call4_iclass = {
  1,
  &call4_operand_list[0]
};

static xtensa_operand_internal *addmi_operand_list[] = {
  &aot_operand,
  &ais_operand,
  &iisimm8x256_operand
};

static xtensa_iclass_internal addmi_iclass = {
  3,
  &addmi_operand_list[0]
};

static xtensa_operand_internal *bit_operand_list[] = {
  &aor_operand,
  &ais_operand,
  &ait_operand
};

static xtensa_iclass_internal bit_iclass = {
  3,
  &bit_operand_list[0]
};

static xtensa_operand_internal *call8_operand_list[] = {
  &lisoffsetx4_operand
};

static xtensa_iclass_internal call8_iclass = {
  1,
  &call8_operand_list[0]
};

static xtensa_iclass_internal itlba_iclass = {
  0,
  0
};

static xtensa_operand_internal *break_n_operand_list[] = {
  &iis_operand
};

static xtensa_iclass_internal break_n_iclass = {
  1,
  &break_n_operand_list[0]
};

static xtensa_operand_internal *sar_operand_list[] = {
  &ais_operand
};

static xtensa_iclass_internal sar_iclass = {
  1,
  &sar_operand_list[0]
};

static xtensa_operand_internal *s32e_operand_list[] = {
  &ait_operand,
  &ais_operand,
  &iinimm4x2_operand
};

static xtensa_iclass_internal s32e_iclass = {
  3,
  &s32e_operand_list[0]
};

static xtensa_operand_internal *bz6_operand_list[] = {
  &ais_operand,
  &liuimm6_operand
};

static xtensa_iclass_internal bz6_iclass = {
  2,
  &bz6_operand_list[0]
};

static xtensa_operand_internal *loop_operand_list[] = {
  &ais_operand,
  &liuimm8_operand
};

static xtensa_iclass_internal loop_iclass = {
  2,
  &loop_operand_list[0]
};

static xtensa_operand_internal *rsr_operand_list[] = {
  &aot_operand,
  &iisr_operand
};

static xtensa_iclass_internal rsr_iclass = {
  2,
  &rsr_operand_list[0]
};

static xtensa_operand_internal *icache_operand_list[] = {
  &ais_operand,
  &iiuimm8x4_operand
};

static xtensa_iclass_internal icache_iclass = {
  2,
  &icache_operand_list[0]
};

static xtensa_operand_internal *s8i_operand_list[] = {
  &ait_operand,
  &ais_operand,
  &iiuimm8_operand
};

static xtensa_iclass_internal s8i_iclass = {
  3,
  &s8i_operand_list[0]
};

static xtensa_iclass_internal return_iclass = {
  0,
  0
};

static xtensa_operand_internal *dcache_operand_list[] = {
  &ais_operand,
  &iiuimm8x4_operand
};

static xtensa_iclass_internal dcache_iclass = {
  2,
  &dcache_operand_list[0]
};

static xtensa_operand_internal *s32i_operand_list[] = {
  &ait_operand,
  &ais_operand,
  &iiuimm8x4_operand
};

static xtensa_iclass_internal s32i_iclass = {
  3,
  &s32i_operand_list[0]
};

static xtensa_operand_internal *jump_operand_list[] = {
  &lisoffset_operand
};

static xtensa_iclass_internal jump_iclass = {
  1,
  &jump_operand_list[0]
};

static xtensa_operand_internal *addi_n_operand_list[] = {
  &aor_operand,
  &ais_operand,
  &iiai4const_operand
};

static xtensa_iclass_internal addi_n_iclass = {
  3,
  &addi_n_operand_list[0]
};

static xtensa_iclass_internal sync_iclass = {
  0,
  0
};

static xtensa_operand_internal *neg_operand_list[] = {
  &aor_operand,
  &ait_operand
};

static xtensa_iclass_internal neg_iclass = {
  2,
  &neg_operand_list[0]
};

static xtensa_iclass_internal syscall_iclass = {
  0,
  0
};

static xtensa_operand_internal *bsz12_operand_list[] = {
  &ais_operand,
  &lisimm12_operand
};

static xtensa_iclass_internal bsz12_iclass = {
  2,
  &bsz12_operand_list[0]
};

static xtensa_iclass_internal excw_iclass = {
  0,
  0
};

static xtensa_operand_internal *movi_n_operand_list[] = {
  &aos_operand,
  &iisimm7_operand
};

static xtensa_iclass_internal movi_n_iclass = {
  2,
  &movi_n_operand_list[0]
};

static xtensa_operand_internal *rtlb_operand_list[] = {
  &aot_operand,
  &ais_operand
};

static xtensa_iclass_internal rtlb_iclass = {
  2,
  &rtlb_operand_list[0]
};

static xtensa_operand_internal *actl_operand_list[] = {
  &aot_operand,
  &ais_operand
};

static xtensa_iclass_internal actl_iclass = {
  2,
  &actl_operand_list[0]
};

static xtensa_operand_internal *srli_operand_list[] = {
  &aor_operand,
  &ait_operand,
  &iis_operand
};

static xtensa_iclass_internal srli_iclass = {
  3,
  &srli_operand_list[0]
};

static xtensa_operand_internal *bsi8b_operand_list[] = {
  &ais_operand,
  &iibbi_operand,
  &lisimm8_operand
};

static xtensa_iclass_internal bsi8b_iclass = {
  3,
  &bsi8b_operand_list[0]
};

static xtensa_operand_internal *acts_operand_list[] = {
  &ait_operand,
  &ais_operand
};

static xtensa_iclass_internal acts_iclass = {
  2,
  &acts_operand_list[0]
};

static xtensa_operand_internal *add_n_operand_list[] = {
  &aor_operand,
  &ais_operand,
  &ait_operand
};

static xtensa_iclass_internal add_n_iclass = {
  3,
  &add_n_operand_list[0]
};

static xtensa_operand_internal *srai_operand_list[] = {
  &aor_operand,
  &ait_operand,
  &iisar_operand
};

static xtensa_iclass_internal srai_iclass = {
  3,
  &srai_operand_list[0]
};

static xtensa_operand_internal *entry_operand_list[] = {
  &abs_operand,
  &iiuimm12x8_operand
};

static xtensa_iclass_internal entry_iclass = {
  2,
  &entry_operand_list[0]
};

static xtensa_operand_internal *l32e_operand_list[] = {
  &aot_operand,
  &ais_operand,
  &iinimm4x2_operand
};

static xtensa_iclass_internal l32e_iclass = {
  3,
  &l32e_operand_list[0]
};

static xtensa_operand_internal *dpf_operand_list[] = {
  &ais_operand,
  &iiuimm8x4_operand
};

static xtensa_iclass_internal dpf_iclass = {
  2,
  &dpf_operand_list[0]
};

static xtensa_operand_internal *l32i_operand_list[] = {
  &aot_operand,
  &ais_operand,
  &iiuimm8x4_operand
};

static xtensa_iclass_internal l32i_iclass = {
  3,
  &l32i_operand_list[0]
};

static xtensa_insnbuf abs_template (void);
static xtensa_insnbuf add_template (void);
static xtensa_insnbuf add_n_template (void);
static xtensa_insnbuf addi_template (void);
static xtensa_insnbuf addi_n_template (void);
static xtensa_insnbuf addmi_template (void);
static xtensa_insnbuf addx2_template (void);
static xtensa_insnbuf addx4_template (void);
static xtensa_insnbuf addx8_template (void);
static xtensa_insnbuf and_template (void);
static xtensa_insnbuf ball_template (void);
static xtensa_insnbuf bany_template (void);
static xtensa_insnbuf bbc_template (void);
static xtensa_insnbuf bbci_template (void);
static xtensa_insnbuf bbs_template (void);
static xtensa_insnbuf bbsi_template (void);
static xtensa_insnbuf beq_template (void);
static xtensa_insnbuf beqi_template (void);
static xtensa_insnbuf beqz_template (void);
static xtensa_insnbuf beqz_n_template (void);
static xtensa_insnbuf bge_template (void);
static xtensa_insnbuf bgei_template (void);
static xtensa_insnbuf bgeu_template (void);
static xtensa_insnbuf bgeui_template (void);
static xtensa_insnbuf bgez_template (void);
static xtensa_insnbuf blt_template (void);
static xtensa_insnbuf blti_template (void);
static xtensa_insnbuf bltu_template (void);
static xtensa_insnbuf bltui_template (void);
static xtensa_insnbuf bltz_template (void);
static xtensa_insnbuf bnall_template (void);
static xtensa_insnbuf bne_template (void);
static xtensa_insnbuf bnei_template (void);
static xtensa_insnbuf bnez_template (void);
static xtensa_insnbuf bnez_n_template (void);
static xtensa_insnbuf bnone_template (void);
static xtensa_insnbuf break_template (void);
static xtensa_insnbuf break_n_template (void);
static xtensa_insnbuf call0_template (void);
static xtensa_insnbuf call12_template (void);
static xtensa_insnbuf call4_template (void);
static xtensa_insnbuf call8_template (void);
static xtensa_insnbuf callx0_template (void);
static xtensa_insnbuf callx12_template (void);
static xtensa_insnbuf callx4_template (void);
static xtensa_insnbuf callx8_template (void);
static xtensa_insnbuf dhi_template (void);
static xtensa_insnbuf dhwb_template (void);
static xtensa_insnbuf dhwbi_template (void);
static xtensa_insnbuf dii_template (void);
static xtensa_insnbuf diwb_template (void);
static xtensa_insnbuf diwbi_template (void);
static xtensa_insnbuf dpfr_template (void);
static xtensa_insnbuf dpfro_template (void);
static xtensa_insnbuf dpfw_template (void);
static xtensa_insnbuf dpfwo_template (void);
static xtensa_insnbuf dsync_template (void);
static xtensa_insnbuf entry_template (void);
static xtensa_insnbuf esync_template (void);
static xtensa_insnbuf excw_template (void);
static xtensa_insnbuf extui_template (void);
static xtensa_insnbuf idtlb_template (void);
static xtensa_insnbuf idtlba_template (void);
static xtensa_insnbuf ihi_template (void);
static xtensa_insnbuf iii_template (void);
static xtensa_insnbuf iitlb_template (void);
static xtensa_insnbuf iitlba_template (void);
static xtensa_insnbuf ipf_template (void);
static xtensa_insnbuf isync_template (void);
static xtensa_insnbuf j_template (void);
static xtensa_insnbuf jx_template (void);
static xtensa_insnbuf l16si_template (void);
static xtensa_insnbuf l16ui_template (void);
static xtensa_insnbuf l32e_template (void);
static xtensa_insnbuf l32i_template (void);
static xtensa_insnbuf l32i_n_template (void);
static xtensa_insnbuf l32r_template (void);
static xtensa_insnbuf l8ui_template (void);
static xtensa_insnbuf ldct_template (void);
static xtensa_insnbuf lict_template (void);
static xtensa_insnbuf licw_template (void);
static xtensa_insnbuf loop_template (void);
static xtensa_insnbuf loopgtz_template (void);
static xtensa_insnbuf loopnez_template (void);
static xtensa_insnbuf memw_template (void);
static xtensa_insnbuf mov_n_template (void);
static xtensa_insnbuf moveqz_template (void);
static xtensa_insnbuf movgez_template (void);
static xtensa_insnbuf movi_template (void);
static xtensa_insnbuf movi_n_template (void);
static xtensa_insnbuf movltz_template (void);
static xtensa_insnbuf movnez_template (void);
static xtensa_insnbuf movsp_template (void);
static xtensa_insnbuf neg_template (void);
static xtensa_insnbuf nop_n_template (void);
static xtensa_insnbuf nsa_template (void);
static xtensa_insnbuf nsau_template (void);
static xtensa_insnbuf or_template (void);
static xtensa_insnbuf pdtlb_template (void);
static xtensa_insnbuf pitlb_template (void);
static xtensa_insnbuf rdtlb0_template (void);
static xtensa_insnbuf rdtlb1_template (void);
static xtensa_insnbuf ret_template (void);
static xtensa_insnbuf ret_n_template (void);
static xtensa_insnbuf retw_template (void);
static xtensa_insnbuf retw_n_template (void);
static xtensa_insnbuf rfde_template (void);
static xtensa_insnbuf rfe_template (void);
static xtensa_insnbuf rfi_template (void);
static xtensa_insnbuf rfwo_template (void);
static xtensa_insnbuf rfwu_template (void);
static xtensa_insnbuf ritlb0_template (void);
static xtensa_insnbuf ritlb1_template (void);
static xtensa_insnbuf rotw_template (void);
static xtensa_insnbuf rsil_template (void);
static xtensa_insnbuf rsr_template (void);
static xtensa_insnbuf rsync_template (void);
static xtensa_insnbuf s16i_template (void);
static xtensa_insnbuf s32e_template (void);
static xtensa_insnbuf s32i_template (void);
static xtensa_insnbuf s32i_n_template (void);
static xtensa_insnbuf s8i_template (void);
static xtensa_insnbuf sdct_template (void);
static xtensa_insnbuf sict_template (void);
static xtensa_insnbuf sicw_template (void);
static xtensa_insnbuf simcall_template (void);
static xtensa_insnbuf sll_template (void);
static xtensa_insnbuf slli_template (void);
static xtensa_insnbuf sra_template (void);
static xtensa_insnbuf srai_template (void);
static xtensa_insnbuf src_template (void);
static xtensa_insnbuf srl_template (void);
static xtensa_insnbuf srli_template (void);
static xtensa_insnbuf ssa8b_template (void);
static xtensa_insnbuf ssa8l_template (void);
static xtensa_insnbuf ssai_template (void);
static xtensa_insnbuf ssl_template (void);
static xtensa_insnbuf ssr_template (void);
static xtensa_insnbuf sub_template (void);
static xtensa_insnbuf subx2_template (void);
static xtensa_insnbuf subx4_template (void);
static xtensa_insnbuf subx8_template (void);
static xtensa_insnbuf syscall_template (void);
static xtensa_insnbuf waiti_template (void);
static xtensa_insnbuf wdtlb_template (void);
static xtensa_insnbuf witlb_template (void);
static xtensa_insnbuf wsr_template (void);
static xtensa_insnbuf xor_template (void);
static xtensa_insnbuf xsr_template (void);

static xtensa_insnbuf
abs_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00001006 };
  return &template[0];
}

static xtensa_insnbuf
add_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000008 };
  return &template[0];
}

static xtensa_insnbuf
add_n_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00a00000 };
  return &template[0];
}

static xtensa_insnbuf
addi_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00200c00 };
  return &template[0];
}

static xtensa_insnbuf
addi_n_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00b00000 };
  return &template[0];
}

static xtensa_insnbuf
addmi_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00200d00 };
  return &template[0];
}

static xtensa_insnbuf
addx2_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000009 };
  return &template[0];
}

static xtensa_insnbuf
addx4_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x0000000a };
  return &template[0];
}

static xtensa_insnbuf
addx8_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x0000000b };
  return &template[0];
}

static xtensa_insnbuf
and_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000001 };
  return &template[0];
}

static xtensa_insnbuf
ball_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00700400 };
  return &template[0];
}

static xtensa_insnbuf
bany_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00700800 };
  return &template[0];
}

static xtensa_insnbuf
bbc_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00700500 };
  return &template[0];
}

static xtensa_insnbuf
bbci_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00700600 };
  return &template[0];
}

static xtensa_insnbuf
bbs_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00700d00 };
  return &template[0];
}

static xtensa_insnbuf
bbsi_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00700e00 };
  return &template[0];
}

static xtensa_insnbuf
beq_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00700100 };
  return &template[0];
}

static xtensa_insnbuf
beqi_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00680000 };
  return &template[0];
}

static xtensa_insnbuf
beqz_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00640000 };
  return &template[0];
}

static xtensa_insnbuf
beqz_n_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00c80000 };
  return &template[0];
}

static xtensa_insnbuf
bge_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00700a00 };
  return &template[0];
}

static xtensa_insnbuf
bgei_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x006b0000 };
  return &template[0];
}

static xtensa_insnbuf
bgeu_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00700b00 };
  return &template[0];
}

static xtensa_insnbuf
bgeui_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x006f0000 };
  return &template[0];
}

static xtensa_insnbuf
bgez_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00670000 };
  return &template[0];
}

static xtensa_insnbuf
blt_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00700200 };
  return &template[0];
}

static xtensa_insnbuf
blti_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x006a0000 };
  return &template[0];
}

static xtensa_insnbuf
bltu_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00700300 };
  return &template[0];
}

static xtensa_insnbuf
bltui_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x006e0000 };
  return &template[0];
}

static xtensa_insnbuf
bltz_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00660000 };
  return &template[0];
}

static xtensa_insnbuf
bnall_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00700c00 };
  return &template[0];
}

static xtensa_insnbuf
bne_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00700900 };
  return &template[0];
}

static xtensa_insnbuf
bnei_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00690000 };
  return &template[0];
}

static xtensa_insnbuf
bnez_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00650000 };
  return &template[0];
}

static xtensa_insnbuf
bnez_n_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00cc0000 };
  return &template[0];
}

static xtensa_insnbuf
bnone_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00700000 };
  return &template[0];
}

static xtensa_insnbuf
break_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000400 };
  return &template[0];
}

static xtensa_insnbuf
break_n_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00d20f00 };
  return &template[0];
}

static xtensa_insnbuf
call0_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00500000 };
  return &template[0];
}

static xtensa_insnbuf
call12_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x005c0000 };
  return &template[0];
}

static xtensa_insnbuf
call4_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00540000 };
  return &template[0];
}

static xtensa_insnbuf
call8_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00580000 };
  return &template[0];
}

static xtensa_insnbuf
callx0_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00030000 };
  return &template[0];
}

static xtensa_insnbuf
callx12_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x000f0000 };
  return &template[0];
}

static xtensa_insnbuf
callx4_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00070000 };
  return &template[0];
}

static xtensa_insnbuf
callx8_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x000b0000 };
  return &template[0];
}

static xtensa_insnbuf
dhi_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00260700 };
  return &template[0];
}

static xtensa_insnbuf
dhwb_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00240700 };
  return &template[0];
}

static xtensa_insnbuf
dhwbi_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00250700 };
  return &template[0];
}

static xtensa_insnbuf
dii_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00270700 };
  return &template[0];
}

static xtensa_insnbuf
diwb_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00280740 };
  return &template[0];
}

static xtensa_insnbuf
diwbi_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00280750 };
  return &template[0];
}

static xtensa_insnbuf
dpfr_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00200700 };
  return &template[0];
}

static xtensa_insnbuf
dpfro_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00220700 };
  return &template[0];
}

static xtensa_insnbuf
dpfw_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00210700 };
  return &template[0];
}

static xtensa_insnbuf
dpfwo_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00230700 };
  return &template[0];
}

static xtensa_insnbuf
dsync_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00030200 };
  return &template[0];
}

static xtensa_insnbuf
entry_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x006c0000 };
  return &template[0];
}

static xtensa_insnbuf
esync_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00020200 };
  return &template[0];
}

static xtensa_insnbuf
excw_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00080200 };
  return &template[0];
}

static xtensa_insnbuf
extui_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000040 };
  return &template[0];
}

static xtensa_insnbuf
idtlb_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000c05 };
  return &template[0];
}

static xtensa_insnbuf
idtlba_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000805 };
  return &template[0];
}

static xtensa_insnbuf
ihi_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x002e0700 };
  return &template[0];
}

static xtensa_insnbuf
iii_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x002f0700 };
  return &template[0];
}

static xtensa_insnbuf
iitlb_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000405 };
  return &template[0];
}

static xtensa_insnbuf
iitlba_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000005 };
  return &template[0];
}

static xtensa_insnbuf
ipf_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x002c0700 };
  return &template[0];
}

static xtensa_insnbuf
isync_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000200 };
  return &template[0];
}

static xtensa_insnbuf
j_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00600000 };
  return &template[0];
}

static xtensa_insnbuf
jx_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x000a0000 };
  return &template[0];
}

static xtensa_insnbuf
l16si_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00200900 };
  return &template[0];
}

static xtensa_insnbuf
l16ui_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00200100 };
  return &template[0];
}

static xtensa_insnbuf
l32e_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000090 };
  return &template[0];
}

static xtensa_insnbuf
l32i_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00200200 };
  return &template[0];
}

static xtensa_insnbuf
l32i_n_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00800000 };
  return &template[0];
}

static xtensa_insnbuf
l32r_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00100000 };
  return &template[0];
}

static xtensa_insnbuf
l8ui_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00200000 };
  return &template[0];
}

static xtensa_insnbuf
ldct_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x0000081f };
  return &template[0];
}

static xtensa_insnbuf
lict_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x0000001f };
  return &template[0];
}

static xtensa_insnbuf
licw_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x0000021f };
  return &template[0];
}

static xtensa_insnbuf
loop_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x006d0800 };
  return &template[0];
}

static xtensa_insnbuf
loopgtz_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x006d0a00 };
  return &template[0];
}

static xtensa_insnbuf
loopnez_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x006d0900 };
  return &template[0];
}

static xtensa_insnbuf
memw_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x000c0200 };
  return &template[0];
}

static xtensa_insnbuf
mov_n_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00d00000 };
  return &template[0];
}

static xtensa_insnbuf
moveqz_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000038 };
  return &template[0];
}

static xtensa_insnbuf
movgez_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x0000003b };
  return &template[0];
}

static xtensa_insnbuf
movi_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00200a00 };
  return &template[0];
}

static xtensa_insnbuf
movi_n_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00c00000 };
  return &template[0];
}

static xtensa_insnbuf
movltz_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x0000003a };
  return &template[0];
}

static xtensa_insnbuf
movnez_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000039 };
  return &template[0];
}

static xtensa_insnbuf
movsp_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000100 };
  return &template[0];
}

static xtensa_insnbuf
neg_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000006 };
  return &template[0];
}

static xtensa_insnbuf
nop_n_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00d30f00 };
  return &template[0];
}

static xtensa_insnbuf
nsa_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000e04 };
  return &template[0];
}

static xtensa_insnbuf
nsau_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000f04 };
  return &template[0];
}

static xtensa_insnbuf
or_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000002 };
  return &template[0];
}

static xtensa_insnbuf
pdtlb_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000d05 };
  return &template[0];
}

static xtensa_insnbuf
pitlb_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000505 };
  return &template[0];
}

static xtensa_insnbuf
rdtlb0_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000b05 };
  return &template[0];
}

static xtensa_insnbuf
rdtlb1_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000f05 };
  return &template[0];
}

static xtensa_insnbuf
ret_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00020000 };
  return &template[0];
}

static xtensa_insnbuf
ret_n_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00d00f00 };
  return &template[0];
}

static xtensa_insnbuf
retw_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00060000 };
  return &template[0];
}

static xtensa_insnbuf
retw_n_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00d10f00 };
  return &template[0];
}

static xtensa_insnbuf
rfde_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00002300 };
  return &template[0];
}

static xtensa_insnbuf
rfe_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000300 };
  return &template[0];
}

static xtensa_insnbuf
rfi_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00010300 };
  return &template[0];
}

static xtensa_insnbuf
rfwo_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00004300 };
  return &template[0];
}

static xtensa_insnbuf
rfwu_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00005300 };
  return &template[0];
}

static xtensa_insnbuf
ritlb0_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000305 };
  return &template[0];
}

static xtensa_insnbuf
ritlb1_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000705 };
  return &template[0];
}

static xtensa_insnbuf
rotw_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000804 };
  return &template[0];
}

static xtensa_insnbuf
rsil_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000600 };
  return &template[0];
}

static xtensa_insnbuf
rsr_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000030 };
  return &template[0];
}

static xtensa_insnbuf
rsync_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00010200 };
  return &template[0];
}

static xtensa_insnbuf
s16i_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00200500 };
  return &template[0];
}

static xtensa_insnbuf
s32e_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000094 };
  return &template[0];
}

static xtensa_insnbuf
s32i_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00200600 };
  return &template[0];
}

static xtensa_insnbuf
s32i_n_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00900000 };
  return &template[0];
}

static xtensa_insnbuf
s8i_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00200400 };
  return &template[0];
}

static xtensa_insnbuf
sdct_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x0000091f };
  return &template[0];
}

static xtensa_insnbuf
sict_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x0000011f };
  return &template[0];
}

static xtensa_insnbuf
sicw_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x0000031f };
  return &template[0];
}

static xtensa_insnbuf
simcall_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00001500 };
  return &template[0];
}

static xtensa_insnbuf
sll_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x0000001a };
  return &template[0];
}

static xtensa_insnbuf
slli_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000010 };
  return &template[0];
}

static xtensa_insnbuf
sra_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x0000001b };
  return &template[0];
}

static xtensa_insnbuf
srai_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000012 };
  return &template[0];
}

static xtensa_insnbuf
src_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000018 };
  return &template[0];
}

static xtensa_insnbuf
srl_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000019 };
  return &template[0];
}

static xtensa_insnbuf
srli_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000014 };
  return &template[0];
}

static xtensa_insnbuf
ssa8b_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000304 };
  return &template[0];
}

static xtensa_insnbuf
ssa8l_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000204 };
  return &template[0];
}

static xtensa_insnbuf
ssai_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000404 };
  return &template[0];
}

static xtensa_insnbuf
ssl_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000104 };
  return &template[0];
}

static xtensa_insnbuf
ssr_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000004 };
  return &template[0];
}

static xtensa_insnbuf
sub_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x0000000c };
  return &template[0];
}

static xtensa_insnbuf
subx2_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x0000000d };
  return &template[0];
}

static xtensa_insnbuf
subx4_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x0000000e };
  return &template[0];
}

static xtensa_insnbuf
subx8_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x0000000f };
  return &template[0];
}

static xtensa_insnbuf
syscall_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000500 };
  return &template[0];
}

static xtensa_insnbuf
waiti_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000700 };
  return &template[0];
}

static xtensa_insnbuf
wdtlb_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000e05 };
  return &template[0];
}

static xtensa_insnbuf
witlb_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000605 };
  return &template[0];
}

static xtensa_insnbuf
wsr_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000031 };
  return &template[0];
}

static xtensa_insnbuf
xor_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000003 };
  return &template[0];
}

static xtensa_insnbuf
xsr_template (void)
{
  static xtensa_insnbuf_word template[] = { 0x00000016 };
  return &template[0];
}

static xtensa_opcode_internal abs_opcode = {
  "abs",
  3,
  abs_template,
  &neg_iclass
};

static xtensa_opcode_internal add_opcode = {
  "add",
  3,
  add_template,
  &addsub_iclass
};

static xtensa_opcode_internal add_n_opcode = {
  "add.n",
  2,
  add_n_template,
  &add_n_iclass
};

static xtensa_opcode_internal addi_opcode = {
  "addi",
  3,
  addi_template,
  &addi_iclass
};

static xtensa_opcode_internal addi_n_opcode = {
  "addi.n",
  2,
  addi_n_template,
  &addi_n_iclass
};

static xtensa_opcode_internal addmi_opcode = {
  "addmi",
  3,
  addmi_template,
  &addmi_iclass
};

static xtensa_opcode_internal addx2_opcode = {
  "addx2",
  3,
  addx2_template,
  &addsub_iclass
};

static xtensa_opcode_internal addx4_opcode = {
  "addx4",
  3,
  addx4_template,
  &addsub_iclass
};

static xtensa_opcode_internal addx8_opcode = {
  "addx8",
  3,
  addx8_template,
  &addsub_iclass
};

static xtensa_opcode_internal and_opcode = {
  "and",
  3,
  and_template,
  &bit_iclass
};

static xtensa_opcode_internal ball_opcode = {
  "ball",
  3,
  ball_template,
  &bst8_iclass
};

static xtensa_opcode_internal bany_opcode = {
  "bany",
  3,
  bany_template,
  &bst8_iclass
};

static xtensa_opcode_internal bbc_opcode = {
  "bbc",
  3,
  bbc_template,
  &bst8_iclass
};

static xtensa_opcode_internal bbci_opcode = {
  "bbci",
  3,
  bbci_template,
  &bsi8b_iclass
};

static xtensa_opcode_internal bbs_opcode = {
  "bbs",
  3,
  bbs_template,
  &bst8_iclass
};

static xtensa_opcode_internal bbsi_opcode = {
  "bbsi",
  3,
  bbsi_template,
  &bsi8b_iclass
};

static xtensa_opcode_internal beq_opcode = {
  "beq",
  3,
  beq_template,
  &bst8_iclass
};

static xtensa_opcode_internal beqi_opcode = {
  "beqi",
  3,
  beqi_template,
  &bsi8_iclass
};

static xtensa_opcode_internal beqz_opcode = {
  "beqz",
  3,
  beqz_template,
  &bsz12_iclass
};

static xtensa_opcode_internal beqz_n_opcode = {
  "beqz.n",
  2,
  beqz_n_template,
  &bz6_iclass
};

static xtensa_opcode_internal bge_opcode = {
  "bge",
  3,
  bge_template,
  &bst8_iclass
};

static xtensa_opcode_internal bgei_opcode = {
  "bgei",
  3,
  bgei_template,
  &bsi8_iclass
};

static xtensa_opcode_internal bgeu_opcode = {
  "bgeu",
  3,
  bgeu_template,
  &bst8_iclass
};

static xtensa_opcode_internal bgeui_opcode = {
  "bgeui",
  3,
  bgeui_template,
  &bsi8u_iclass
};

static xtensa_opcode_internal bgez_opcode = {
  "bgez",
  3,
  bgez_template,
  &bsz12_iclass
};

static xtensa_opcode_internal blt_opcode = {
  "blt",
  3,
  blt_template,
  &bst8_iclass
};

static xtensa_opcode_internal blti_opcode = {
  "blti",
  3,
  blti_template,
  &bsi8_iclass
};

static xtensa_opcode_internal bltu_opcode = {
  "bltu",
  3,
  bltu_template,
  &bst8_iclass
};

static xtensa_opcode_internal bltui_opcode = {
  "bltui",
  3,
  bltui_template,
  &bsi8u_iclass
};

static xtensa_opcode_internal bltz_opcode = {
  "bltz",
  3,
  bltz_template,
  &bsz12_iclass
};

static xtensa_opcode_internal bnall_opcode = {
  "bnall",
  3,
  bnall_template,
  &bst8_iclass
};

static xtensa_opcode_internal bne_opcode = {
  "bne",
  3,
  bne_template,
  &bst8_iclass
};

static xtensa_opcode_internal bnei_opcode = {
  "bnei",
  3,
  bnei_template,
  &bsi8_iclass
};

static xtensa_opcode_internal bnez_opcode = {
  "bnez",
  3,
  bnez_template,
  &bsz12_iclass
};

static xtensa_opcode_internal bnez_n_opcode = {
  "bnez.n",
  2,
  bnez_n_template,
  &bz6_iclass
};

static xtensa_opcode_internal bnone_opcode = {
  "bnone",
  3,
  bnone_template,
  &bst8_iclass
};

static xtensa_opcode_internal break_opcode = {
  "break",
  3,
  break_template,
  &break_iclass
};

static xtensa_opcode_internal break_n_opcode = {
  "break.n",
  2,
  break_n_template,
  &break_n_iclass
};

static xtensa_opcode_internal call0_opcode = {
  "call0",
  3,
  call0_template,
  &call_iclass
};

static xtensa_opcode_internal call12_opcode = {
  "call12",
  3,
  call12_template,
  &call12_iclass
};

static xtensa_opcode_internal call4_opcode = {
  "call4",
  3,
  call4_template,
  &call4_iclass
};

static xtensa_opcode_internal call8_opcode = {
  "call8",
  3,
  call8_template,
  &call8_iclass
};

static xtensa_opcode_internal callx0_opcode = {
  "callx0",
  3,
  callx0_template,
  &callx_iclass
};

static xtensa_opcode_internal callx12_opcode = {
  "callx12",
  3,
  callx12_template,
  &callx12_iclass
};

static xtensa_opcode_internal callx4_opcode = {
  "callx4",
  3,
  callx4_template,
  &callx4_iclass
};

static xtensa_opcode_internal callx8_opcode = {
  "callx8",
  3,
  callx8_template,
  &callx8_iclass
};

static xtensa_opcode_internal dhi_opcode = {
  "dhi",
  3,
  dhi_template,
  &dcache_iclass
};

static xtensa_opcode_internal dhwb_opcode = {
  "dhwb",
  3,
  dhwb_template,
  &dcache_iclass
};

static xtensa_opcode_internal dhwbi_opcode = {
  "dhwbi",
  3,
  dhwbi_template,
  &dcache_iclass
};

static xtensa_opcode_internal dii_opcode = {
  "dii",
  3,
  dii_template,
  &dcache_iclass
};

static xtensa_opcode_internal diwb_opcode = {
  "diwb",
  3,
  diwb_template,
  &dce_iclass
};

static xtensa_opcode_internal diwbi_opcode = {
  "diwbi",
  3,
  diwbi_template,
  &dce_iclass
};

static xtensa_opcode_internal dpfr_opcode = {
  "dpfr",
  3,
  dpfr_template,
  &dpf_iclass
};

static xtensa_opcode_internal dpfro_opcode = {
  "dpfro",
  3,
  dpfro_template,
  &dpf_iclass
};

static xtensa_opcode_internal dpfw_opcode = {
  "dpfw",
  3,
  dpfw_template,
  &dpf_iclass
};

static xtensa_opcode_internal dpfwo_opcode = {
  "dpfwo",
  3,
  dpfwo_template,
  &dpf_iclass
};

static xtensa_opcode_internal dsync_opcode = {
  "dsync",
  3,
  dsync_template,
  &sync_iclass
};

static xtensa_opcode_internal entry_opcode = {
  "entry",
  3,
  entry_template,
  &entry_iclass
};

static xtensa_opcode_internal esync_opcode = {
  "esync",
  3,
  esync_template,
  &sync_iclass
};

static xtensa_opcode_internal excw_opcode = {
  "excw",
  3,
  excw_template,
  &excw_iclass
};

static xtensa_opcode_internal extui_opcode = {
  "extui",
  3,
  extui_template,
  &exti_iclass
};

static xtensa_opcode_internal idtlb_opcode = {
  "idtlb",
  3,
  idtlb_template,
  &itlb_iclass
};

static xtensa_opcode_internal idtlba_opcode = {
  "idtlba",
  3,
  idtlba_template,
  &itlba_iclass
};

static xtensa_opcode_internal ihi_opcode = {
  "ihi",
  3,
  ihi_template,
  &icache_iclass
};

static xtensa_opcode_internal iii_opcode = {
  "iii",
  3,
  iii_template,
  &icache_iclass
};

static xtensa_opcode_internal iitlb_opcode = {
  "iitlb",
  3,
  iitlb_template,
  &itlb_iclass
};

static xtensa_opcode_internal iitlba_opcode = {
  "iitlba",
  3,
  iitlba_template,
  &itlba_iclass
};

static xtensa_opcode_internal ipf_opcode = {
  "ipf",
  3,
  ipf_template,
  &icache_iclass
};

static xtensa_opcode_internal isync_opcode = {
  "isync",
  3,
  isync_template,
  &sync_iclass
};

static xtensa_opcode_internal j_opcode = {
  "j",
  3,
  j_template,
  &jump_iclass
};

static xtensa_opcode_internal jx_opcode = {
  "jx",
  3,
  jx_template,
  &jumpx_iclass
};

static xtensa_opcode_internal l16si_opcode = {
  "l16si",
  3,
  l16si_template,
  &l16i_iclass
};

static xtensa_opcode_internal l16ui_opcode = {
  "l16ui",
  3,
  l16ui_template,
  &l16i_iclass
};

static xtensa_opcode_internal l32e_opcode = {
  "l32e",
  3,
  l32e_template,
  &l32e_iclass
};

static xtensa_opcode_internal l32i_opcode = {
  "l32i",
  3,
  l32i_template,
  &l32i_iclass
};

static xtensa_opcode_internal l32i_n_opcode = {
  "l32i.n",
  2,
  l32i_n_template,
  &loadi4_iclass
};

static xtensa_opcode_internal l32r_opcode = {
  "l32r",
  3,
  l32r_template,
  &l32r_iclass
};

static xtensa_opcode_internal l8ui_opcode = {
  "l8ui",
  3,
  l8ui_template,
  &l8i_iclass
};

static xtensa_opcode_internal ldct_opcode = {
  "ldct",
  3,
  ldct_template,
  &actl_iclass
};

static xtensa_opcode_internal lict_opcode = {
  "lict",
  3,
  lict_template,
  &actl_iclass
};

static xtensa_opcode_internal licw_opcode = {
  "licw",
  3,
  licw_template,
  &actl_iclass
};

static xtensa_opcode_internal loop_opcode = {
  "loop",
  3,
  loop_template,
  &loop_iclass
};

static xtensa_opcode_internal loopgtz_opcode = {
  "loopgtz",
  3,
  loopgtz_template,
  &loop_iclass
};

static xtensa_opcode_internal loopnez_opcode = {
  "loopnez",
  3,
  loopnez_template,
  &loop_iclass
};

static xtensa_opcode_internal memw_opcode = {
  "memw",
  3,
  memw_template,
  &sync_iclass
};

static xtensa_opcode_internal mov_n_opcode = {
  "mov.n",
  2,
  mov_n_template,
  &mov_n_iclass
};

static xtensa_opcode_internal moveqz_opcode = {
  "moveqz",
  3,
  moveqz_template,
  &movz_iclass
};

static xtensa_opcode_internal movgez_opcode = {
  "movgez",
  3,
  movgez_template,
  &movz_iclass
};

static xtensa_opcode_internal movi_opcode = {
  "movi",
  3,
  movi_template,
  &movi_iclass
};

static xtensa_opcode_internal movi_n_opcode = {
  "movi.n",
  2,
  movi_n_template,
  &movi_n_iclass
};

static xtensa_opcode_internal movltz_opcode = {
  "movltz",
  3,
  movltz_template,
  &movz_iclass
};

static xtensa_opcode_internal movnez_opcode = {
  "movnez",
  3,
  movnez_template,
  &movz_iclass
};

static xtensa_opcode_internal movsp_opcode = {
  "movsp",
  3,
  movsp_template,
  &movsp_iclass
};

static xtensa_opcode_internal neg_opcode = {
  "neg",
  3,
  neg_template,
  &neg_iclass
};

static xtensa_opcode_internal nop_n_opcode = {
  "nop.n",
  2,
  nop_n_template,
  &nopn_iclass
};

static xtensa_opcode_internal nsa_opcode = {
  "nsa",
  3,
  nsa_template,
  &nsa_iclass
};

static xtensa_opcode_internal nsau_opcode = {
  "nsau",
  3,
  nsau_template,
  &nsa_iclass
};

static xtensa_opcode_internal or_opcode = {
  "or",
  3,
  or_template,
  &bit_iclass
};

static xtensa_opcode_internal pdtlb_opcode = {
  "pdtlb",
  3,
  pdtlb_template,
  &rtlb_iclass
};

static xtensa_opcode_internal pitlb_opcode = {
  "pitlb",
  3,
  pitlb_template,
  &rtlb_iclass
};

static xtensa_opcode_internal rdtlb0_opcode = {
  "rdtlb0",
  3,
  rdtlb0_template,
  &rtlb_iclass
};

static xtensa_opcode_internal rdtlb1_opcode = {
  "rdtlb1",
  3,
  rdtlb1_template,
  &rtlb_iclass
};

static xtensa_opcode_internal ret_opcode = {
  "ret",
  3,
  ret_template,
  &return_iclass
};

static xtensa_opcode_internal ret_n_opcode = {
  "ret.n",
  2,
  ret_n_template,
  &retn_iclass
};

static xtensa_opcode_internal retw_opcode = {
  "retw",
  3,
  retw_template,
  &return_iclass
};

static xtensa_opcode_internal retw_n_opcode = {
  "retw.n",
  2,
  retw_n_template,
  &retn_iclass
};

static xtensa_opcode_internal rfde_opcode = {
  "rfde",
  3,
  rfde_template,
  &rfe_iclass
};

static xtensa_opcode_internal rfe_opcode = {
  "rfe",
  3,
  rfe_template,
  &rfe_iclass
};

static xtensa_opcode_internal rfi_opcode = {
  "rfi",
  3,
  rfi_template,
  &rfi_iclass
};

static xtensa_opcode_internal rfwo_opcode = {
  "rfwo",
  3,
  rfwo_template,
  &rfe_iclass
};

static xtensa_opcode_internal rfwu_opcode = {
  "rfwu",
  3,
  rfwu_template,
  &rfe_iclass
};

static xtensa_opcode_internal ritlb0_opcode = {
  "ritlb0",
  3,
  ritlb0_template,
  &rtlb_iclass
};

static xtensa_opcode_internal ritlb1_opcode = {
  "ritlb1",
  3,
  ritlb1_template,
  &rtlb_iclass
};

static xtensa_opcode_internal rotw_opcode = {
  "rotw",
  3,
  rotw_template,
  &rotw_iclass
};

static xtensa_opcode_internal rsil_opcode = {
  "rsil",
  3,
  rsil_template,
  &rsil_iclass
};

static xtensa_opcode_internal rsr_opcode = {
  "rsr",
  3,
  rsr_template,
  &rsr_iclass
};

static xtensa_opcode_internal rsync_opcode = {
  "rsync",
  3,
  rsync_template,
  &sync_iclass
};

static xtensa_opcode_internal s16i_opcode = {
  "s16i",
  3,
  s16i_template,
  &s16i_iclass
};

static xtensa_opcode_internal s32e_opcode = {
  "s32e",
  3,
  s32e_template,
  &s32e_iclass
};

static xtensa_opcode_internal s32i_opcode = {
  "s32i",
  3,
  s32i_template,
  &s32i_iclass
};

static xtensa_opcode_internal s32i_n_opcode = {
  "s32i.n",
  2,
  s32i_n_template,
  &storei4_iclass
};

static xtensa_opcode_internal s8i_opcode = {
  "s8i",
  3,
  s8i_template,
  &s8i_iclass
};

static xtensa_opcode_internal sdct_opcode = {
  "sdct",
  3,
  sdct_template,
  &acts_iclass
};

static xtensa_opcode_internal sict_opcode = {
  "sict",
  3,
  sict_template,
  &acts_iclass
};

static xtensa_opcode_internal sicw_opcode = {
  "sicw",
  3,
  sicw_template,
  &acts_iclass
};

static xtensa_opcode_internal simcall_opcode = {
  "simcall",
  3,
  simcall_template,
  &syscall_iclass
};

static xtensa_opcode_internal sll_opcode = {
  "sll",
  3,
  sll_template,
  &shifts_iclass
};

static xtensa_opcode_internal slli_opcode = {
  "slli",
  3,
  slli_template,
  &slli_iclass
};

static xtensa_opcode_internal sra_opcode = {
  "sra",
  3,
  sra_template,
  &shiftt_iclass
};

static xtensa_opcode_internal srai_opcode = {
  "srai",
  3,
  srai_template,
  &srai_iclass
};

static xtensa_opcode_internal src_opcode = {
  "src",
  3,
  src_template,
  &shiftst_iclass
};

static xtensa_opcode_internal srl_opcode = {
  "srl",
  3,
  srl_template,
  &shiftt_iclass
};

static xtensa_opcode_internal srli_opcode = {
  "srli",
  3,
  srli_template,
  &srli_iclass
};

static xtensa_opcode_internal ssa8b_opcode = {
  "ssa8b",
  3,
  ssa8b_template,
  &sar_iclass
};

static xtensa_opcode_internal ssa8l_opcode = {
  "ssa8l",
  3,
  ssa8l_template,
  &sar_iclass
};

static xtensa_opcode_internal ssai_opcode = {
  "ssai",
  3,
  ssai_template,
  &sari_iclass
};

static xtensa_opcode_internal ssl_opcode = {
  "ssl",
  3,
  ssl_template,
  &sar_iclass
};

static xtensa_opcode_internal ssr_opcode = {
  "ssr",
  3,
  ssr_template,
  &sar_iclass
};

static xtensa_opcode_internal sub_opcode = {
  "sub",
  3,
  sub_template,
  &addsub_iclass
};

static xtensa_opcode_internal subx2_opcode = {
  "subx2",
  3,
  subx2_template,
  &addsub_iclass
};

static xtensa_opcode_internal subx4_opcode = {
  "subx4",
  3,
  subx4_template,
  &addsub_iclass
};

static xtensa_opcode_internal subx8_opcode = {
  "subx8",
  3,
  subx8_template,
  &addsub_iclass
};

static xtensa_opcode_internal syscall_opcode = {
  "syscall",
  3,
  syscall_template,
  &syscall_iclass
};

static xtensa_opcode_internal waiti_opcode = {
  "waiti",
  3,
  waiti_template,
  &wait_iclass
};

static xtensa_opcode_internal wdtlb_opcode = {
  "wdtlb",
  3,
  wdtlb_template,
  &wtlb_iclass
};

static xtensa_opcode_internal witlb_opcode = {
  "witlb",
  3,
  witlb_template,
  &wtlb_iclass
};

static xtensa_opcode_internal wsr_opcode = {
  "wsr",
  3,
  wsr_template,
  &wsr_iclass
};

static xtensa_opcode_internal xor_opcode = {
  "xor",
  3,
  xor_template,
  &bit_iclass
};

static xtensa_opcode_internal xsr_opcode = {
  "xsr",
  3,
  xsr_template,
  &xsr_iclass
};

static xtensa_opcode_internal * opcodes[149] = {
  &abs_opcode,
  &add_opcode,
  &add_n_opcode,
  &addi_opcode,
  &addi_n_opcode,
  &addmi_opcode,
  &addx2_opcode,
  &addx4_opcode,
  &addx8_opcode,
  &and_opcode,
  &ball_opcode,
  &bany_opcode,
  &bbc_opcode,
  &bbci_opcode,
  &bbs_opcode,
  &bbsi_opcode,
  &beq_opcode,
  &beqi_opcode,
  &beqz_opcode,
  &beqz_n_opcode,
  &bge_opcode,
  &bgei_opcode,
  &bgeu_opcode,
  &bgeui_opcode,
  &bgez_opcode,
  &blt_opcode,
  &blti_opcode,
  &bltu_opcode,
  &bltui_opcode,
  &bltz_opcode,
  &bnall_opcode,
  &bne_opcode,
  &bnei_opcode,
  &bnez_opcode,
  &bnez_n_opcode,
  &bnone_opcode,
  &break_opcode,
  &break_n_opcode,
  &call0_opcode,
  &call12_opcode,
  &call4_opcode,
  &call8_opcode,
  &callx0_opcode,
  &callx12_opcode,
  &callx4_opcode,
  &callx8_opcode,
  &dhi_opcode,
  &dhwb_opcode,
  &dhwbi_opcode,
  &dii_opcode,
  &diwb_opcode,
  &diwbi_opcode,
  &dpfr_opcode,
  &dpfro_opcode,
  &dpfw_opcode,
  &dpfwo_opcode,
  &dsync_opcode,
  &entry_opcode,
  &esync_opcode,
  &excw_opcode,
  &extui_opcode,
  &idtlb_opcode,
  &idtlba_opcode,
  &ihi_opcode,
  &iii_opcode,
  &iitlb_opcode,
  &iitlba_opcode,
  &ipf_opcode,
  &isync_opcode,
  &j_opcode,
  &jx_opcode,
  &l16si_opcode,
  &l16ui_opcode,
  &l32e_opcode,
  &l32i_opcode,
  &l32i_n_opcode,
  &l32r_opcode,
  &l8ui_opcode,
  &ldct_opcode,
  &lict_opcode,
  &licw_opcode,
  &loop_opcode,
  &loopgtz_opcode,
  &loopnez_opcode,
  &memw_opcode,
  &mov_n_opcode,
  &moveqz_opcode,
  &movgez_opcode,
  &movi_opcode,
  &movi_n_opcode,
  &movltz_opcode,
  &movnez_opcode,
  &movsp_opcode,
  &neg_opcode,
  &nop_n_opcode,
  &nsa_opcode,
  &nsau_opcode,
  &or_opcode,
  &pdtlb_opcode,
  &pitlb_opcode,
  &rdtlb0_opcode,
  &rdtlb1_opcode,
  &ret_opcode,
  &ret_n_opcode,
  &retw_opcode,
  &retw_n_opcode,
  &rfde_opcode,
  &rfe_opcode,
  &rfi_opcode,
  &rfwo_opcode,
  &rfwu_opcode,
  &ritlb0_opcode,
  &ritlb1_opcode,
  &rotw_opcode,
  &rsil_opcode,
  &rsr_opcode,
  &rsync_opcode,
  &s16i_opcode,
  &s32e_opcode,
  &s32i_opcode,
  &s32i_n_opcode,
  &s8i_opcode,
  &sdct_opcode,
  &sict_opcode,
  &sicw_opcode,
  &simcall_opcode,
  &sll_opcode,
  &slli_opcode,
  &sra_opcode,
  &srai_opcode,
  &src_opcode,
  &srl_opcode,
  &srli_opcode,
  &ssa8b_opcode,
  &ssa8l_opcode,
  &ssai_opcode,
  &ssl_opcode,
  &ssr_opcode,
  &sub_opcode,
  &subx2_opcode,
  &subx4_opcode,
  &subx8_opcode,
  &syscall_opcode,
  &waiti_opcode,
  &wdtlb_opcode,
  &witlb_opcode,
  &wsr_opcode,
  &xor_opcode,
  &xsr_opcode
};

xtensa_opcode_internal **
get_opcodes (void)
{
  return &opcodes[0];
}

int
get_num_opcodes (void)
{
  return 149;
}

#define xtensa_abs_op 0
#define xtensa_add_op 1
#define xtensa_add_n_op 2
#define xtensa_addi_op 3
#define xtensa_addi_n_op 4
#define xtensa_addmi_op 5
#define xtensa_addx2_op 6
#define xtensa_addx4_op 7
#define xtensa_addx8_op 8
#define xtensa_and_op 9
#define xtensa_ball_op 10
#define xtensa_bany_op 11
#define xtensa_bbc_op 12
#define xtensa_bbci_op 13
#define xtensa_bbs_op 14
#define xtensa_bbsi_op 15
#define xtensa_beq_op 16
#define xtensa_beqi_op 17
#define xtensa_beqz_op 18
#define xtensa_beqz_n_op 19
#define xtensa_bge_op 20
#define xtensa_bgei_op 21
#define xtensa_bgeu_op 22
#define xtensa_bgeui_op 23
#define xtensa_bgez_op 24
#define xtensa_blt_op 25
#define xtensa_blti_op 26
#define xtensa_bltu_op 27
#define xtensa_bltui_op 28
#define xtensa_bltz_op 29
#define xtensa_bnall_op 30
#define xtensa_bne_op 31
#define xtensa_bnei_op 32
#define xtensa_bnez_op 33
#define xtensa_bnez_n_op 34
#define xtensa_bnone_op 35
#define xtensa_break_op 36
#define xtensa_break_n_op 37
#define xtensa_call0_op 38
#define xtensa_call12_op 39
#define xtensa_call4_op 40
#define xtensa_call8_op 41
#define xtensa_callx0_op 42
#define xtensa_callx12_op 43
#define xtensa_callx4_op 44
#define xtensa_callx8_op 45
#define xtensa_dhi_op 46
#define xtensa_dhwb_op 47
#define xtensa_dhwbi_op 48
#define xtensa_dii_op 49
#define xtensa_diwb_op 50
#define xtensa_diwbi_op 51
#define xtensa_dpfr_op 52
#define xtensa_dpfro_op 53
#define xtensa_dpfw_op 54
#define xtensa_dpfwo_op 55
#define xtensa_dsync_op 56
#define xtensa_entry_op 57
#define xtensa_esync_op 58
#define xtensa_excw_op 59
#define xtensa_extui_op 60
#define xtensa_idtlb_op 61
#define xtensa_idtlba_op 62
#define xtensa_ihi_op 63
#define xtensa_iii_op 64
#define xtensa_iitlb_op 65
#define xtensa_iitlba_op 66
#define xtensa_ipf_op 67
#define xtensa_isync_op 68
#define xtensa_j_op 69
#define xtensa_jx_op 70
#define xtensa_l16si_op 71
#define xtensa_l16ui_op 72
#define xtensa_l32e_op 73
#define xtensa_l32i_op 74
#define xtensa_l32i_n_op 75
#define xtensa_l32r_op 76
#define xtensa_l8ui_op 77
#define xtensa_ldct_op 78
#define xtensa_lict_op 79
#define xtensa_licw_op 80
#define xtensa_loop_op 81
#define xtensa_loopgtz_op 82
#define xtensa_loopnez_op 83
#define xtensa_memw_op 84
#define xtensa_mov_n_op 85
#define xtensa_moveqz_op 86
#define xtensa_movgez_op 87
#define xtensa_movi_op 88
#define xtensa_movi_n_op 89
#define xtensa_movltz_op 90
#define xtensa_movnez_op 91
#define xtensa_movsp_op 92
#define xtensa_neg_op 93
#define xtensa_nop_n_op 94
#define xtensa_nsa_op 95
#define xtensa_nsau_op 96
#define xtensa_or_op 97
#define xtensa_pdtlb_op 98
#define xtensa_pitlb_op 99
#define xtensa_rdtlb0_op 100
#define xtensa_rdtlb1_op 101
#define xtensa_ret_op 102
#define xtensa_ret_n_op 103
#define xtensa_retw_op 104
#define xtensa_retw_n_op 105
#define xtensa_rfde_op 106
#define xtensa_rfe_op 107
#define xtensa_rfi_op 108
#define xtensa_rfwo_op 109
#define xtensa_rfwu_op 110
#define xtensa_ritlb0_op 111
#define xtensa_ritlb1_op 112
#define xtensa_rotw_op 113
#define xtensa_rsil_op 114
#define xtensa_rsr_op 115
#define xtensa_rsync_op 116
#define xtensa_s16i_op 117
#define xtensa_s32e_op 118
#define xtensa_s32i_op 119
#define xtensa_s32i_n_op 120
#define xtensa_s8i_op 121
#define xtensa_sdct_op 122
#define xtensa_sict_op 123
#define xtensa_sicw_op 124
#define xtensa_simcall_op 125
#define xtensa_sll_op 126
#define xtensa_slli_op 127
#define xtensa_sra_op 128
#define xtensa_srai_op 129
#define xtensa_src_op 130
#define xtensa_srl_op 131
#define xtensa_srli_op 132
#define xtensa_ssa8b_op 133
#define xtensa_ssa8l_op 134
#define xtensa_ssai_op 135
#define xtensa_ssl_op 136
#define xtensa_ssr_op 137
#define xtensa_sub_op 138
#define xtensa_subx2_op 139
#define xtensa_subx4_op 140
#define xtensa_subx8_op 141
#define xtensa_syscall_op 142
#define xtensa_waiti_op 143
#define xtensa_wdtlb_op 144
#define xtensa_witlb_op 145
#define xtensa_wsr_op 146
#define xtensa_xor_op 147
#define xtensa_xsr_op 148

int
decode_insn (const xtensa_insnbuf insn)
{
  switch (get_op0_field (insn)) {
  case 0: /* QRST: op0=0000 */
    switch (get_op1_field (insn)) {
    case 3: /* RST3: op1=0011 */
      switch (get_op2_field (insn)) {
      case 8: /* MOVEQZ: op2=1000 */
        return xtensa_moveqz_op;
      case 9: /* MOVNEZ: op2=1001 */
        return xtensa_movnez_op;
      case 10: /* MOVLTZ: op2=1010 */
        return xtensa_movltz_op;
      case 11: /* MOVGEZ: op2=1011 */
        return xtensa_movgez_op;
      case 0: /* RSR: op2=0000 */
        return xtensa_rsr_op;
      case 1: /* WSR: op2=0001 */
        return xtensa_wsr_op;
      }
      break;
    case 9: /* LSI4: op1=1001 */
      switch (get_op2_field (insn)) {
      case 4: /* S32E: op2=0100 */
        return xtensa_s32e_op;
      case 0: /* L32E: op2=0000 */
        return xtensa_l32e_op;
      }
      break;
    case 4: /* EXTUI: op1=010x */
    case 5: /* EXTUI: op1=010x */
      return xtensa_extui_op;
    case 0: /* RST0: op1=0000 */
      switch (get_op2_field (insn)) {
      case 15: /* SUBX8: op2=1111 */
        return xtensa_subx8_op;
      case 0: /* ST0: op2=0000 */
        switch (get_r_field (insn)) {
        case 0: /* SNM0: r=0000 */
          switch (get_m_field (insn)) {
          case 2: /* JR: m=10 */
            switch (get_n_field (insn)) {
            case 0: /* RET: n=00 */
              return xtensa_ret_op;
            case 1: /* RETW: n=01 */
              return xtensa_retw_op;
            case 2: /* JX: n=10 */
              return xtensa_jx_op;
            }
            break;
          case 3: /* CALLX: m=11 */
            switch (get_n_field (insn)) {
            case 0: /* CALLX0: n=00 */
              return xtensa_callx0_op;
            case 1: /* CALLX4: n=01 */
              return xtensa_callx4_op;
            case 2: /* CALLX8: n=10 */
              return xtensa_callx8_op;
            case 3: /* CALLX12: n=11 */
              return xtensa_callx12_op;
            }
            break;
          }
          break;
        case 1: /* MOVSP: r=0001 */
          return xtensa_movsp_op;
        case 2: /* SYNC: r=0010 */
          switch (get_s_field (insn)) {
          case 0: /* SYNCT: s=0000 */
            switch (get_t_field (insn)) {
            case 2: /* ESYNC: t=0010 */
              return xtensa_esync_op;
            case 3: /* DSYNC: t=0011 */
              return xtensa_dsync_op;
            case 8: /* EXCW: t=1000 */
              return xtensa_excw_op;
            case 12: /* MEMW: t=1100 */
              return xtensa_memw_op;
            case 0: /* ISYNC: t=0000 */
              return xtensa_isync_op;
            case 1: /* RSYNC: t=0001 */
              return xtensa_rsync_op;
            }
            break;
          }
          break;
        case 4: /* BREAK: r=0100 */
          return xtensa_break_op;
        case 3: /* RFEI: r=0011 */
          switch (get_t_field (insn)) {
          case 0: /* RFET: t=0000 */
            switch (get_s_field (insn)) {
            case 2: /* RFDE: s=0010 */
              return xtensa_rfde_op;
            case 4: /* RFWO: s=0100 */
              return xtensa_rfwo_op;
            case 5: /* RFWU: s=0101 */
              return xtensa_rfwu_op;
            case 0: /* RFE: s=0000 */
              return xtensa_rfe_op;
            }
            break;
          case 1: /* RFI: t=0001 */
            return xtensa_rfi_op;
          }
          break;
        case 5: /* SCALL: r=0101 */
          switch (get_s_field (insn)) {
          case 0: /* SYSCALL: s=0000 */
            return xtensa_syscall_op;
          case 1: /* SIMCALL: s=0001 */
            return xtensa_simcall_op;
          }
          break;
        case 6: /* RSIL: r=0110 */
          return xtensa_rsil_op;
        case 7: /* WAITI: r=0111 */
          return xtensa_waiti_op;
        }
        break;
      case 1: /* AND: op2=0001 */
        return xtensa_and_op;
      case 2: /* OR: op2=0010 */
        return xtensa_or_op;
      case 3: /* XOR: op2=0011 */
        return xtensa_xor_op;
      case 4: /* ST1: op2=0100 */
        switch (get_r_field (insn)) {
        case 15: /* NSAU: r=1111 */
          return xtensa_nsau_op;
        case 0: /* SSR: r=0000 */
          return xtensa_ssr_op;
        case 1: /* SSL: r=0001 */
          return xtensa_ssl_op;
        case 2: /* SSA8L: r=0010 */
          return xtensa_ssa8l_op;
        case 3: /* SSA8B: r=0011 */
          return xtensa_ssa8b_op;
        case 4: /* SSAI: r=0100 */
          return xtensa_ssai_op;
        case 8: /* ROTW: r=1000 */
          return xtensa_rotw_op;
        case 14: /* NSA: r=1110 */
          return xtensa_nsa_op;
        }
        break;
      case 8: /* ADD: op2=1000 */
        return xtensa_add_op;
      case 5: /* ST4: op2=0101 */
        switch (get_r_field (insn)) {
        case 15: /* RDTLB1: r=1111 */
          return xtensa_rdtlb1_op;
        case 0: /* IITLBA: r=0000 */
          return xtensa_iitlba_op;
        case 3: /* RITLB0: r=0011 */
          return xtensa_ritlb0_op;
        case 4: /* IITLB: r=0100 */
          return xtensa_iitlb_op;
        case 8: /* IDTLBA: r=1000 */
          return xtensa_idtlba_op;
        case 5: /* PITLB: r=0101 */
          return xtensa_pitlb_op;
        case 6: /* WITLB: r=0110 */
          return xtensa_witlb_op;
        case 7: /* RITLB1: r=0111 */
          return xtensa_ritlb1_op;
        case 11: /* RDTLB0: r=1011 */
          return xtensa_rdtlb0_op;
        case 12: /* IDTLB: r=1100 */
          return xtensa_idtlb_op;
        case 13: /* PDTLB: r=1101 */
          return xtensa_pdtlb_op;
        case 14: /* WDTLB: r=1110 */
          return xtensa_wdtlb_op;
        }
        break;
      case 6: /* RT0: op2=0110 */
        switch (get_s_field (insn)) {
        case 0: /* NEG: s=0000 */
          return xtensa_neg_op;
        case 1: /* ABS: s=0001 */
          return xtensa_abs_op;
        }
        break;
      case 9: /* ADDX2: op2=1001 */
        return xtensa_addx2_op;
      case 10: /* ADDX4: op2=1010 */
        return xtensa_addx4_op;
      case 11: /* ADDX8: op2=1011 */
        return xtensa_addx8_op;
      case 12: /* SUB: op2=1100 */
        return xtensa_sub_op;
      case 13: /* SUBX2: op2=1101 */
        return xtensa_subx2_op;
      case 14: /* SUBX4: op2=1110 */
        return xtensa_subx4_op;
      }
      break;
    case 1: /* RST1: op1=0001 */
      switch (get_op2_field (insn)) {
      case 15: /* IMP: op2=1111 */
        switch (get_r_field (insn)) {
        case 0: /* LICT: r=0000 */
          return xtensa_lict_op;
        case 1: /* SICT: r=0001 */
          return xtensa_sict_op;
        case 2: /* LICW: r=0010 */
          return xtensa_licw_op;
        case 3: /* SICW: r=0011 */
          return xtensa_sicw_op;
        case 8: /* LDCT: r=1000 */
          return xtensa_ldct_op;
        case 9: /* SDCT: r=1001 */
          return xtensa_sdct_op;
        }
        break;
      case 0: /* SLLI: op2=000x */
      case 1: /* SLLI: op2=000x */
        return xtensa_slli_op;
      case 2: /* SRAI: op2=001x */
      case 3: /* SRAI: op2=001x */
        return xtensa_srai_op;
      case 4: /* SRLI: op2=0100 */
        return xtensa_srli_op;
      case 8: /* SRC: op2=1000 */
        return xtensa_src_op;
      case 9: /* SRL: op2=1001 */
        return xtensa_srl_op;
      case 6: /* XSR: op2=0110 */
        return xtensa_xsr_op;
      case 10: /* SLL: op2=1010 */
        return xtensa_sll_op;
      case 11: /* SRA: op2=1011 */
        return xtensa_sra_op;
      }
      break;
    }
    break;
  case 1: /* L32R: op0=0001 */
    return xtensa_l32r_op;
  case 2: /* LSAI: op0=0010 */
    switch (get_r_field (insn)) {
    case 0: /* L8UI: r=0000 */
      return xtensa_l8ui_op;
    case 1: /* L16UI: r=0001 */
      return xtensa_l16ui_op;
    case 2: /* L32I: r=0010 */
      return xtensa_l32i_op;
    case 4: /* S8I: r=0100 */
      return xtensa_s8i_op;
    case 5: /* S16I: r=0101 */
      return xtensa_s16i_op;
    case 9: /* L16SI: r=1001 */
      return xtensa_l16si_op;
    case 6: /* S32I: r=0110 */
      return xtensa_s32i_op;
    case 7: /* CACHE: r=0111 */
      switch (get_t_field (insn)) {
      case 15: /* III: t=1111 */
        return xtensa_iii_op;
      case 0: /* DPFR: t=0000 */
        return xtensa_dpfr_op;
      case 1: /* DPFW: t=0001 */
        return xtensa_dpfw_op;
      case 2: /* DPFRO: t=0010 */
        return xtensa_dpfro_op;
      case 4: /* DHWB: t=0100 */
        return xtensa_dhwb_op;
      case 3: /* DPFWO: t=0011 */
        return xtensa_dpfwo_op;
      case 8: /* DCE: t=1000 */
        switch (get_op1_field (insn)) {
        case 4: /* DIWB: op1=0100 */
          return xtensa_diwb_op;
        case 5: /* DIWBI: op1=0101 */
          return xtensa_diwbi_op;
        }
        break;
      case 5: /* DHWBI: t=0101 */
        return xtensa_dhwbi_op;
      case 6: /* DHI: t=0110 */
        return xtensa_dhi_op;
      case 7: /* DII: t=0111 */
        return xtensa_dii_op;
      case 12: /* IPF: t=1100 */
        return xtensa_ipf_op;
      case 14: /* IHI: t=1110 */
        return xtensa_ihi_op;
      }
      break;
    case 10: /* MOVI: r=1010 */
      return xtensa_movi_op;
    case 12: /* ADDI: r=1100 */
      return xtensa_addi_op;
    case 13: /* ADDMI: r=1101 */
      return xtensa_addmi_op;
    }
    break;
  case 8: /* L32I.N: op0=1000 */
    return xtensa_l32i_n_op;
  case 5: /* CALL: op0=0101 */
    switch (get_n_field (insn)) {
    case 0: /* CALL0: n=00 */
      return xtensa_call0_op;
    case 1: /* CALL4: n=01 */
      return xtensa_call4_op;
    case 2: /* CALL8: n=10 */
      return xtensa_call8_op;
    case 3: /* CALL12: n=11 */
      return xtensa_call12_op;
    }
    break;
  case 6: /* SI: op0=0110 */
    switch (get_n_field (insn)) {
    case 0: /* J: n=00 */
      return xtensa_j_op;
    case 1: /* BZ: n=01 */
      switch (get_m_field (insn)) {
      case 0: /* BEQZ: m=00 */
        return xtensa_beqz_op;
      case 1: /* BNEZ: m=01 */
        return xtensa_bnez_op;
      case 2: /* BLTZ: m=10 */
        return xtensa_bltz_op;
      case 3: /* BGEZ: m=11 */
        return xtensa_bgez_op;
      }
      break;
    case 2: /* BI0: n=10 */
      switch (get_m_field (insn)) {
      case 0: /* BEQI: m=00 */
        return xtensa_beqi_op;
      case 1: /* BNEI: m=01 */
        return xtensa_bnei_op;
      case 2: /* BLTI: m=10 */
        return xtensa_blti_op;
      case 3: /* BGEI: m=11 */
        return xtensa_bgei_op;
      }
      break;
    case 3: /* BI1: n=11 */
      switch (get_m_field (insn)) {
      case 0: /* ENTRY: m=00 */
        return xtensa_entry_op;
      case 1: /* B1: m=01 */
        switch (get_r_field (insn)) {
        case 8: /* LOOP: r=1000 */
          return xtensa_loop_op;
        case 9: /* LOOPNEZ: r=1001 */
          return xtensa_loopnez_op;
        case 10: /* LOOPGTZ: r=1010 */
          return xtensa_loopgtz_op;
        }
        break;
      case 2: /* BLTUI: m=10 */
        return xtensa_bltui_op;
      case 3: /* BGEUI: m=11 */
        return xtensa_bgeui_op;
      }
      break;
    }
    break;
  case 9: /* S32I.N: op0=1001 */
    return xtensa_s32i_n_op;
  case 10: /* ADD.N: op0=1010 */
    return xtensa_add_n_op;
  case 7: /* B: op0=0111 */
    switch (get_r_field (insn)) {
    case 6: /* BBCI: r=011x */
    case 7: /* BBCI: r=011x */
      return xtensa_bbci_op;
    case 0: /* BNONE: r=0000 */
      return xtensa_bnone_op;
    case 1: /* BEQ: r=0001 */
      return xtensa_beq_op;
    case 2: /* BLT: r=0010 */
      return xtensa_blt_op;
    case 4: /* BALL: r=0100 */
      return xtensa_ball_op;
    case 14: /* BBSI: r=111x */
    case 15: /* BBSI: r=111x */
      return xtensa_bbsi_op;
    case 3: /* BLTU: r=0011 */
      return xtensa_bltu_op;
    case 5: /* BBC: r=0101 */
      return xtensa_bbc_op;
    case 8: /* BANY: r=1000 */
      return xtensa_bany_op;
    case 9: /* BNE: r=1001 */
      return xtensa_bne_op;
    case 10: /* BGE: r=1010 */
      return xtensa_bge_op;
    case 11: /* BGEU: r=1011 */
      return xtensa_bgeu_op;
    case 12: /* BNALL: r=1100 */
      return xtensa_bnall_op;
    case 13: /* BBS: r=1101 */
      return xtensa_bbs_op;
    }
    break;
  case 11: /* ADDI.N: op0=1011 */
    return xtensa_addi_n_op;
  case 12: /* ST2: op0=1100 */
    switch (get_i_field (insn)) {
    case 0: /* MOVI.N: i=0 */
      return xtensa_movi_n_op;
    case 1: /* BZ6: i=1 */
      switch (get_z_field (insn)) {
      case 0: /* BEQZ.N: z=0 */
        return xtensa_beqz_n_op;
      case 1: /* BNEZ.N: z=1 */
        return xtensa_bnez_n_op;
      }
      break;
    }
    break;
  case 13: /* ST3: op0=1101 */
    switch (get_r_field (insn)) {
    case 15: /* S3: r=1111 */
      switch (get_t_field (insn)) {
      case 0: /* RET.N: t=0000 */
        return xtensa_ret_n_op;
      case 1: /* RETW.N: t=0001 */
        return xtensa_retw_n_op;
      case 2: /* BREAK.N: t=0010 */
        return xtensa_break_n_op;
      case 3: /* NOP.N: t=0011 */
        return xtensa_nop_n_op;
      }
      break;
    case 0: /* MOV.N: r=0000 */
      return xtensa_mov_n_op;
    }
    break;
  }
  return XTENSA_UNDEFINED;
}

int
interface_version (void)
{
  return 3;
}

static struct config_struct config_table[] = {
  {"IsaMemoryOrder", "BigEndian"},
  {"PIFReadDataBits", "128"},
  {"PIFWriteDataBits", "128"},
  {"IsaCoprocessorCount", "0"},
  {"IsaUseBooleans", "0"},
  {"IsaUseDensityInstruction", "1"},
  {0, 0}
};

struct config_struct * get_config_table (void);

struct config_struct *
get_config_table (void)
{
  return config_table;
}

xtensa_isa_module xtensa_isa_modules[] = {
  { get_num_opcodes, get_opcodes, decode_insn, get_config_table },
  { 0, 0, 0, 0 }
};