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
|
/*
* Copyright (C) 2013-2019 Free Software Foundation, Inc.
*
* This file is part of GNU lightning.
*
* GNU lightning is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* GNU lightning 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 Lesser General Public
* License for more details.
*
* Authors:
* Paulo Cesar Pereira de Andrade
*/
#if PROTO
# if __WORDSIZE == 32
# define ldr(r0,r1) ldr_i(r0,r1)
# define ldxr(r0,r1,r2) ldxr_i(r0,r1,r2)
# define ldxi(r0,r1,i0) ldxi_i(r0,r1,i0)
# define stxi(i0,r0,r1) stxi_i(i0,r0,r1)
# else
# define ldr(r0,r1) ldr_l(r0,r1)
# define ldxr(r0,r1,r2) ldxr_l(r0,r1,r2)
# define ldxi(r0,r1,i0) ldxi_l(r0,r1,i0)
# define stxi(i0,r0,r1) stxi_l(i0,r0,r1)
# endif
# define is(i) *_jit->pc.us++ = i
# if __WORDSIZE == 32
# define stack_framesize 96
# else
# define stack_framesize 160
# endif
# define _R0_REGNO 0
# define _R1_REGNO 1
# define _R7_REGNO 7
# define _R13_REGNO 13
# define _FP_REGNO _R13_REGNO
# define _R14_REGNO 14
# define _R15_REGNO 15
# define u12_p(i0) ((i0) >= 0 && (i0) <= 4095)
# define s16_p(i0) ((i0) >= -32768 && (i0) <= 32767)
# define x16(i0) ((i0) & 0xffff)
# define s20_p(i0) ((i0) >= -524288 && (i0) <= 524287)
# define x20(i0) ((i0) & 0xfffff)
# if __WORDSIZE == 32
# define s32_p(i0) 1
# else
# define s32_p(i0) \
((i0) >= -2147483648L && (i0) < 2147483647L)
# endif
/*
Condition Code Instruction (Mask) Bit Mask Value
0 8 8
1 9 4
2 10 2
3 11 1
AGR:
0 Zero
1 < zero
2 > zero
3 Overflow
--
1 -> overflow CC_O
14 -> no overflow CC_NO
ALGR:
0 Zero, no carry
1 Not zero, no carry
2 Zero, carry
3 Not zero, carry
--
2|1 -> carry CC_NLE
8|4 -> no carry CC_LE
SGR:
0 Zero
1 < zero
2 > zero
3 Overflow
--
1 -> overflow CC_O
14 -> no overflow CC_NO
SLGR:
0 --
1 Not zero, borrow
2 Zero, no borrow
3 Not zero, no borrow
--
4 -> borrow CC_L
11 -> no borrow CC_NL
*/
# define CC_NV 0x0
# define CC_O 0x1
# define CC_H 0x2
# define CC_NLE 0x3
# define CC_L 0x4
# define CC_NHE 0x5
# define CC_LH 0x6
# define CC_NE 0x7
# define CC_E 0x8
# define CC_NLH 0x9
# define CC_HE 0xA
# define CC_NL 0xB
# define CC_LE 0xC
# define CC_NH 0xD
# define CC_NO 0xE
# define CC_AL 0xF
# define _us jit_uint16_t
# define _ui jit_uint32_t
# define E_(Op) _E(_jit,Op)
static void _E(jit_state_t*,_ui);
# define I_(Op,I) _I(_jit,Op,I)
static void _I(jit_state_t*,_ui,_ui);
# define RR_(Op,R1,R2) _RR(_jit,Op,R1,R2)
static void _RR(jit_state_t*,_ui,_ui,_ui);
# define RRE_(Op,R1,R2) _RRE(_jit,Op,R1,R2)
static void _RRE(jit_state_t*,_ui,_ui,_ui);
# define RRF_(Op,R3,M4,R1,R2) _RRF(_jit,Op,R3,M4,R1,R2)
static void _RRF(jit_state_t*,_ui,_ui,_ui,_ui,_ui);
# define RX_(Op,R1,X2,B2,D2) _RX(_jit,Op,R1,X2,B2,D2)
static void _RX(jit_state_t*,_ui,_ui,_ui,_ui,_ui);
# define RXE_(Op,R1,X2,B2,D2,Op2) _RXE(_jit,Op,R1,X2,B2,D2,Op2)
static void _RXE(jit_state_t*,_ui,_ui,_ui,_ui,_ui,_ui);
# define RXF_(Op,R3,X2,B2,D2,R1,Op2) _RXF(_jit,Op,R3,X2,B2,D2,R1,Op2)
static void _RXF(jit_state_t*,_ui,_ui,_ui,_ui,_ui,_ui,_ui);
# define RXY_(Op,R1,X2,B2,D2,Op2) _RXY(_jit,Op,R1,X2,B2,D2,Op2)
static void _RXY(jit_state_t*,_ui,_ui,_ui,_ui,_ui,_ui);
# define RS_(Op,R1,R3,B2,D2) _RS(_jit,Op,R1,R3,B2,D2)
static void _RS(jit_state_t*,_ui,_ui,_ui,_ui,_ui);
# define RSY_(Op,R1,R3,B2,D2,Op2) RXY_(Op,R1,R3,B2,D2,Op2)
# define RSL_(Op,L1,B1,D1,Op2) _RSL(_jit,Op,L1,B1,D1,Op2)
static void _RSL(jit_state_t*,_ui,_ui,_ui,_ui,_ui);
# define RSI_(Op,R1,R3,I2) _RSI(_jit,Op,R1,R3,I2)
static void _RSI(jit_state_t*,_ui,_ui,_ui,_ui);
# define RI_(Op,R1,Op2,I2) RSI_(Op,R1,Op2,I2)
# define RIE_(Op,R1,R3,I2,Op2) _RIE(_jit,Op,R1,R3,I2,Op2)
static void _RIE(jit_state_t*,_ui,_ui,_ui,_ui,_ui);
# define RIL_(Op,R1,Op2,I2) _RIL(_jit,Op,R1,Op2,I2)
static void _RIL(jit_state_t*,_ui,_ui,_ui,_ui);
# define SI_(Op,I2,B1,D1) _SI(_jit,Op,I2,B1,D1)
static void _SI(jit_state_t*,_ui,_ui,_ui,_ui);
# define SIY_(Op,I2,B1,D1,Op2) _SIY(_jit,Op,I2,B1,D1,Op2)
static void _SIY(jit_state_t*,_ui,_ui,_ui,_ui,_ui);
# define S_(Op,B2,D2) _S(_jit,Op,B2,D2)
static void _S(jit_state_t*,_ui,_ui,_ui);
# define SSL_(Op,L,B1,D1,B2,D2) SS_(Op,(L)>>4,(L)&0xF,B1,D1,B2,D2)
# define SS_(Op,LL,LH,B1,D1,B2,D2) _SS(_jit,Op,LL,LH,B1,D1,B2,D2)
static void _SS(jit_state_t*,_ui,_ui,_ui,_ui,_ui,_ui,_ui);
# define SSE_(Op,B1,D1,B2,D2) _SSE(_jit,Op,B1,D1,B2,D2)
static void _SSE(jit_state_t*,_ui,_ui,_ui,_ui,_ui);
# undef _us
# undef _ui
# define nop(c) _nop(_jit,c)
static void _nop(jit_state_t*,jit_int32_t);
# if __WORDSIZE == 32
# define ADD_(r0,r1) AR(r0,r1)
# define ADDI_(r0,i0) AHI(r0,i0)
# define ADDC_(r0,r1) ALR(r0,r1)
# define ADDX_(r0,r1) ALCR(r0,r1)
# define AND_(r0,r1) NR(r0,r1)
# define CMP_(r0,r1) CR(r0,r1)
# define CMPU_(r0,r1) CLR(r0,r1)
# define DIVREM_(r0,r1) DR(r0,r1)
# define DIVREMU_(r0,r1) DLR(r0,r1)
# define OR_(r0,r1) OR(r0,r1)
# define MUL_(r0,r1) MSR(r0,r1)
# define MULI_(r0,i0) MHI(r0,i0)
# define MULU_(r0,r1) MLR(r0,r1)
# define SUB_(r0,r1) SR(r0,r1)
# define SUBC_(r0,r1) SLR(r0,r1)
# define SUBX_(r0,r1) SLBR(r0,r1)
# define TEST_(r0,r1) LTR(r0,r1)
# define XOR_(r0,r1) XR(r0,r1)
# else
# define ADD_(r0,r1) AGR(r0,r1)
# define ADDI_(r0,i0) AGHI(r0,i0)
# define ADDC_(r0,r1) ALGR(r0,r1)
# define ADDX_(r0,r1) ALCGR(r0,r1)
# define AND_(r0,r1) NGR(r0,r1)
# define CMP_(r0,r1) CGR(r0,r1)
# define CMPU_(r0,r1) CLGR(r0,r1)
# define DIVREM_(r0,r1) DSGR(r0,r1)
# define DIVREMU_(r0,r1) DLGR(r0,r1)
# define MUL_(r0,r1) MSGR(r0,r1)
# define MULI_(r0,i0) MGHI(r0,i0)
# define MULU_(r0,r1) MLGR(r0,r1)
# define OR_(r0,r1) OGR(r0,r1)
# define SUB_(r0,r1) SGR(r0,r1)
# define SUBC_(r0,r1) SLGR(r0,r1)
# define SUBX_(r0,r1) SLBGR(r0,r1)
# define TEST_(r0,r1) LTGR(r0,r1)
# define XOR_(r0,r1) XGR(r0,r1)
# endif
/****************************************************************
* General Instructions *
****************************************************************/
/* ADD */
# define AR(R1,R2) RR_(0x1A,R1,R2)
# define AGR(R1,R2) RRE_(0xB908,R1,R2)
# define AGFR(R1,R2) RRE_(0xB918,R1,R2)
# define A(R1,D2,X2,B2) RX_(0x5A,R1,X2,B2,D2)
# define AY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x5A)
# define AG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x08)
# define AGF(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x18)
/* ADD HALFWORD */
# define AH(R1,D2,X2,B2) RX_(0x4A,R1,X2,B2,D2)
# define AHY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x7A)
/* ADD HALFWORD IMMEDIATE */
# define AHI(R1,I2) RI_(0xA7,R1,0xA,I2)
# define AGHI(R1,I2) RI_(0xA7,R1,0xB,I2)
/* ADD LOGICAL */
# define ALR(R1,R2) RR_(0x1E,R1,R2)
# define ALGR(R1,R2) RRE_(0xB90A,R1,R2)
# define ALGFR(R1,R2) RRE_(0xB91A,R1,R2)
# define AL(R1,D2,X2,B2) RX_(0x5E,R1,X2,B2,D2)
# define ALY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x5E)
# define ALG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x0A)
# define ALGF(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x1A)
/* ADD LOGICAL WITH CARRY */
# define ALCR(R1,R2) RRE_(0xB998,R1,R2)
# define ALCGR(R1,R2) RRE_(0xB988,R1,R2)
# define ALC(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x98)
# define ALCG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x88)
/* AND */
# define NR(R1,R2) RR_(0x14,R1,R2)
# define NGR(R1,R2) RRE_(0xB980,R1,R2)
# define N(R1,D2,X2,B2) RX_(0x54,R1,X2,B2,D2)
# define NY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x54)
# define NG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x80)
# define NI(D1,B1,I2) SI_(0x94,I2,B1,D1)
# define NIY(D1,B1,I2) SIY_(0xEB,I2,B1,D1,0x54)
# define NC(D1,L,B1,D2,B2) SSL_(0xD4,L,B1,D1,B2,D2)
/* AND IMMEDIATE */
# define NIHH(R1,I2) RI_(0xA5,R1,0x4,I2)
# define NIHL(R1,I2) RI_(0xA5,R1,0x5,I2)
# define NILH(R1,I2) RI_(0xA5,R1,0x6,I2)
# define NILL(R1,I2) RI_(0xA5,R1,0x7,I2)
/* BRANCH AND LINK */
# define BALR(R1,R2) RR_(0x05,R1,R2)
# define BAL(R1,D2,X2,B2) RX_(0x45,R1,X2,B2,D2)
/* BRANCH AND SAVE */
# define BASR(R1,R2) RR_(0x0D,R1,R2)
# define BAS(R1,D2,X2,B2) RX_(0x4D,R1,X2,B2,D2)
/* BRANCH AND SAVE AND SET MODE */
# define BASSM(R1,R2) RR_(0x0C,R1,R2)
/* BRANCH AND SET MODE */
# define BSM(R1,R2) RR_(0x0B,R1,R2)
/* BRANCH ON CONDITION */
# define BCR(M1,R2) RR_(0x07,M1,R2)
# define BR(R2) BCR(CC_AL,R2)
# define NOPR(R2) BCR(CC_NV,R2)
# define BC(M1,D2,X2,B2) RX_(0x47,M1,X2,B2,D2)
/* BRANCH ON COUNT */
# define BCTR(R1,R2) RR_(0x06,R1,R2)
# define BCTGR(R1,R2) RRE_(0xB946,R1,R2)
# define BCT(R1,D2,X2,B2) RX_(0x46,R1,X2,B2,D2)
# define BCTG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x46)
/* BRANCH ON INDEX HIGH */
# define BXH(R1,R3,D2,B2) RS_(0x86,R1,R3,B2,D2)
# define BXHG(R1,R3,B2,D2) RSY_(0xEB,R1,R3,B2,D2,0x44)
/* BRANCH ON INDEX LOW OR EQUAL */
# define BXLE(R1,R3,D2,B2) RS_(0x87,R1,R3,B2,D2)
# define BXLEG(R1,R3,B2,D2) RSY_(0xEB,R1,R3,B2,D2,0x45)
/* BRANCH RELATIVE AND SAVE */
# define BRAS(R1,I2) RI_(0xA7,R1,0x5,I2)
/* BRANCH RELATIVE AND SAVE LONG */
# define BRASL(R1,I2) RIL_(0xC0,R1,0x5,I2)
/* BRANCH RELATIVE ON CONDITION */
# define BRC(M1,I2) RI_(0xA7,M1,0x4,I2)
# define J(I2) BRC(CC_AL,I2)
/* BRANCH RELATIVE ON CONDITION LONG */
# define BRCL(M1,I2) RIL_(0xC0,M1,0x4,I2)
# define BRL(I2) BRCL(CC_AL,I2)
/* BRANCH RELATIVE ON COUNT */
# define BRCT(M1,I2) RI_(0xA7,M1,0x6,I2)
# define BRCTG(M1,I2) RI_(0xA7,M1,0x7,I2)
/* BRANCH RELATIVE ON INDEX HIGH */
# define BRXH(R1,R3,I2) RSI_(0x84,R1,R3,I2)
# define BRXHG(R1,R3,I2) RIE_(0xEC,R1,R3,I2,0x44)
/* BRANCH RELATIVE ON INDEX LOW OR EQUAL */
# define BRXLE(R1,R3,I2) RSI_(0x85,R1,R3,I2)
# define BRXLEG(R1,R3,I2) RIE_(0xEC,R1,R3,I2,0x45)
/* CHECKSUM */
# define CKSUM(R1,R2) RRE_(0xB241,R1,R2)
/* CIPHER MESAGE (KM) */
# define KM(R1,R2) RRE_(0xB92E,R1,R2)
/* CIPHER MESAGE WITH CHAINING (KMC) */
# define KMC(R1,R2) RRE_(0xB92F,R1,R2)
/* COMPARE */
# define CR(R1,R2) RR_(0x19,R1,R2)
# define CGR(R1,R2) RRE_(0xB920,R1,R2)
# define CGFR(R1,R2) RRE_(0xB930,R1,R2)
# define C(R1,D2,X2,B2) RX_(0x59,R1,X2,B2,D2)
# define CY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x59)
# define CG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x20)
# define CGF(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x30)
/* COMPARE AND FORM CODEWORD */
# define CFC(D2,B2) S_(0xB21A,B2,D2)
/* COMPARE AND SWAP */
# define CS(R1,R3,D2,B2) RS_(0xBA,R1,R3,B2,D2)
# define CSY(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x14)
# define CSG(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x30)
/* COMPARE DOUBLE AND SWAP */
# define CDS(R1,R3,D2,B2) RS_(0xBB,R1,R3,B2,D2)
# define CSDY(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x31)
# define CSDG(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x3E)
/* COMPARE HALFWORD */
# define CH(R1,D2,X2,B2) RX_(0x49,R1,X2,B2,D2)
# define CHY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x79)
/* COMPARE HALFWORD IMMEDIATE */
# define CHI(R1,I2) RI_(0xA7,R1,0xE,I2)
# define CGHI(R1,I2) RI_(0xA7,R1,0xF,I2)
/* COMPARE LOGICAL */
# define CLR(R1,R2) RR_(0x15,R1,R2)
# define CLGR(R1,R2) RRE_(0xB921,R1,R2)
# define CLGFR(R1,R2) RRE_(0xB931,R1,R2)
# define CL(R1,D2,X2,B2) RX_(0x55,R1,X2,B2,D2)
# define CLY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x55)
# define CLG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x21)
# define CLGF(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x31)
# define CLI(D1,B1,I2) SI_(0x95,I2,B1,D1)
# define CLIY(D1,B1,I2) SIY_(0xEB,I2,B1,D1,0x55)
# define CLC(D1,L,B1,D2,B2) SSL_(0xD5,L,B1,D1,B2,D2)
/* COMPARE LOGICAL CHARACTERS UNDER MASK */
# define CLM(R1,M3,D2,B2) RS_(0xBD,R1,M3,B2,D2)
# define CLMY(R1,M3,D2,B2) RSY_(0xEB,R1,M3,B2,D2,0x21)
# define CLMH(R1,M3,D2,B2) RSY_(0xEB,R1,M3,B2,D2,0x20)
/* COMPARE LOGICAL LONG */
# define CLCL(R1,R2) RR_(0x0F,R1,R2)
/* COMPARE LOGICAL LONG EXTENDED */
# define CLCLE(R1,R3,D2,B2) RS_(0xA9,R1,R3,B2,D2)
/* COMPARE LOGICAL LONG UNICODE */
# define CLCLU(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x8F)
/* COMPARE LOGICAL STRING */
# define CLST(R1,R2) RRE_(0xB25D,R1,R2)
/* COMPARE UNTIL SUBSTRING EQUAL */
# define CUSE(R1,R2) RRE_(0xB257,R1,R2)
/* COMPRESSION CALL */
# define CMPSC(R1,R2) RRE_(0xB263,R1,R2)
/* COMPUTE INTERMEDIATE MESSAGE DIGEST (KIMD) */
# define KIMD(R1,R2) RRE_(0xB93E,R1,R2)
/* COMPUTE LAST MESSAGE DIGEST (KIMD) */
# define KLMD(R1,R2) RRE_(0xB93F,R1,R2)
/* COMPUTE MESSAGE AUTHENTICATION CODE (KMAC) */
# define KMAC(R1,R2) RRE_(0xB91E,R1,R2)
/* CONVERT TO BINARY */
# define CVB(R1,D2,X2,B2) RX_(0x4F,R1,X2,B2,D2)
# define CVBY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x06)
# define CVBG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x0e)
/* CONVERT TO DECIMAL */
# define CVD(R1,D2,X2,B2) RX_(0x4E,R1,X2,B2,D2)
# define CVDY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x26)
# define CVDG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x2E)
/* CONVERT UNICODE TO UTF-8 */
# define CUUTF(R1,R2) RRE_(0xB2A6,R1,R2)
/* CONVERT UTF-8 TO UNICODE */
# define CUTFU(R1,R2) RRE_(0xB2A7,R1,R2)
/* COPY ACCESS */
# define CPYA(R1,R2) RRE_(0xB24D,R1,R2)
/* DIVIDE */
# define DR(R1,R2) RR_(0x1D,R1,R2)
# define D(R1,D2,X2,B2) RX_(0x5D,R1,X2,B2,D2)
/* DIVIDE LOGICAL */
# define DLR(R1,R2) RRE_(0xB997,R1,R2)
# define DLGR(R1,R2) RRE_(0xB987,R1,R2)
# define DL(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x97)
# define DLG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x87)
/* DIVIDE SINGLE */
# define DSGR(R1,R2) RRE_(0xB90D,R1,R2)
# define DSGFR(R1,R2) RRE_(0xB91D,R1,R2)
# define DSG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x0D)
# define DSGF(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x1D)
/* EXCLUSIVE OR */
# define XR(R1,R2) RR_(0x17,R1,R2)
# define XGR(R1,R2) RRE_(0xB982,R1,R2)
# define X(R1,D2,X2,B2) RX_(0x57,R1,X2,B2,D2)
# define XY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x57)
# define XG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x82)
# define XI(D1,B1,I2) SI_(0x97,I2,B1,D1)
# define XIY(D1,B1,I2) SIY_(0xEB,I2,B1,D1,0x57)
# define XC(D1,L,B1,D2,B2) SSL_(0xD7,L,B1,D1,B2,D2)
/* EXECUTE */
# define EX(R1,D2,X2,B2) RX_(0x44,R1,X2,B2,D2)
/* EXTRACT ACCESS */
# define EAR(R1,R2) RRE_(0xB24F,R1,R2)
/* EXTRACT PSW */
# define EPSW(R1,R2) RRE_(0xB98D,R1,R2)
/* INSERT CHARACTER */
# define IC(R1,D2,X2,B2) RX_(0x43,R1,X2,B2,D2)
# define ICY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x73)
/* INSERT CHARACTERS UNDER MASK */
# define ICM(R1,M3,D2,B2) RS_(0xBF,R1,M3,B2,D2)
# define ICMY(R1,M3,D2,B2) RSY_(0xEB,R1,M3,B2,D2,0x81)
# define ICMH(R1,M3,D2,B2) RSY_(0xEB,R1,M3,B2,D2,0x80)
/* INSERT IMMEDIATE */
# define IIHH(R1,I2) RI_(0xA5,R1,0x0,I2)
# define IIHL(R1,I2) RI_(0xA5,R1,0x1,I2)
# define IILH(R1,I2) RI_(0xA5,R1,0x2,I2)
# define IILL(R1,I2) RI_(0xA5,R1,0x3,I2)
/* INSERT PROGRAM MASK */
# define IPM(R1) RRE_(0xB222,R1,0)
/* LOAD */
# define LR(R1,R2) RR_(0x18,R1,R2)
# define LGR(R1,R2) RRE_(0xB904,R1,R2)
# define LGFR(R1,R2) RRE_(0xB914,R1,R2)
# define L(R1,D2,X2,B2) RX_(0x58,R1,X2,B2,D2)
# define LY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x58)
# define LG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x04)
# define LGF(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x14)
/* LOAD ACCESS MULTIPLE */
# define LAM(R1,R3,D2,B2) RS_(0x9A,R1,R3,B2,D2)
# define LAMY(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x9A)
/* LOAD ADDRESS */
# define LA(R1,D2,X2,B2) RX_(0x41,R1,X2,B2,D2)
# define LAY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x71)
/* LOAD ADDRESS EXTENDED */
# define LAE(R1,D2,X2,B2) RX_(0x51,R1,X2,B2,D2)
/* LOAD ADDRESS RELATIVE LONG */
# define LARL(R1,I2) RIL_(0xC0,R1,0x0,I2)
/* LOAD AND TEST */
# define LTR(R1,R2) RR_(0x12,R1,R2)
# define LTGR(R1,R2) RRE_(0xB902,R1,R2)
# define LTGFR(R1,R2) RRE_(0xB912,R1,R2)
/* LOAD BYTE */
# define LGBR(R1,R2) RRE_(0xB906,R1,R2) /* disasm */
# define LB(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x76)
# define LGB(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x77)
/* LOAD COMPLEMENT */
# define LCR(R1,R2) RR_(0x13,R1,R2)
# define LCGR(R1,R2) RRE_(0xB903,R1,R2)
# define LCGFR(R1,R2) RRE_(0xB913,R1,R2)
/* LOAD HALFWORD */
# define LH(R1,D2,X2,B2) RX_(0x48,R1,X2,B2,D2)
# define LHY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x78)
# define LGHR(R1,R2) RRE_(0xB907,R1,R2) /* disasm */
# define LGH(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x15)
/* LOAD HALFWORD IMMEDIATE */
# define LHI(R1,I2) RI_(0xA7,R1,0x8,I2)
# define LGHI(R1,I2) RI_(0xA7,R1,0x9,I2)
/* LOAD LOGICAL */
# define LLGFR(R1,R2) RRE_(0xB916,R1,R2)
# define LLGF(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x16)
/* LOAD LOGICAL CHARACTER */
# define LLGCR(R1,R2) RRE_(0xB984,R1,R2) /* disasm */
# define LLGC(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x90)
/* LOAD LOGICAL HALFWORD */
# define LLGHR(R1,R2) RRE_(0xB985,R1,R2) /* disasm */
# define LLGH(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x91)
/* LOAD LOGICAL IMMEDIATE */
# define LLIHH(R1,I2) RI_(0xA5,R1,0xC,I2)
# define LLIHL(R1,I2) RI_(0xA5,R1,0xD,I2)
# define LLILH(R1,I2) RI_(0xA5,R1,0xE,I2)
# define LLILL(R1,I2) RI_(0xA5,R1,0xF,I2)
/* LOAD LOGICAL THIRTY ONE BITS */
# define LLGTR(R1,R2) RRE_(0xB917,R1,R2)
# define LLGT(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x17)
/* LOAD MULTIPLE */
# define LM(R1,R3,D2,B2) RS_(0x98,R1,R3,B2,D2)
# define LMY(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x98)
# define LMG(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x04)
/* LOAD MULTIPLE DISJOINT */
# define LMD(R1,R3,D2,B2,D4,B4) SS_(0xEF,R1,R3,B2,D2,B4,D4)
/* LOAD MULTIPLE HIGH */
# define LMH(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x96)
/* LOAD NEGATIVE */
# define LNR(R1,R2) RR_(0x11,R1,R2)
# define LNGR(R1,R2) RRE_(0xB901,R1,R2)
# define LNGFR(R1,R2) RRE_(0xB911,R1,R2)
/* LOAD PAIR FROM QUADWORD */
# define LPQ(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x8F)
/* LOAD POSITIVE */
# define LPR(R1,R2) RR_(0x10,R1,R2)
# define LPGR(R1,R2) RRE_(0xB900,R1,R2)
# define LPGFR(R1,R2) RRE_(0xB910,R1,R2)
/* LOAD REVERSED */
# define LRVR(R1,R2) RRE_(0xB91F,R1,R2)
# define LRVGR(R1,R2) RRE_(0xB90F,R1,R2)
# define LRVH(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x1F)
# define LRV(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x1E)
# define LRVG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x0F)
/* MONITOR CALL */
# define MC(D1,B1,I2) SI_(0xAF,I2,B1,D1)
/* MOVE */
# define MVI(D1,B1,I2) SI_(0x92,I2,B1,D1)
# define MVIY(D1,B1,I2) SIY_(0xEB,I2,B1,D1,0x52)
# define MVC(D1,L,B1,D2,B2) SSL_(0xD2,L,B1,D1,B2,D2)
/* MOVE INVERSE */
# define MVCIN(D1,L,B1,D2,B2) SSL_(0xE8,L,B1,D1,B2,D2)
/* MOVE LONG */
# define MVCL(R1,R2) RR_(0x0E,R1,R2)
/* MOVE LONG EXTENDED */
# define MVCLE(R1,R3,D2,B2) RS_(0xA8,R1,R3,B2,D2)
/* MOVE LONG UNICODE */
# define MVCLU(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x8E)
/* MOVE NUMERICS */
# define MVN(D1,L,B1,D2,B2) SSL_(0xD1,L,B1,D1,B2,D2)
/* MOVE STRING */
# define MVST(R1,R2) RRE_(0xB255,R1,R2)
/* MOVE WITH OFFSET */
# define MVO(D1,L1,B1,D2,L2,B2) SS_(0xF1,L1,L2,B1,D1,B2,D2)
/* MOVE ZONES */
# define MVZ(D1,L,B1,D2,B2) SSL_(0xD3,L,B1,D1,B2,D2)
/* MULTIPLY */
# define MR(R1,R2) RR_(0x1C,R1,R2)
# define M(R1,D2,X2,B2) RX_(0x5C,R1,X2,B2,D2)
/* MULTIPLY HALFWORD */
# define MH(R1,D2,X2,B2) RX_(0x4C,R1,X2,B2,D2)
/* MULTIPLY HALFWORD IMMEDIATE */
# define MHI(R1,I2) RI_(0xA7,R1,0xC,I2)
# define MGHI(R1,I2) RI_(0xA7,R1,0xD,I2)
/* MULTIPLY LOGICAL */
# define MLR(R1,R2) RRE_(0xB996,R1,R2)
# define MLGR(R1,R2) RRE_(0xB986,R1,R2)
# define ML(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x96)
# define MLG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x86)
/* MULTIPLY SINGLE */
# define MSR(R1,R2) RRE_(0xB252,R1,R2)
# define MSGR(R1,R2) RRE_(0xB90C,R1,R2)
# define MSGFR(R1,R2) RRE_(0xB91C,R1,R2)
# define MS(R1,D2,X2,B2) RX_(0x71,R1,X2,B2,D2)
# define MSY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x51)
# define MSG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x0C)
# define MSGF(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x1C)
/* OR */
# define OR(R1,R2) RR_(0x16,R1,R2)
# define OGR(R1,R2) RRE_(0xB981,R1,R2)
# define O(R1,D2,X2,B2) RX_(0x56,R1,X2,B2,D2)
# define OY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x56)
# define OG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x81)
# define OI(D1,B1,I2) SI_(0x96,I2,B1,D1)
# define OIY(D1,B1,I2) SIY_(0xEB,I2,B1,D1,0x56)
# define OC(D1,L,B1,D2,B2) SSL_(0xD6,L,B1,D1,B2,D2)
/* OR IMMEDIATE */
# define OIHH(R1,I2) RI_(0xA5,R1,0x8,I2)
# define OIHL(R1,I2) RI_(0xA5,R1,0x9,I2)
# define OILH(R1,I2) RI_(0xA5,R1,0xA,I2)
# define OILL(R1,I2) RI_(0xA5,R1,0xB,I2)
/* PACK */
# define PACK(D1,L1,B1,D2,L2,B2) SS_(0xF2,L1,L2,B1,D1,B2,D2)
/* PACK ASCII */
# define PKA(D1,B1,D2,L2,B2) SSL_(0xE9,L2,B1,D1,B2,D2)
/* PACK UNICODE */
# define PKU(D1,B1,D2,L2,B2) SSL_(0xE1,L2,B1,D1,B2,D2)
/* PERFORM LOCKED OPERATION */
# define PLO(R1,D2,B2,R3,D4,B4) SS_(0xEE,R1,R3,B2,D2,B4,D4)
/* ROTATE LEFT SINGLE LOGICAL */
# define RLL(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x1D)
# define RLLG(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x1C)
/* SEARCH STRING */
# define SRST(R1,R2) RRE_(0xB25E,R1,R2)
/* SET ACCESS */
# define SAR(R1,R2) RRE_(0xB24E,R1,R2)
/* SET ADDRESSING MODE */
# define SAM24() E_(0x10C)
# define SAM31() E_(0x10D)
# define SAM64() E_(0x10E)
/* SET PROGRAM MASK */
# define SPM(R1) RR_(0x04,R1,0)
/* SHIFT LEFT DOUBLE */
# define SLDA(R1,D2,B2) RS_(0x8F,R1,0,B2,D2)
/* SHIFT LEFT DOUBLE LOGICAL */
# define SLDL(R1,D2,B2) RS_(0x8D,R1,0,B2,D2)
/* SHIFT LEFT SINGLE */
# define SLA(R1,D2,B2) RS_(0x8B,R1,0,B2,D2)
# define SLAG(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x0B)
/* SHIFT LEFT SINGLE LOGICAL */
# define SLL(R1,D2,B2) RS_(0x89,R1,0,B2,D2)
# define SLLG(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x0D)
/* SHIFT RIGHT DOUBLE */
# define SRDA(R1,D2,B2) RS_(0x8E,R1,0,B2,D2)
/* SHIFT RIGHT DOUBLE LOGICAL */
# define SRDL(R1,D2,B2) RS_(0x8C,R1,0,B2,D2)
/* SHIFT RIGHT SINGLE */
# define SRA(R1,D2,B2) RS_(0x8A,R1,0,B2,D2)
# define SRAG(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x0A)
/* SHIFT RIGHT SINGLE LOGICAL */
# define SRL(R1,D2,B2) RS_(0x88,R1,0,B2,D2)
# define SRLG(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x0C)
/* STORE */
# define ST(R1,D2,X2,B2) RX_(0x50,R1,X2,B2,D2)
# define STY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x50)
# define STG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x24)
/* STORE ACCESS MULTIPLE */
# define STAM(R1,R3,D2,B2) RS_(0x9B,R1,R3,B2,D2)
# define STAMY(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x9B)
/* STORE CHARACTER */
# define STC(R1,D2,X2,B2) RX_(0x42,R1,X2,B2,D2)
# define STCY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x72)
/* STORE CHARACTERS UNDER MASK */
# define STCM(R1,M3,D2,B2) RS_(0xBE,R1,M3,B2,D2)
# define STCMY(R1,M3,D2,B2) RSY_(0xEB,R1,M3,B2,D2,0x2D)
# define STCMH(R1,M3,D2,B2) RSY_(0xEB,R1,M3,B2,D2,0x2C)
/* STORE CLOCK */
# define STCK(D2,B2) S_(0xB205,B2,D2)
/* STORE CLOCK EXTENDED */
# define STCKE(D2,B2) S_(0xB278,B2,D2)
/* STORE HALFWORD */
# define STH(R1,D2,X2,B2) RX_(0x40,R1,X2,B2,D2)
# define STHY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x70)
/* STORE MULTIPLE */
# define STM(R1,R3,D2,B2) RS_(0x90,R1,R3,B2,D2)
# define STMY(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x90)
# define STMG(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x24)
/* STORE MULTIPLE HIGH */
# define STMH(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x26)
/* STORE PAIR TO QUADWORD */
# define STPQ(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x8E)
/* STORE REVERSED */
# define STRVH(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x3F)
# define STRV(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x3E)
# define STRVG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x2F)
/* SUBTRACT */
# define SR(R1,R2) RR_(0x1B,R1,R2)
# define SGR(R1,R2) RRE_(0xB909,R1,R2)
# define SGFR(R1,R2) RRE_(0xB919,R1,R2)
# define S(R1,D2,X2,B2) RX_(0x5B,R1,X2,B2,D2)
# define SY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x5B)
# define SG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x09)
# define SGF(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x19)
/* SUBTRACT HALFWORD */
# define SH(R1,D2,X2,B2) RX_(0x4B,R1,X2,B2,D2)
# define SHY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x7B)
/* SUBTRACT LOGICAL */
# define SLR(R1,R2) RR_(0x1F,R1,R2)
# define SLGR(R1,R2) RRE_(0xB90B,R1,R2)
# define SLGFR(R1,R2) RRE_(0xB91B,R1,R2)
# define SL(R1,D2,X2,B2) RX_(0x5F,R1,X2,B2,D2)
# define SLY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x5F)
# define SLG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x0B)
# define SLGF(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x1B)
/* SUBTRACT LOGICAL WITH BORROW */
# define SLBR(R1,R2) RRE_(0xB999,R1,R2)
# define SLBGR(R1,R2) RRE_(0xB989,R1,R2)
# define SLB(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x99)
# define SLBG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x89)
/* SUPERVISOR CALL */
# define SVC(I) I_(0xA,I)
/* TEST ADDRESSING MODE */
# define TAM() E_(0x10B)
/* TEST AND SET */
# define TS(D2,B2) RS_(0x93,0,0,B2,D2)
/* TEST UNDER MASK (TEST UNDER MASK HIGH, TEST UNDER MASK LOW) */
# define TM(D1,B1,I2) SI_(0x91,I2,B1,D1)
# define TMY(D1,B1,I2) SIY_(0xEB,I2,B1,D1,0x51)
# define TMHH(R1,I2) RI_(0xA7,R1,0x2,I2)
# define TMHL(R1,I2) RI_(0xA7,R1,0x3,I2)
# define TMLH(R1,I2) RI_(0xA7,R1,0x0,I2)
# define TMH(R1,I2) TMLH(R1,I2)
# define TMLL(R1,I2) RI_(0xA7,R1,0x1,I2)
# define TML(R1,I2) TMLL(R1,I2)
/* TRANSLATE */
# define TR(D1,L,B1,D2,B2) SSL_(0xDC,L,B1,D1,B2,D2)
/* TRANSLATE AND TEST */
# define TRT(D1,L,B1,D2,B2) SSL_(0xDD,L,B1,D1,B2,D2)
/* TRANSLATE EXTENDED */
# define TRE(R1,R2) RRE_(0xB2A5,R1,R2)
/* TRANSLATE ONE TO ONE */
# define TROO(R1,R2) RRE_(0xB993,R1,R2)
/* TRANSLATE ONE TO TWO */
# define TROT(R1,R2) RRE_(0xB992,R1,R2)
/* TRANSLATE TWO TO ONE */
# define TRTO(R1,R2) RRE_(0xB991,R1,R2)
/* TRANSLATE TWO TO TWO */
# define TRTT(R1,R2) RRE_(0xB990,R1,R2)
/* UNPACK */
# define UNPK(D1,L1,B1,D2,L2,B2) SS_(0xF3,L1,L2,B1,D1,B2,D2)
/* UNPACK ASCII */
# define UNPKA(D1,L1,B1,D2,L2,B2) SS_(0xEA,L1,L2,B1,D1,B2,D2)
/* UNPACK UNICODE */
# define UNPKU(D1,L1,B1,D2,L2,B2) SS_(0xE2,L1,L2,B1,D1,B2,D2)
/* UPDATE TREE */
# define UPT() E_(0x0102)
/****************************************************************
* Decimal Instructions *
****************************************************************/
/* ADD DECIMAL */
# define AP(D1,L1,B1,D2,L2,B2) SS_(0xFA,L1,L2,B1,D1,B2,D2)
/* COMPARE DECIMAL */
# define CP(D1,L1,B1,D2,L2,B2) SS_(0xF9,L1,L2,B1,D1,B2,D2)
/* DIVIDE DECIMAL */
# define DP(D1,L1,B1,D2,L2,B2) SS_(0xFD,L1,L2,B1,D1,B2,D2)
/* EDIT */
# define ED(D1,L,B1,D2,B2) SSL_(0xDE,L,B1,D1,B2,D2)
/* EDIT AND MARK */
# define EDMK(D1,L,B1,D2,B2) SSL_(0xDE,L,B1,D1,B2,D2)
/* MULTIPLY DECIMAL */
# define MP(D1,L1,B1,D2,L2,B2) SS_(0xFC,L1,L2,B1,D1,B2,D2)
/* SHIFT AND ROUND DECIMAL */
# define SRP(D1,L1,B1,D2,L2,B2) SS_(0xF0,L1,L2,B1,D1,B2,D2)
/* SUBTRACE DECIMAL */
# define SP(D1,L1,B1,D2,L2,B2) SS_(0xFB,L1,L2,B1,D1,B2,D2)
/* TEST DECIMAL */
# define TP(D1,L1,B1) RSL_(0xEB,L1,B1,D1,0xC0)
/* ZERO AND ADD */
# define ZAP(D1,L1,B1,D2,L2,B2) SS_(0xF8,L1,L2,B1,D1,B2,D2)
/****************************************************************
* Control Instructions *
****************************************************************/
/* BRANCH AND SET AUTHORITY */
# define BSA(R1,R2) RRE_(0xB25A,R1,R2)
/* BRANCH AND STACK */
# define BAKR(R1,R2) RRE_(0xB240,R1,R2)
/* BRANCH IN SUBSPACE GROUP */
# define BSG(R1,R2) RRE_(0xB258,R1,R2)
/* COMPARE AND SWAP AND PURGE */
# define CSP(R1,R2) RRE_(0xB250,R1,R2)
# define CSPG(R1,R2) RRE_(0xB98A,R1,R2)
/* DIAGNOSE */
# define DIAG() SI_(0x83,0,0,0)
/* EXTRACT AND SET EXTENDED AUTHORITY */
# define ESEA(R1) RRE_(0xB99D,R1,0)
/* EXTRACT PRIMARY ASN */
# define EPAR(R1) RRE_(0xB226,R1,0)
/* EXTRACT SECONDARY ASN */
# define ESAR(R1) RRE_(0xB227,R1,0)
/* EXTRACT STACKED REGISTERS */
# define EREG(R1,R2) RRE_(0xB249,R1,R2)
# define EREGG(R1,R2) RRE_(0xB90E,R1,R2)
/* EXTRACT STACKED STATE */
# define ESTA(R1,R2) RRE_(0xB24A,R1,R2)
/* INSERT ADDRESS SPACE CONTROL */
# define IAC(R1) RRE_(0xB224,R1,0)
/* INSERT PSW KEY */
# define IPK() S_(0xB20B,0,0)
/* INSERT STORAGE KEY EXTENDED */
# define ISKE(R1,R2) RRE_(0xB229,R1,R2)
/* INSERT VIRTUAL STORAGE KEY */
# define IVSK(R1,R2) RRE_(0xB223,R1,R2)
/* INVALIDATE DAT TABLE ENTRY */
# define IDTE(R1,R2,R3) RRF_(0xB98E,R3,0,R1,R2)
/* INVALIDATE PAGE TABLE ENTRY */
# define IPTE(R1,R2) RRE_(0xB221,R1,R2)
/* LOAD ADDRESS SPACE PARAMETER */
# define LASP(D1,B1,D2,B2) SSE_(0xE500,B1,D1,B2,D2)
/* LOAD CONTROL */
# define LCTL(R1,R3,D2,B2) RS_(0xB7,R1,R3,B2,D2)
# define LCTLG(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x2F)
/* LOAD PSW */
# define LPSW(D2,B2) SI_(0x82,0,B2,D2)
/* LOAD PSW EXTENDED */
# define LPSWE(D2,B2) S_(0xB2B2,B2,D2)
/* LOAD REAL ADDRESS */
# define LRA(R1,D2,X2,B2) RX_(0xB1,R1,X2,B2,D2)
# define LRAY(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x13)
# define LRAG(R1,D2,X2,B2) RXY_(0xE3,R1,X2,B2,D2,0x03)
/* LOAD USING REAL ADDRESS */
# define LURA(R1,R2) RRE_(0xB24B,R1,R2)
# define LURAG(R1,R2) RRE_(0xB905,R1,R2)
/* MODIFY STACKED STATE */
# define MSTA(R1) RRE_(0xB247,R1,0)
/* MOVE PAGE */
# define MVPG(R1,R2) RRE_(0xB254,R1,R2)
/* MOVE TO PRIMARY */
# define MVCP(D1,R1,B1,D2,B2,R3) SS_(0xDA,R1,R3,B1,D1,B2,D2)
/* MOVE TO SECONDARY */
# define MVCS(D1,R1,B1,D2,B2,R3) SS_(0xDB,R1,R3,B1,D1,B2,D2)
/* MOVE WITH DESTINATION KEY */
# define MVCDK(D1,B1,D2,B2) SSE_(0xE50F,B1,D1,B2,D2)
/* MOVE WITH KEY */
# define MVCK(D1,R1,B1,D2,B2,R3) SS_(0xD9,R1,R3,B1,D1,B2,D2)
/* MOVE WITH SOURCE KEY */
# define MVCSK(D1,B1,D2,B2) SSE_(0xE50E,B1,D1,B2,D2)
/* PAGE IN */
# define PGIN(R1,R2) RRE_(0xB22E,R1,R2)
/* PAGE OUT */
# define PGOUT(R1,R2) RRE_(0xB22F,R1,R2)
/* PROGRAM CALL */
# define PC(D2,B2) S_(0xB218,B2,D2)
/* PROGRAM RETURN */
# define PR() E_(0x0101)
/* PROGRAM TRANSFER */
# define PT(R1,R2) RRE_(0xB228,R1,R2)
/* PURGE ALB */
# define PALB() RRE_(0xB248,0,0)
/* PURGE TLB */
# define PTLB() S_(0xB20D,0,0)
/* RESET REFERENCE BIT EXTENDED */
# define RRBE(R1,R2) RRE_(0xB22A,R1,R2)
/* RESUME PROGRAM */
# define RP(D2,B2) S_(0xB277,B2,D2)
/* SET ADDRESS SPACE CONTROL */
# define SAC(D2,B2) S_(0xB219,B2,D2)
/* SET ADDRESS SPACE CONTROL FAST */
# define SACF(D2,B2) S_(0xB279,B2,D2)
/* SET CLOCK */
# define SCK(D2,B2) S_(0xB204,B2,D2)
/* SET CLOCK COMPARATOR */
# define SCKC(D2,B2) S_(0xB206,B2,D2)
/* SET CLOCK PROGRAMMABLE FIELD */
# define SCKPF() E_(0x0107)
/* SET CPU TIMER */
# define SPT(D2,B2) S_(0xB208,B2,D2)
/* SET PREFIX */
# define SPX(D2,B2) S_(0xB210,B2,D2)
/* SET PSW FROM ADDRESS */
# define SPKA(D2,B2) S_(0xB20A,B2,D2)
/* SET SECONDARY ASN */
# define SSAR(R1) RRE_(0xB225,R1,0)
/* SET STORAGE KEY EXTENDED */
# define SSKE(R1,R2) RRE_(0xB22B,R1,R2)
/* SET SYSTEM MASK */
# define SSM(D2,B2) SI_(0x80,0,B2,D2)
/* SIGNAL PROCESSOR */
# define SIGP(R1,R3,D2,B2) RS_(0xAE,R1,R3,B2,D2)
/* STORE CLOCK COMPARATOR */
# define STCKC(D2,B2) S_(0xB207,B2,D2)
/* STORE CONTROL */
# define STCTL(R1,R3,D2,B2) RS_(0xB6,R1,R3,B2,D2)
# define STCTG(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x25)
/* STORE CPU ADDRESS */
# define STAP(D2,B2) S_(0xB212,B2,D2)
/* STORE CPU ID */
# define STIDP(D2,B2) S_(0xB202,B2,D2)
/* STORE CPU TIMER */
# define STPT(D2,B2) S_(0xB209,B2,D2)
/* STORE FACILITY LIST */
# define STFL(D2,B2) S_(0xB2B1,B2,D2)
/* STORE PREFIX */
# define STPX(D2,B2) S_(0xB211,B2,D2)
/* STORE REAL ADDRES */
# define STRAG(D1,B1,D2,B2) SSE_(0xE502,B1,D1,B2,D2)
/* STORE SYSTEM INFORMATION */
# define STSI(D2,B2) S_(0xB27D,B2,D2)
/* STORE THEN AND SYSTEM MASK */
# define STNSM(D1,B1,I2) SI_(0xAC,I2,B1,D1)
/* STORE THEN OR SYSTEM MASK */
# define STOSM(D1,B1,I2) SI_(0xAD,I2,B1,D1)
/* STORE USING REAL ADDRESS */
# define STURA(R1,R2) RRE_(0xB246,R1,R2)
# define STURG(R1,R2) RRE_(0xB925,R1,R2)
/* TEST ACCESS */
# define TAR(R1,R2) RRE_(0xB24C,R1,R2)
/* TEST BLOCK */
# define TB(R1,R2) RRE_(0xB22C,R1,R2)
/* TEST PROTECTION */
# define TPROT(D1,B1,D2,B2) SSE_(0xE501,B1,D1,B2,D2)
/* TRACE */
# define TRACE(R1,R3,D2,B2) RS_(0x99,R1,R3,B2,D2)
# define TRACG(R1,R3,D2,B2) RSY_(0xEB,R1,R3,B2,D2,0x0F)
/* TRAP */
# define TRAP2() E_(0x01FF)
# define TRAP4(D2,B2) S_(0xB2FF,B2,D2)
/****************************************************************
* I/O Instructions *
****************************************************************/
/* CANCEL SUBCHANNEL */
# define XSCH() S_(0xB276,0,0)
/* CLEAR SUBCHANNEL */
# define CSCH() S_(0xB230,0,0)
/* HALT SUBCHANNEL */
# define HSCH() S_(0xB231,0,0)
/* MODIFY SUBCHANNEL */
# define MSCH(D2,B2) S_(0xB232,B2,D2)
/* RESET CHANNEL PATH */
# define RCHP() S_(0xB23B,0,0)
/* RESUME SUBCHANNEL */
# define RSCH() S_(0xB238,0,0)
/* SET ADDRESS LIMIT */
# define SAL() S_(0xB237,0,0)
/* SET CHANNEL MONITOR */
# define SCHM() S_(0xB23C,0,0)
/* START SUBCHANNEL */
# define SSCH(D2,B2) S_(0xB233,B2,D2)
/* STORE CHANNEL PATH STATUS */
# define STCPS(D2,B2) S_(0xB23A,B2,D2)
/* STORE CHANNEL REPORT WORD */
# define STCRW(D2,B2) S_(0xB239,B2,D2)
/* STORE SUBCHANNEL */
# define STSCH(D2,B2) S_(0xB234,B2,D2)
/* TEST PENDING INTERRUPTION */
# define TPI(D2,B2) S_(0xB236,B2,D2)
/* TEST SUBCHANNEL */
# define TSCH(D2,B2) S_(0xB235,B2,D2)
# define xdivr(r0,r1) _xdivr(_jit,r0,r1)
static jit_int32_t _xdivr(jit_state_t*,jit_int32_t,jit_int32_t);
# define xdivr_u(r0,r1) _xdivr_u(_jit,r0,r1)
static jit_int32_t _xdivr_u(jit_state_t*,jit_int32_t,jit_int32_t);
# define xdivi(r0,i0) _xdivi(_jit,r0,i0)
static jit_int32_t _xdivi(jit_state_t*,jit_int32_t,jit_word_t);
# define xdivi_u(r0,i0) _xdivi_u(_jit,r0,i0)
static jit_int32_t _xdivi_u(jit_state_t*,jit_int32_t,jit_word_t);
# define crr(cc,r0,r1,r2) _crr(_jit,cc,r0,r1,r2)
static void _crr(jit_state_t*,
jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t);
# define cri(cc,r0,r1,i0) _cri(_jit,cc,r0,r1,i0)
static void _cri(jit_state_t*,
jit_int32_t,jit_int32_t,jit_int32_t,jit_word_t);
# define crr_u(cc,r0,r1,r2) _crr_u(_jit,cc,r0,r1,r2)
static void _crr_u(jit_state_t*,
jit_int32_t,jit_int32_t,jit_int32_t,jit_int32_t);
# define cri_u(cc,r0,r1,i0) _cri_u(_jit,cc,r0,r1,i0)
static void _cri_u(jit_state_t*,
jit_int32_t,jit_int32_t,jit_int32_t,jit_word_t);
# define brr(cc,i0,r0,r1) _brr(_jit,cc,i0,r0,r1)
static void _brr(jit_state_t*,jit_int32_t,
jit_word_t,jit_int32_t,jit_int32_t);
# define brr_p(cc,i0,r0,r1) _brr_p(_jit,cc,i0,r0,r1)
static jit_word_t _brr_p(jit_state_t*,jit_int32_t,
jit_word_t,jit_int32_t,jit_int32_t);
# define bri(cc,i0,r0,i1) _bri(_jit,cc,i0,r0,i1)
static void _bri(jit_state_t*,jit_int32_t,
jit_word_t,jit_int32_t,jit_word_t);
# define bri_p(cc,i0,r0,i1) _bri_p(_jit,cc,i0,r0,i1)
static jit_word_t _bri_p(jit_state_t*,jit_int32_t,
jit_word_t,jit_int32_t,jit_word_t);
# define brr_u(cc,i0,r0,r1) _brr_u(_jit,cc,i0,r0,r1)
static void _brr_u(jit_state_t*,jit_int32_t,
jit_word_t,jit_int32_t,jit_int32_t);
# define brr_u_p(cc,i0,r0,r1) _brr_u_p(_jit,cc,i0,r0,r1)
static jit_word_t _brr_u_p(jit_state_t*,jit_int32_t,
jit_word_t,jit_int32_t,jit_int32_t);
# define bri_u(cc,i0,r0,i1) _bri_u(_jit,cc,i0,r0,i1)
static void _bri_u(jit_state_t*,jit_int32_t,
jit_word_t,jit_int32_t,jit_word_t);
# define bri_u_p(cc,i0,r0,i1) _bri_u_p(_jit,cc,i0,r0,i1)
static jit_word_t _bri_u_p(jit_state_t*,jit_int32_t,
jit_word_t,jit_int32_t,jit_word_t);
# define baddr(c,s,i0,r0,r1) _baddr(_jit,c,s,i0,r0,r1)
static void _baddr(jit_state_t*,jit_int32_t,jit_bool_t,
jit_word_t,jit_int32_t,jit_int32_t);
# define baddr_p(c,s,i0,r0,r1) _baddr_p(_jit,c,s,i0,r0,r1)
static jit_word_t _baddr_p(jit_state_t*,jit_int32_t,jit_bool_t,
jit_word_t,jit_int32_t,jit_int32_t);
# define baddi(c,s,i0,r0,i1) _baddi(_jit,c,s,i0,r0,i1)
static void _baddi(jit_state_t*,jit_int32_t,jit_bool_t,
jit_word_t,jit_int32_t,jit_word_t);
# define baddi_p(c,s,i0,r0,i1) _baddi_p(_jit,c,s,i0,r0,i1)
static jit_word_t _baddi_p(jit_state_t*,jit_int32_t,jit_bool_t,
jit_word_t,jit_int32_t,jit_word_t);
# define bsubr(c,s,i0,r0,r1) _bsubr(_jit,c,s,i0,r0,r1)
static void _bsubr(jit_state_t*,jit_int32_t,jit_bool_t,
jit_word_t,jit_int32_t,jit_int32_t);
# define bsubr_p(c,s,i0,r0,r1) _bsubr_p(_jit,c,s,i0,r0,r1)
static jit_word_t _bsubr_p(jit_state_t*,jit_int32_t,jit_bool_t,
jit_word_t,jit_int32_t,jit_int32_t);
# define bsubi(c,s,i0,r0,i1) _bsubi(_jit,c,s,i0,r0,i1)
static void _bsubi(jit_state_t*,jit_int32_t,jit_bool_t,
jit_word_t,jit_int32_t,jit_word_t);
# define bsubi_p(c,s,i0,r0,i1) _bsubi_p(_jit,c,s,i0,r0,i1)
static jit_word_t _bsubi_p(jit_state_t*,jit_int32_t,jit_bool_t,
jit_word_t,jit_int32_t,jit_word_t);
# define bmxr(cc,i0,r0,r1) _bmxr(_jit,cc,i0,r0,r1)
static void _bmxr(jit_state_t*,jit_int32_t,
jit_word_t,jit_int32_t,jit_int32_t);
# define bmxr_p(cc,i0,r0,r1) _bmxr_p(_jit,cc,i0,r0,r1)
static jit_word_t _bmxr_p(jit_state_t*,jit_int32_t,
jit_word_t,jit_int32_t,jit_int32_t);
# define bmxi(cc,i0,r0,i1) _bmxi(_jit,cc,i0,r0,i1)
static void _bmxi(jit_state_t*,jit_int32_t,
jit_word_t,jit_int32_t,jit_word_t);
# define bmxi_p(cc,i0,r0,i1) _bmxi_p(_jit,cc,i0,r0,i1)
static jit_word_t _bmxi_p(jit_state_t*,jit_int32_t,
jit_word_t,jit_int32_t,jit_word_t);
# define movr(r0,r1) _movr(_jit,r0,r1)
static void _movr(jit_state_t*,jit_int32_t,jit_int32_t);
# define movi(r0,i0) _movi(_jit,r0,i0)
static void _movi(jit_state_t*,jit_int32_t,jit_word_t);
# define movi_p(r0,i0) _movi_p(_jit,r0,i0)
static jit_word_t _movi_p(jit_state_t*,jit_int32_t,jit_word_t);
# define addr(r0,r1,r2) _addr(_jit,r0,r1,r2)
static void _addr(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define addi(r0,r1,i0) _addi(_jit,r0,r1,i0)
static void _addi(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define addcr(r0,r1,r2) _addcr(_jit,r0,r1,r2)
static void _addcr(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define addci(r0,r1,i0) _addci(_jit,r0,r1,i0)
static void _addci(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define addxr(r0,r1,r2) _addxr(_jit,r0,r1,r2)
static void _addxr(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define addxi(r0,r1,i0) _addxi(_jit,r0,r1,i0)
static void _addxi(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define subr(r0,r1,r2) _subr(_jit,r0,r1,r2)
static void _subr(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define subi(r0,r1,i0) _subi(_jit,r0,r1,i0)
static void _subi(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define subcr(r0,r1,r2) _subcr(_jit,r0,r1,r2)
static void _subcr(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define subci(r0,r1,i0) _subci(_jit,r0,r1,i0)
static void _subci(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define subxr(r0,r1,r2) _subxr(_jit,r0,r1,r2)
static void _subxr(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define subxi(r0,r1,i0) _subxi(_jit,r0,r1,i0)
static void _subxi(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define rsbi(r0, r1, i0) _rsbi(_jit, r0, r1, i0)
static void _rsbi(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define mulr(r0,r1,r2) _mulr(_jit,r0,r1,r2)
static void _mulr(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define muli(r0,r1,i0) _muli(_jit,r0,r1,i0)
static void _muli(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define qmulr(r0,r1,r2,r3) _qmulr(_jit,r0,r1,r2,r3)
static void _qmulr(jit_state_t*,jit_int32_t,
jit_int32_t,jit_int32_t,jit_int32_t);
# define qmuli(r0,r1,r2,i0) _qmuli(_jit,r0,r1,r2,i0)
static void _qmuli(jit_state_t*,jit_int32_t,
jit_int32_t,jit_int32_t,jit_word_t);
# define qmulr_u(r0,r1,r2,r3) _qmulr_u(_jit,r0,r1,r2,r3)
static void _qmulr_u(jit_state_t*,jit_int32_t,
jit_int32_t,jit_int32_t,jit_int32_t);
# define qmuli_u(r0,r1,r2,i0) _qmuli_u(_jit,r0,r1,r2,i0)
static void _qmuli_u(jit_state_t*,jit_int32_t,
jit_int32_t,jit_int32_t,jit_word_t);
# define divr(r0,r1,r2) _divr(_jit,r0,r1,r2)
static void _divr(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define divi(r0,r1,i0) _divi(_jit,r0,r1,i0)
static void _divi(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define divr_u(r0,r1,r2) _divr_u(_jit,r0,r1,r2)
static void _divr_u(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define divi_u(r0,r1,i0) _divi_u(_jit,r0,r1,i0)
static void _divi_u(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define remr(r0,r1,r2) _remr(_jit,r0,r1,r2)
static void _remr(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define remi(r0,r1,i0) _remi(_jit,r0,r1,i0)
static void _remi(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define remr_u(r0,r1,r2) _remr_u(_jit,r0,r1,r2)
static void _remr_u(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define remi_u(r0,r1,i0) _remi_u(_jit,r0,r1,i0)
static void _remi_u(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define qdivr(r0,r1,r2,r3) _qdivr(_jit,r0,r1,r2,r3)
static void _qdivr(jit_state_t*,jit_int32_t,
jit_int32_t,jit_int32_t,jit_int32_t);
# define qdivi(r0,r1,r2,i0) _qdivi(_jit,r0,r1,r2,i0)
static void _qdivi(jit_state_t*,jit_int32_t,
jit_int32_t,jit_int32_t,jit_word_t);
# define qdivr_u(r0,r1,r2,r3) _qdivr_u(_jit,r0,r1,r2,r3)
static void _qdivr_u(jit_state_t*,jit_int32_t,
jit_int32_t,jit_int32_t,jit_int32_t);
# define qdivi_u(r0,r1,r2,i0) _qdivi_u(_jit,r0,r1,r2,i0)
static void _qdivi_u(jit_state_t*,jit_int32_t,
jit_int32_t,jit_int32_t,jit_word_t);
# if __WORDSIZE == 32
# define lshr(r0,r1,r2) _lshr(_jit,r0,r1,r2)
static void _lshr(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# else
# define lshr(r0,r1,r2) SLLG(r0,r1,0,r2)
# endif
# define lshi(r0,r1,i0) _lshi(_jit,r0,r1,i0)
static void _lshi(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# if __WORDSIZE == 32
# define rshr(r0,r1,r2) _rshr(_jit,r0,r1,r2)
static void _rshr(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# else
# define rshr(r0,r1,r2) SRAG(r0,r1,0,r2)
# endif
# define rshi(r0,r1,i0) _rshi(_jit,r0,r1,i0)
static void _rshi(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# if __WORDSIZE == 32
# define rshr_u(r0,r1,r2) _rshr_u(_jit,r0,r1,r2)
static void _rshr_u(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# else
# define rshr_u(r0,r1,r2) SRLG(r0,r1,0,r2)
# endif
# define rshi_u(r0,r1,i0) _rshi_u(_jit,r0,r1,i0)
static void _rshi_u(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# if __WORDSIZE == 32
# define negr(r0,r1) LCR(r0,r1)
# else
# define negr(r0,r1) LCGR(r0,r1)
# endif
# define comr(r0,r1) _comr(_jit,r0,r1)
static void _comr(jit_state_t*,jit_int32_t,jit_int32_t);
# define andr(r0,r1,r2) _andr(_jit,r0,r1,r2)
static void _andr(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define andi(r0,r1,i0) _andi(_jit,r0,r1,i0)
static void _andi(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define orr(r0,r1,r2) _orr(_jit,r0,r1,r2)
static void _orr(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define ori(r0,r1,i0) _ori(_jit,r0,r1,i0)
static void _ori(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define xorr(r0,r1,r2) _xorr(_jit,r0,r1,r2)
static void _xorr(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define xori(r0,r1,i0) _xori(_jit,r0,r1,i0)
static void _xori(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define htonr_us(r0,r1) extr_us(r0,r1)
# if __WORDSIZE == 32
# define htonr_ui(r0,r1) movr(r0,r1)
# else
# define htonr_ui(r0,r1) extr_ui(r0,r1)
# define htonr_ul(r0,r1) movr(r0,r1)
# endif
# define extr_c(r0,r1) LGBR(r0,r1)
# define extr_uc(r0,r1) LLGCR(r0,r1)
# define extr_s(r0,r1) LGHR(r0,r1)
# define extr_us(r0,r1) LLGHR(r0,r1)
# if __WORDSIZE == 64
# define extr_i(r0,r1) LGFR(r0,r1)
# define extr_ui(r0,r1) LLGFR(r0,r1)
# endif
# define ldr_c(r0,r1) LGB(r0,0,0,r1)
# define ldi_c(r0,i0) _ldi_c(_jit,r0,i0)
static void _ldi_c(jit_state_t*,jit_int32_t,jit_word_t);
# define ldxr_c(r0,r1,r2) _ldxr_c(_jit,r0,r1,r2)
static void _ldxr_c(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define ldxi_c(r0,r1,i0) _ldxi_c(_jit,r0,r1,i0)
static void _ldxi_c(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define ldr_uc(r0,r1) LLGC(r0,0,0,r1)
# define ldi_uc(r0,i0) _ldi_uc(_jit,r0,i0)
static void _ldi_uc(jit_state_t*,jit_int32_t,jit_word_t);
# define ldxr_uc(r0,r1,r2) _ldxr_uc(_jit,r0,r1,r2)
static void _ldxr_uc(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define ldxi_uc(r0,r1,i0) _ldxi_uc(_jit,r0,r1,i0)
static void _ldxi_uc(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# if __WORDSIZE == 32
# define ldr_s(r0,r1) LH(r0,0,0,r1)
# else
# define ldr_s(r0,r1) LGH(r0,0,0,r1)
# endif
# define ldi_s(r0,i0) _ldi_s(_jit,r0,i0)
static void _ldi_s(jit_state_t*,jit_int32_t,jit_word_t);
# define ldxr_s(r0,r1,r2) _ldxr_s(_jit,r0,r1,r2)
static void _ldxr_s(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define ldxi_s(r0,r1,i0) _ldxi_s(_jit,r0,r1,i0)
static void _ldxi_s(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define ldr_us(r0,r1) LLGH(r0,0,0,r1)
# define ldi_us(r0,i0) _ldi_us(_jit,r0,i0)
static void _ldi_us(jit_state_t*,jit_int32_t,jit_word_t);
# define ldxr_us(r0,r1,r2) _ldxr_us(_jit,r0,r1,r2)
static void _ldxr_us(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define ldxi_us(r0,r1,i0) _ldxi_us(_jit,r0,r1,i0)
static void _ldxi_us(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# if __WORDSIZE == 32
# define ldr_i(r0,r1) LLGF(r0,0,0,r1)
# else
# define ldr_i(r0,r1) LGF(r0,0,0,r1)
# endif
# define ldi_i(r0,i0) _ldi_i(_jit,r0,i0)
static void _ldi_i(jit_state_t*,jit_int32_t,jit_word_t);
# define ldxr_i(r0,r1,r2) _ldxr_i(_jit,r0,r1,r2)
static void _ldxr_i(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define ldxi_i(r0,r1,i0) _ldxi_i(_jit,r0,r1,i0)
static void _ldxi_i(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# if __WORDSIZE == 64
# define ldr_ui(r0,r1) LLGF(r0,0,0,r1)
# define ldi_ui(r0,i0) _ldi_ui(_jit,r0,i0)
static void _ldi_ui(jit_state_t*,jit_int32_t,jit_word_t);
# define ldxr_ui(r0,r1,r2) _ldxr_ui(_jit,r0,r1,r2)
static void _ldxr_ui(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define ldxi_ui(r0,r1,i0) _ldxi_ui(_jit,r0,r1,i0)
static void _ldxi_ui(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# define ldr_l(r0,r1) LG(r0,0,0,r1)
# define ldi_l(r0,i0) _ldi_l(_jit,r0,i0)
static void _ldi_l(jit_state_t*,jit_int32_t,jit_word_t);
# define ldxr_l(r0,r1,r2) _ldxr_l(_jit,r0,r1,r2)
static void _ldxr_l(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define ldxi_l(r0,r1,i0) _ldxi_l(_jit,r0,r1,i0)
static void _ldxi_l(jit_state_t*,jit_int32_t,jit_int32_t,jit_word_t);
# endif
# define str_c(r0,r1) STC(r1,0,0,r0)
# define sti_c(i0,r0) _sti_c(_jit,i0,r0)
static void _sti_c(jit_state_t*,jit_word_t,jit_int32_t);
# define stxr_c(r0,r1,r2) _stxr_c(_jit,r0,r1,r2)
static void _stxr_c(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define stxi_c(i0,r0,r1) _stxi_c(_jit,i0,r0,r1)
static void _stxi_c(jit_state_t*,jit_word_t,jit_int32_t,jit_int32_t);
# define str_s(r0,r1) STH(r1,0,0,r0)
# define sti_s(i0,r0) _sti_s(_jit,i0,r0)
static void _sti_s(jit_state_t*,jit_word_t,jit_int32_t);
# define stxr_s(r0,r1,r2) _stxr_s(_jit,r0,r1,r2)
static void _stxr_s(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define stxi_s(i0,r0,r1) _stxi_s(_jit,i0,r0,r1)
static void _stxi_s(jit_state_t*,jit_word_t,jit_int32_t,jit_int32_t);
# define str_i(r0,r1) ST(r1,0,0,r0)
# define sti_i(i0,r0) _sti_i(_jit,i0,r0)
static void _sti_i(jit_state_t*,jit_word_t,jit_int32_t);
# define stxr_i(r0,r1,r2) _stxr_i(_jit,r0,r1,r2)
static void _stxr_i(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define stxi_i(i0,r0,r1) _stxi_i(_jit,i0,r0,r1)
static void _stxi_i(jit_state_t*,jit_word_t,jit_int32_t,jit_int32_t);
# if __WORDSIZE == 64
# define str_l(r0,r1) STG(r1,0,0,r0)
# define sti_l(i0,r0) _sti_l(_jit,i0,r0)
static void _sti_l(jit_state_t*,jit_word_t,jit_int32_t);
# define stxr_l(r0,r1,r2) _stxr_l(_jit,r0,r1,r2)
static void _stxr_l(jit_state_t*,jit_int32_t,jit_int32_t,jit_int32_t);
# define stxi_l(i0,r0,r1) _stxi_l(_jit,i0,r0,r1)
static void _stxi_l(jit_state_t*,jit_word_t,jit_int32_t,jit_int32_t);
# endif
# define ltr(r0,r1,r2) crr(CC_L,r0,r1,r2)
# define lti(r0,r1,i0) cri(CC_L,r0,r1,i0)
# define ltr_u(r0,r1,r2) crr_u(CC_L,r0,r1,r2)
# define lti_u(r0,r1,i0) cri_u(CC_L,r0,r1,i0)
# define ler(r0,r1,r2) crr(CC_LE,r0,r1,r2)
# define lei(r0,r1,i0) cri(CC_LE,r0,r1,i0)
# define ler_u(r0,r1,r2) crr_u(CC_LE,r0,r1,r2)
# define lei_u(r0,r1,i0) cri_u(CC_LE,r0,r1,i0)
# define eqr(r0,r1,r2) crr(CC_E,r0,r1,r2)
# define eqi(r0,r1,i0) cri(CC_E,r0,r1,i0)
# define ger(r0,r1,r2) crr(CC_HE,r0,r1,r2)
# define gei(r0,r1,i0) cri(CC_HE,r0,r1,i0)
# define ger_u(r0,r1,r2) crr_u(CC_HE,r0,r1,r2)
# define gei_u(r0,r1,i0) cri_u(CC_HE,r0,r1,i0)
# define gtr(r0,r1,r2) crr(CC_H,r0,r1,r2)
# define gti(r0,r1,i0) cri(CC_H,r0,r1,i0)
# define gtr_u(r0,r1,r2) crr_u(CC_H,r0,r1,r2)
# define gti_u(r0,r1,i0) cri_u(CC_H,r0,r1,i0)
# define ner(r0,r1,r2) crr(CC_NE,r0,r1,r2)
# define nei(r0,r1,i0) cri(CC_NE,r0,r1,i0)
# define bltr(i0,r0,r1) brr(CC_L,i0,r0,r1)
# define bltr_p(i0,r0,r1) brr_p(CC_L,i0,r0,r1)
# define blti(i0,r0,i1) bri(CC_L,i0,r0,i1)
# define blti_p(i0,r0,i1) bri_p(CC_L,i0,r0,i1)
# define bltr_u(i0,r0,r1) brr_u(CC_L,i0,r0,r1)
# define bltr_u_p(i0,r0,r1) brr_u_p(CC_L,i0,r0,r1)
# define blti_u(i0,r0,i1) bri_u(CC_L,i0,r0,i1)
# define blti_u_p(i0,r0,i1) bri_u_p(CC_L,i0,r0,i1)
# define bler(i0,r0,r1) brr(CC_LE,i0,r0,r1)
# define bler_p(i0,r0,r1) brr_p(CC_LE,i0,r0,r1)
# define blei(i0,r0,i1) bri(CC_LE,i0,r0,i1)
# define blei_p(i0,r0,i1) bri_p(CC_LE,i0,r0,i1)
# define bler_u(i0,r0,r1) brr_u(CC_LE,i0,r0,r1)
# define bler_u_p(i0,r0,r1) brr_u_p(CC_LE,i0,r0,r1)
# define blei_u(i0,r0,i1) bri_u(CC_LE,i0,r0,i1)
# define blei_u_p(i0,r0,i1) bri_u_p(CC_LE,i0,r0,i1)
# define beqr(i0,r0,r1) brr(CC_E,i0,r0,r1)
# define beqr_p(i0,r0,r1) brr_p(CC_E,i0,r0,r1)
# define beqi(i0,r0,i1) bri(CC_E,i0,r0,i1)
# define beqi_p(i0,r0,i1) bri_p(CC_E,i0,r0,i1)
# define bger(i0,r0,r1) brr(CC_HE,i0,r0,r1)
# define bger_p(i0,r0,r1) brr_p(CC_HE,i0,r0,r1)
# define bgei(i0,r0,i1) bri(CC_HE,i0,r0,i1)
# define bgei_p(i0,r0,i1) bri_p(CC_HE,i0,r0,i1)
# define bger_u(i0,r0,r1) brr_u(CC_HE,i0,r0,r1)
# define bger_u_p(i0,r0,r1) brr_u_p(CC_HE,i0,r0,r1)
# define bgei_u(i0,r0,i1) bri_u(CC_HE,i0,r0,i1)
# define bgei_u_p(i0,r0,i1) bri_u_p(CC_HE,i0,r0,i1)
# define bgtr(i0,r0,r1) brr(CC_H,i0,r0,r1)
# define bgtr_p(i0,r0,r1) brr_p(CC_H,i0,r0,r1)
# define bgti(i0,r0,i1) bri(CC_H,i0,r0,i1)
# define bgti_p(i0,r0,i1) bri_p(CC_H,i0,r0,i1)
# define bgtr_u(i0,r0,r1) brr_u(CC_H,i0,r0,r1)
# define bgtr_u_p(i0,r0,r1) brr_u_p(CC_H,i0,r0,r1)
# define bgti_u(i0,r0,i1) bri_u(CC_H,i0,r0,i1)
# define bgti_u_p(i0,r0,i1) bri_u_p(CC_H,i0,r0,i1)
# define bner(i0,r0,r1) brr(CC_NE,i0,r0,r1)
# define bner_p(i0,r0,r1) brr_p(CC_NE,i0,r0,r1)
# define bnei(i0,r0,i1) bri(CC_NE,i0,r0,i1)
# define bnei_p(i0,r0,i1) bri_p(CC_NE,i0,r0,i1)
# define boaddr(i0,r0,r1) baddr(CC_O,1,i0,r0,r1)
# define boaddr_p(i0,r0,r1) baddr_p(CC_O,1,i0,r0,r1)
# define boaddi(i0,r0,i1) baddi(CC_O,1,i0,r0,i1)
# define boaddi_p(i0,r0,i1) baddi_p(CC_O,1,i0,r0,i1)
# define boaddr_u(i0,r0,r1) baddr(CC_NLE,0,i0,r0,r1)
# define boaddr_u_p(i0,r0,r1) baddr_p(CC_NLE,0,i0,r0,r1)
# define boaddi_u(i0,r0,i1) baddi(CC_NLE,0,i0,r0,i1)
# define boaddi_u_p(i0,r0,i1) baddi_p(CC_NLE,0,i0,r0,i1)
# define bxaddr(i0,r0,r1) baddr(CC_NO,1,i0,r0,r1)
# define bxaddr_p(i0,r0,r1) baddr_p(CC_NO,1,i0,r0,r1)
# define bxaddi(i0,r0,i1) baddi(CC_NO,1,i0,r0,i1)
# define bxaddi_p(i0,r0,i1) baddi_p(CC_NO,1,i0,r0,i1)
# define bxaddr_u(i0,r0,r1) baddr(CC_LE,0,i0,r0,r1)
# define bxaddr_u_p(i0,r0,r1) baddr_p(CC_LE,0,i0,r0,r1)
# define bxaddi_u(i0,r0,i1) baddi(CC_LE,0,i0,r0,i1)
# define bxaddi_u_p(i0,r0,i1) baddi_p(CC_LE,0,i0,r0,i1)
# define bosubr(i0,r0,r1) bsubr(CC_O,1,i0,r0,r1)
# define bosubr_p(i0,r0,r1) bsubr_p(CC_O,1,i0,r0,r1)
# define bosubi(i0,r0,i1) bsubi(CC_O,1,i0,r0,i1)
# define bosubi_p(i0,r0,i1) bsubi_p(CC_O,1,i0,r0,i1)
# define bosubr_u(i0,r0,r1) bsubr(CC_L,0,i0,r0,r1)
# define bosubr_u_p(i0,r0,r1) bsubr_p(CC_L,0,i0,r0,r1)
# define bosubi_u(i0,r0,i1) bsubi(CC_L,0,i0,r0,i1)
# define bosubi_u_p(i0,r0,i1) bsubi_p(CC_L,0,i0,r0,i1)
# define bxsubr(i0,r0,r1) bsubr(CC_NO,1,i0,r0,r1)
# define bxsubr_p(i0,r0,r1) bsubr_p(CC_NO,1,i0,r0,r1)
# define bxsubi(i0,r0,i1) bsubi(CC_NO,1,i0,r0,i1)
# define bxsubi_p(i0,r0,i1) bsubi_p(CC_NO,1,i0,r0,i1)
# define bxsubr_u(i0,r0,r1) bsubr(CC_NL,0,i0,r0,r1)
# define bxsubr_u_p(i0,r0,r1) bsubr_p(CC_NL,0,i0,r0,r1)
# define bxsubi_u(i0,r0,i1) bsubi(CC_NL,0,i0,r0,i1)
# define bxsubi_u_p(i0,r0,i1) bsubi_p(CC_NL,0,i0,r0,i1)
# define bmsr(i0,r0,r1) bmxr(CC_NE,i0,r0,r1)
# define bmsr_p(i0,r0,r1) bmxr_p(CC_NE,i0,r0,r1)
# define bmsi(i0,r0,i1) bmxi(CC_NE,i0,r0,i1)
# define bmsi_p(i0,r0,i1) bmxi_p(CC_NE,i0,r0,i1)
# define bmcr(i0,r0,r1) bmxr(CC_E,i0,r0,r1)
# define bmcr_p(i0,r0,r1) bmxr_p(CC_E,i0,r0,r1)
# define bmci(i0,r0,i1) bmxi(CC_E,i0,r0,i1)
# define bmci_p(i0,r0,i1) bmxi_p(CC_E,i0,r0,i1)
# define jmpr(r0) BR(r0)
# define jmpi(i0) _jmpi(_jit,i0)
static void _jmpi(jit_state_t*,jit_word_t);
# define jmpi_p(i0) _jmpi_p(_jit,i0)
static jit_word_t _jmpi_p(jit_state_t*,jit_word_t);
# define callr(r0) BALR(_R14_REGNO,r0)
# define calli(i0) _calli(_jit,i0)
static void _calli(jit_state_t*,jit_word_t);
# define calli_p(i0) _calli_p(_jit,i0)
static jit_word_t _calli_p(jit_state_t*,jit_word_t);
# define prolog(i0) _prolog(_jit,i0)
static void _prolog(jit_state_t*,jit_node_t*);
# define epilog(i0) _epilog(_jit,i0)
static void _epilog(jit_state_t*,jit_node_t*);
# define vastart(r0) _vastart(_jit, r0)
static void _vastart(jit_state_t*, jit_int32_t);
# define vaarg(r0, r1) _vaarg(_jit, r0, r1)
static void _vaarg(jit_state_t*, jit_int32_t, jit_int32_t);
# define patch_at(instr,label) _patch_at(_jit,instr,label)
static void _patch_at(jit_state_t*,jit_word_t,jit_word_t);
#endif
#if CODE
# define _us jit_uint16_t
# define _ui jit_uint32_t
static void
_E(jit_state_t *_jit, _ui Op)
{
union {
struct {
_us op;
} b;
_us s;
} i0;
i0.b.op = Op;
assert(i0.b.op == Op);
is(i0.s);
}
static void
_I(jit_state_t *_jit, _ui Op, _ui I)
{
union {
struct {
_us op : 8;
_us i : 8;
} b;
_us s;
} i0;
i0.b.op = Op;
i0.b.i = I;
assert(i0.b.op == Op);
assert(i0.b.i == I);
is(i0.s);
}
static void
_RR(jit_state_t *_jit, _ui Op, _ui R1, _ui R2)
{
union {
struct {
_us op : 8;
_us r1 : 4;
_us r2 : 4;
} b;
_us s;
} i0;
i0.b.op = Op;
i0.b.r1 = R1;
i0.b.r2 = R2;
assert(i0.b.op == Op);
assert(i0.b.r1 == R1);
assert(i0.b.r2 == R2);
is(i0.s);
}
static void
_RRE(jit_state_t *_jit, _ui Op, _ui R1, _ui R2)
{
union {
struct {
_us op;
} b;
_us s;
} i0;
union {
struct {
_us _ : 8;
_us r1 : 4;
_us r2 : 4;
} b;
_us s;
} i1;
i0.b.op = Op;
i1.b._ = 0;
i1.b.r1 = R1;
i1.b.r2 = R2;
assert(i0.b.op == Op);
assert(i1.b.r1 == R1);
assert(i1.b.r2 == R2);
is(i0.s);
is(i1.s);
}
static void
_RRF(jit_state_t *_jit, _ui Op, _ui R3, _ui M4, _ui R1, _ui R2)
{
union {
struct {
_us op;
} b;
_us s;
} i0;
union {
struct {
_us r3 : 4;
_us m4 : 4;
_us r1 : 4;
_us r2 : 4;
} b;
_us s;
} i1;
i0.b.op = Op;
i1.b.r3 = R3;
i1.b.m4 = M4;
i1.b.r1 = R1;
i1.b.r2 = R2;
assert(i0.b.op == Op);
assert(i1.b.r3 == R3);
assert(i1.b.m4 == M4);
assert(i1.b.r1 == R1);
assert(i1.b.r2 == R2);
is(i0.s);
is(i1.s);
}
static void
_RX(jit_state_t *_jit, _ui Op, _ui R1, _ui X2, _ui B2, _ui D2)
{
union {
struct {
_us op : 8;
_us r1 : 4;
_us x2 : 4;
} b;
_us s;
} i0;
union {
struct {
_us b2 : 4;
_us d2 : 12;
} b;
_us s;
} i1;
i0.b.op = Op;
i0.b.r1 = R1;
i0.b.x2 = X2;
i1.b.b2 = B2;
i1.b.d2 = D2;
assert(i0.b.op == Op);
assert(i0.b.r1 == R1);
assert(i0.b.x2 == X2);
assert(i1.b.b2 == B2);
assert(i1.b.d2 == D2);
is(i0.s);
is(i1.s);
}
static void
_RXE(jit_state_t *_jit, _ui Op, _ui R1, _ui X2, _ui B2, _ui D2, _ui Op2)
{
union {
struct {
_us op : 8;
_us r1 : 4;
_us x2 : 4;
} b;
_us s;
} i0;
union {
struct {
_us b2 : 4;
_us d2 : 12;
} b;
_ui s;
} i1;
union {
struct {
_us _ : 8;
_us op : 8;
} b;
_us s;
} i2;
i2.b._ = 0;
i0.b.op = Op;
i0.b.r1 = R1;
i0.b.x2 = X2;
i1.b.b2 = B2;
i1.b.d2 = D2;
i2.b.op = Op2;
assert(i0.b.op == Op);
assert(i0.b.r1 == R1);
assert(i0.b.x2 == X2);
assert(i1.b.b2 == B2);
assert(i1.b.d2 == D2);
assert(i2.b.op == Op2);
is(i0.s);
is(i1.s);
is(i2.s);
}
static void
_RXF(jit_state_t *_jit, _ui Op, _ui R3, _ui X2, _ui B2, _ui D2, _ui R1, _ui Op2)
{
union {
struct {
_us op : 8;
_us r3 : 4;
_us x2 : 4;
} b;
_us s;
} i0;
union {
struct {
_us b2 : 4;
_us d2 : 12;
} b;
_us s;
} i1;
union {
struct {
_us r1 : 4;
_us _ : 4;
_us op : 8;
} b;
_us s;
} i2;
i2.b._ = 0;
i0.b.op = Op;
i0.b.r3 = R3;
i0.b.x2 = X2;
i1.b.b2 = B2;
i1.b.d2 = D2;
i2.b.r1 = R1;
i2.b.op = Op2;
assert(i0.b.op == Op);
assert(i0.b.r3 == R3);
assert(i0.b.x2 == X2);
assert(i1.b.b2 == B2);
assert(i1.b.d2 == D2);
assert(i2.b.r1 == R1);
assert(i2.b.op == Op2);
is(i0.s);
is(i1.s);
is(i2.s);
}
static void
_RXY(jit_state_t *_jit, _ui Op, _ui R1, _ui X2, _ui B2, _ui D2, _ui Op2)
{
union {
struct {
_us op : 8;
_us r1 : 4;
_us x2 : 4;
} b;
_us s;
} i0;
union {
struct {
_us b2 : 4;
_us dl : 12;
} b;
_us s;
} i1;
union {
struct {
_us dh : 8;
_us op : 8;
} b;
_us s;
} i2;
i0.s = i1.s = i2.s = 0;
i0.b.op = Op;
i0.b.r1 = R1;
i0.b.x2 = X2;
i1.b.b2 = B2;
i1.b.dl = D2 & 0xfff;
i2.b.dh = D2 >> 12;
i2.b.op = Op2;
assert(i0.b.op == Op);
assert(i0.b.r1 == R1);
assert(i0.b.x2 == X2);
assert(i1.b.b2 == B2);
assert(i2.b.dh == D2 >> 12);
assert(i2.b.op == Op2);
is(i0.s);
is(i1.s);
is(i2.s);
}
static void
_RS(jit_state_t *_jit, _ui Op, _ui R1, _ui R3, _ui B2, _ui D2)
{
union {
struct {
_us op : 8;
_us r1 : 4;
_us r3 : 4;
} b;
_us s;
} i0;
union {
struct {
_us b2 : 4;
_us d2 : 12;
} b;
_us s;
} i1;
i0.s = i1.s = 0;
i0.b.op = Op;
i0.b.r1 = R1;
i0.b.r3 = R3;
i1.b.b2 = B2;
i1.b.d2 = D2;
assert(i0.b.op == Op);
assert(i0.b.r1 == R1);
assert(i0.b.r3 == R3);
assert(i1.b.b2 == B2);
assert(i1.b.d2 == D2);
is(i0.s);
is(i1.s);
}
static void
_RSL(jit_state_t *_jit, _ui Op, _ui L1, _ui B1, _ui D1, _ui Op2)
{
union {
struct {
_us op : 8;
_us l1 : 4;
_us _ : 4;
} b;
_us s;
} i0;
union {
struct {
_us b1 : 4;
_us d1 : 12;
} b;
_us s;
} i1;
union {
struct {
_us _ : 8;
_us op : 8;
} b;
_us s;
} i2;
i0.b._ = 0;
i2.b._ = 0;
i0.b.op = Op;
i0.b.l1 = L1;
i1.b.b1 = B1;
i1.b.d1 = D1;
i2.b.op = Op2;
assert(i0.b.op == Op);
assert(i0.b.l1 == L1);
assert(i1.b.b1 == B1);
assert(i1.b.d1 == D1);
assert(i2.b.op == Op2);
is(i0.s);
is(i1.s);
is(i2.s);
}
static void
_RSI(jit_state_t *_jit, _ui Op, _ui R1, _ui R3, _ui I2)
{
union {
struct {
_us op : 8;
_us r1 : 4;
_us r3 : 4;
} b;
_us s;
} i0;
union {
struct {
_us i2;
} b;
_us s;
} i1;
i0.b.op = Op;
i0.b.r1 = R1;
i0.b.r3 = R3;
i1.b.i2 = I2;
assert(i0.b.op == Op);
assert(i0.b.r1 == R1);
assert(i0.b.r3 == R3);
assert(i1.b.i2 == I2);
is(i0.s);
is(i1.s);
}
static void
_RIE(jit_state_t *_jit, _ui Op, _ui R1, _ui R3, _ui I2, _ui Op2)
{
union {
struct {
_us op : 8;
_us r1 : 4;
_us r3 : 4;
} b;
_us s;
} i0;
union {
struct {
_us i2;
} b;
_us s;
} i1;
union {
struct {
_us _ : 8;
_us op : 8;
} b;
_us s;
} i2;
i2.b._ = 0;
i0.b.op = Op;
i0.b.r1 = R1;
i0.b.r3 = R3;
i1.b.i2 = I2;
i2.b.op = Op2;
assert(i0.b.op == Op);
assert(i0.b.r1 == R1);
assert(i0.b.r3 == R3);
assert(i1.b.i2 == I2);
assert(i2.b.op == Op2);
is(i0.s);
is(i1.s);
is(i2.s);
}
static void
_RIL(jit_state_t *_jit, _ui Op, _ui R1, _ui Op2, _ui I2)
{
union {
struct {
_us o1 : 8;
_us r1 : 4;
_us o2 : 4;
} b;
_us s;
} i0;
union {
struct {
_ui ih : 16;
_ui il : 16;
} b;
_ui i;
} i12;
i0.b.o1 = Op;
i0.b.r1 = R1;
i0.b.o2 = Op2;
i12.i = I2;
assert(i0.b.o1 == Op);
assert(i0.b.r1 == R1);
assert(i0.b.o2 == Op2);
is(i0.s);
is(i12.b.ih);
is(i12.b.il);
}
static void
_SI(jit_state_t *_jit, _ui Op, _ui I2, _ui B1, _ui D1)
{
union {
struct {
_us op : 8;
_us i2 : 8;
} b;
_us s;
} i0;
union {
struct {
_us b1 : 4;
_us d1 : 12;
} b;
_us s;
} i1;
i0.b.op = Op;
i0.b.i2 = I2;
i1.b.b1 = B1;
i1.b.d1 = D1;
assert(i0.b.op == Op);
assert(i0.b.i2 == I2);
assert(i1.b.b1 == B1);
assert(i1.b.d1 == D1);
is(i0.s);
is(i1.s);
}
static void
_SIY(jit_state_t *_jit, _ui Op, _ui I2, _ui B1, _ui D1, _ui Op2)
{
union {
struct {
_us op : 8;
_us i2 : 8;
} b;
_us s;
} i0;
union {
struct {
_us b1 : 4;
_us dl : 12;
} b;
_us s;
} i1;
union {
struct {
_us dh : 8;
_us op : 8;
} b;
_us s;
} i2;
i0.b.op = Op;
i0.b.i2 = I2;
i1.b.b1 = B1;
i1.b.dl = D1 & 0xfff;
i2.b.dh = D1 >> 8;
i2.b.op = Op2;
assert(i0.b.op == Op);
assert(i0.b.i2 == I2);
assert(i1.b.b1 == B1);
assert(i2.b.dh == D1 >> 8);
assert(i2.b.op == Op2);
is(i0.s);
is(i1.s);
is(i2.s);
}
static void
_S(jit_state_t *_jit, _ui Op, _ui B2, _ui D2)
{
union {
struct {
_us op;
} b;
_us s;
} i0;
union {
struct {
_us b2 : 4;
_us d2 : 12;
} b;
_us s;
} i1;
i0.b.op = Op;
i1.b.b2 = B2;
i1.b.d2 = D2;
assert(i0.b.op == Op);
assert(i1.b.b2 == B2);
assert(i1.b.d2 == D2);
is(i0.s);
is(i1.s);
}
static void
_SS(jit_state_t *_jit, _ui Op, _ui LL, _ui LH, _ui B1, _ui D1, _ui B2, _ui D2)
{
union {
struct {
_us op : 8;
_us ll : 4;
_us lh : 4;
} b;
_us s;
} i0;
union {
struct {
_us b1 : 4;
_us d1 : 12;
} b;
_us s;
} i1;
union {
struct {
_us b2 : 4;
_us d2 : 12;
} b;
_us s;
} i2;
i0.b.op = Op;
i0.b.ll = LL;
i0.b.lh = LH;
i1.b.b1 = B1;
i1.b.d1 = D1;
i2.b.b2 = B2;
i2.b.d2 = D2;
assert(i0.b.op == Op);
assert(i0.b.ll == LL);
assert(i0.b.lh == LH);
assert(i1.b.b1 == B1);
assert(i1.b.d1 == D1);
assert(i2.b.b2 == B2);
assert(i2.b.d2 == D2);
is(i0.s);
is(i1.s);
is(i2.s);
}
static void
_SSE(jit_state_t *_jit, _ui Op, _ui B1, _ui D1, _ui B2, _ui D2)
{
union {
struct {
_us op;
} b;
_us s;
} i0;
union {
struct {
_us b1 : 4;
_us d1 : 12;
} b;
_us s;
} i1;
union {
struct {
_us b2 : 4;
_us d2 : 12;
} b;
_us s;
} i2;
i0.b.op = Op;
i1.b.b1 = B1;
i1.b.d1 = D1;
i2.b.b2 = B2;
i2.b.d2 = D2;
assert(i0.b.op == Op);
assert(i1.b.b1 == B1);
assert(i1.b.d1 == D1);
assert(i2.b.b2 == B2);
assert(i2.b.d2 == D2);
is(i0.s);
is(i1.s);
is(i2.s);
}
# undef _us
# undef _ui
static void
_nop(jit_state_t *_jit, jit_int32_t c)
{
assert(c >= 0 && !(c & 1));
while (c) {
NOPR(_R7_REGNO);
c -= 2;
}
}
static jit_int32_t
_xdivr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
jit_int32_t regno;
regno = jit_get_reg_pair();
#if __WORDSIZE == 32
movr(rn(regno), r0);
SRDA(rn(regno), 32, 0);
#else
movr(rn(regno) + 1, r0);
#endif
DIVREM_(rn(regno), r1);
jit_unget_reg_pair(regno);
return (regno);
}
static jit_int32_t
_xdivr_u(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
jit_int32_t regno;
regno = jit_get_reg_pair();
#if __WORDSIZE == 32
movr(rn(regno), r0);
SRDL(rn(regno), 32, 0);
#else
movr(rn(regno) + 1, r0);
#endif
movi(rn(regno), 0);
DIVREMU_(rn(regno), r1);
jit_unget_reg_pair(regno);
return (regno);
}
static jit_int32_t
_xdivi(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
{
jit_int32_t imm, regno;
regno = jit_get_reg_pair();
imm = jit_get_reg(jit_class_gpr);
#if __WORDSIZE == 32
movr(rn(regno), r0);
SRDA(rn(regno), 32, 0);
#else
movr(rn(regno) + 1, r0);
#endif
movi(rn(imm), i0);
DIVREM_(rn(regno), rn(imm));
jit_unget_reg(imm);
jit_unget_reg_pair(regno);
return (regno);
}
static jit_int32_t
_xdivi_u(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
{
/* cannot overlap because operand is 128-bit */
jit_int32_t imm, regno;
regno = jit_get_reg_pair();
imm = jit_get_reg(jit_class_gpr);
#if __WORDSIZE == 32
movr(rn(regno), r0);
SRDL(rn(regno), 32, 0);
#else
movr(rn(regno) + 1, r0);
#endif
movi(rn(regno), 0);
movi(rn(imm), i0);
DIVREMU_(rn(regno), rn(imm));
jit_unget_reg(imm);
jit_unget_reg_pair(regno);
return (regno);
}
static void
_crr(jit_state_t *_jit, jit_int32_t cc,
jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_word_t w;
jit_int32_t reg, rg;
if (r0 == r1 || r0 == r2) {
reg = jit_get_reg(jit_class_gpr);
rg = rn(reg);
}
else
rg = r0;
movi(rg, 1);
CMP_(r1, r2);
w = _jit->pc.w;
BRC(cc, 0);
movi(rg, 0);
patch_at(w, _jit->pc.w);
if (r0 == r1 || r0 == r2) {
movr(r0, rg);
jit_unget_reg(reg);
}
}
static void
_cri(jit_state_t *_jit, jit_int32_t cc,
jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i0);
crr(cc, r0, r1, rn(reg));
jit_unget_reg(reg);
}
static void
_crr_u(jit_state_t *_jit, jit_int32_t cc,
jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_word_t w;
jit_int32_t reg, rg;
if (r0 == r1 || r0 == r2) {
reg = jit_get_reg(jit_class_gpr);
rg = rn(reg);
}
else
rg = r0;
movi(rg, 1);
CMPU_(r1, r2);
w = _jit->pc.w;
BRC(cc, 0);
movi(rg, 0);
patch_at(w, _jit->pc.w);
if (r0 == r1 || r0 == r2) {
movr(r0, rg);
jit_unget_reg(reg);
}
}
static void
_cri_u(jit_state_t *_jit, jit_int32_t cc,
jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i0);
crr_u(cc, r0, r1, rn(reg));
jit_unget_reg(reg);
}
static void
_brr(jit_state_t *_jit, jit_int32_t cc,
jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_word_t d;
CMP_(r0, r1);
d = (i0 - _jit->pc.w) >> 1;
if (s16_p(d))
BRC(cc, x16(d));
else {
assert(s32_p(d));
BRCL(cc, d);
}
}
static jit_word_t
_brr_p(jit_state_t *_jit, jit_int32_t cc,
jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_word_t w;
CMP_(r0, r1);
w = _jit->pc.w;
BRCL(cc, 0);
return (w);
}
static void
_bri(jit_state_t *_jit, jit_int32_t cc,
jit_word_t i0, jit_int32_t r0, jit_word_t i1)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr|jit_class_nospill);
movi(rn(reg), i1);
brr(cc, i0, r0, rn(reg));
jit_unget_reg(reg);
}
static jit_word_t
_bri_p(jit_state_t *_jit, jit_int32_t cc,
jit_word_t i0, jit_int32_t r0, jit_word_t i1)
{
jit_word_t w;
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr|jit_class_nospill);
movi(rn(reg), i1);
w = brr_p(cc, i0, r0, rn(reg));
jit_unget_reg(reg);
return (w);
}
static void
_brr_u(jit_state_t *_jit, jit_int32_t cc,
jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_word_t d;
CMPU_(r0, r1);
d = (i0 - _jit->pc.w) >> 1;
if (s16_p(d))
BRC(cc, x16(d));
else {
assert(s32_p(d));
BRCL(cc, d);
}
}
static jit_word_t
_brr_u_p(jit_state_t *_jit, jit_int32_t cc,
jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_word_t w;
CMPU_(r0, r1);
w = _jit->pc.w;
BRCL(cc, 0);
return (w);
}
static void
_bri_u(jit_state_t *_jit, jit_int32_t cc,
jit_word_t i0, jit_int32_t r0, jit_word_t i1)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr|jit_class_nospill);
movi(rn(reg), i1);
brr_u(cc, i0, r0, rn(reg));
jit_unget_reg(reg);
}
static jit_word_t
_bri_u_p(jit_state_t *_jit, jit_int32_t cc,
jit_word_t i0, jit_int32_t r0, jit_word_t i1)
{
jit_word_t w;
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr|jit_class_nospill);
movi(rn(reg), i1);
w = brr_u_p(cc, i0, r0, rn(reg));
jit_unget_reg(reg);
return (w);
}
static void
_baddr(jit_state_t *_jit, jit_int32_t c, jit_bool_t s,
jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_word_t d;
if (s) addr(r0, r0, r1);
else addcr(r0, r0, r1);
d = (i0 - _jit->pc.w) >> 1;
if (s16_p(d))
BRC(c, x16(d));
else {
assert(s32_p(d));
BRCL(c, d);
}
}
static void
_baddi(jit_state_t *_jit, jit_int32_t c, jit_bool_t s,
jit_word_t i0, jit_int32_t r0, jit_word_t i1)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr|jit_class_nospill);
movi(rn(reg), i1);
baddr(c, s, i0, r0, rn(reg));
jit_unget_reg(reg);
}
static jit_word_t
_baddr_p(jit_state_t *_jit, jit_int32_t c, jit_bool_t s,
jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_word_t d, w;
if (s) addr(r0, r0, r1);
else addcr(r0, r0, r1);
d = (i0 - _jit->pc.w) >> 1;
w = _jit->pc.w;
BRCL(c, d);
return (w);
}
static jit_word_t
_baddi_p(jit_state_t *_jit, jit_int32_t c, jit_bool_t s,
jit_word_t i0, jit_int32_t r0, jit_word_t i1)
{
jit_word_t w;
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr|jit_class_nospill);
movi(rn(reg), i1);
w = baddr_p(c, s, i0, r0, rn(reg));
jit_unget_reg(reg);
return (w);
}
static void
_bsubr(jit_state_t *_jit, jit_int32_t c, jit_bool_t s,
jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_word_t d;
if (s) subr(r0, r0, r1);
else subcr(r0, r0, r1);
d = (i0 - _jit->pc.w) >> 1;
if (s16_p(d))
BRC(c, x16(d));
else {
assert(s32_p(d));
BRCL(c, d);
}
}
static void
_bsubi(jit_state_t *_jit, jit_int32_t c, jit_bool_t s,
jit_word_t i0, jit_int32_t r0, jit_word_t i1)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr|jit_class_nospill);
movi(rn(reg), i1);
bsubr(c, s, i0, r0, rn(reg));
jit_unget_reg(reg);
}
static jit_word_t
_bsubr_p(jit_state_t *_jit, jit_int32_t c, jit_bool_t s,
jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_word_t d, w;
if (s) subr(r0, r0, r1);
else subcr(r0, r0, r1);
d = (i0 - _jit->pc.w) >> 1;
w = _jit->pc.w;
BRCL(c, d);
return (w);
}
static jit_word_t
_bsubi_p(jit_state_t *_jit, jit_int32_t c, jit_bool_t s,
jit_word_t i0, jit_int32_t r0, jit_word_t i1)
{
jit_word_t w;
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr|jit_class_nospill);
movi(rn(reg), i1);
w = bsubr_p(c, s, i0, r0, rn(reg));
jit_unget_reg(reg);
return (w);
}
static void
_bmxr(jit_state_t *_jit, jit_int32_t cc,
jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_word_t d;
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr);
movr(rn(reg), r0);
andr(rn(reg), rn(reg), r1);
TEST_(rn(reg), rn(reg));
jit_unget_reg(reg);
d = (i0 - _jit->pc.w) >> 1;
if (s16_p(d))
BRC(cc, x16(d));
else {
assert(s32_p(d));
BRCL(cc, d);
}
}
static jit_word_t
_bmxr_p(jit_state_t *_jit, jit_int32_t cc,
jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_word_t w;
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr);
movr(rn(reg), r0);
andr(rn(reg), rn(reg), r1);
TEST_(rn(reg), rn(reg));
jit_unget_reg(reg);
w = _jit->pc.w;
BRCL(cc, 0);
return (w);
}
static void
_bmxi(jit_state_t *_jit, jit_int32_t cc,
jit_word_t i0, jit_int32_t r0, jit_word_t i1)
{
jit_word_t d;
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i1);
andr(rn(reg), rn(reg), r0);
TEST_(rn(reg), rn(reg));
jit_unget_reg(reg);
d = (i0 - _jit->pc.w) >> 1;
if (s16_p(d))
BRC(cc, x16(d));
else {
assert(s32_p(d));
BRCL(cc, d);
}
}
static jit_word_t
_bmxi_p(jit_state_t *_jit, jit_int32_t cc,
jit_word_t i0, jit_int32_t r0, jit_word_t i1)
{
jit_word_t w;
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i1);
andr(rn(reg), rn(reg), r0);
TEST_(rn(reg), rn(reg));
jit_unget_reg(reg);
w = _jit->pc.w;
BRCL(cc, 0);
return (w);
}
static void
_movr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
#if __WORDSIZE == 32
if (r0 != r1)
LR(r0, r1);
#else
if (r0 != r1)
LGR(r0, r1);
#endif
}
static void
_movi(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
{
jit_word_t d;
#if __WORDSIZE == 64
jit_int32_t bits;
#endif
d = (i0 - _jit->pc.w) >> 1;
if (s16_p(i0)) {
#if __WORDSIZE == 32
LHI(r0, x16(i0));
#else
LGHI(r0, x16(i0));
#endif
}
/* easy way of loading a large amount of 32 bit values and
* usually address of constants */
else if (!(i0 & 1) &&
#if __WORDSIZE == 32
i0 > 0
#else
s32_p(d)
#endif
)
LARL(r0, d);
else {
#if __WORDSIZE == 32
LHI(r0, x16(i0));
IILH(r0, x16((jit_uword_t)i0 >> 16));
#else
bits = 0;
if (i0 & 0xffffL) bits |= 1;
if (i0 & 0xffff0000L) bits |= 2;
if (i0 & 0xffff00000000L) bits |= 4;
if (i0 & 0xffff000000000000L) bits |= 8;
if (bits != 15) LGHI(r0, 0);
if (bits & 1) IILL(r0, x16(i0));
if (bits & 2) IILH(r0, x16((jit_uword_t)i0 >> 16));
if (bits & 4) IIHL(r0, x16((jit_uword_t)i0 >> 32));
if (bits & 8) IIHH(r0, x16((jit_uword_t)i0 >> 48));
#endif
}
}
static jit_word_t
_movi_p(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
{
jit_word_t w;
w = _jit->pc.w;
#if __WORDSIZE == 32
LHI(r0, x16(i0));
#else
IILL(r0, x16(i0));
#endif
IILH(r0, x16((jit_uword_t)i0 >> 16));
#if __WORDSIZE == 64
IIHL(r0, x16((jit_uword_t)i0 >> 32));
IIHH(r0, x16((jit_uword_t)i0 >> 48));
#endif
return (w);
}
static void
_addr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
if (r0 == r2)
ADD_(r0, r1);
else {
movr(r0, r1);
ADD_(r0, r2);
}
}
static void
_addi(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
if (r0 == r1 && s16_p(i0))
ADDI_(r0, x16(i0));
#if __WORDSIZE == 64
else if (s20_p(i0))
LAY(r0, x20(i0), 0, r1);
#endif
else {
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i0);
addr(r0, r1, rn(reg));
jit_unget_reg(reg);
}
}
static void
_addcr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
if (r0 == r2)
ADDC_(r0, r1);
else {
movr(r0, r1);
ADDC_(r0, r2);
}
}
static void
_addci(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i0);
addcr(r0, r1, rn(reg));
jit_unget_reg(reg);
}
static void
_addxr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
if (r0 == r2)
ADDX_(r0, r1);
else {
movr(r0, r1);
ADDX_(r0, r2);
}
}
static void
_addxi(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i0);
addxr(r0, r1, rn(reg));
jit_unget_reg(reg);
}
static void
_subr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t reg;
if (r0 == r2) {
reg = jit_get_reg(jit_class_gpr);
movr(rn(reg), r2);
movr(r0, r1);
SUB_(r0, rn(reg));
jit_unget_reg(reg);
}
else {
movr(r0, r1);
SUB_(r0, r2);
}
}
static void
_subi(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
if (r0 == r1 && s16_p(-i0))
ADDI_(r0, x16(-i0));
#if __WORDSIZE == 64
else if (s20_p(-i0))
LAY(r0, x20(-i0), 0, r1);
#endif
else {
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i0);
subr(r0, r1, rn(reg));
jit_unget_reg(reg);
}
}
static void
_subcr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t reg;
if (r0 == r2) {
reg = jit_get_reg(jit_class_gpr);
movr(rn(reg), r2);
movr(r0, r1);
SUBC_(r0, rn(reg));
jit_unget_reg(reg);
}
else {
movr(r0, r1);
SUBC_(r0, r2);
}
}
static void
_subci(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i0);
subcr(r0, r1, rn(reg));
jit_unget_reg(reg);
}
static void
_subxr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t reg;
if (r0 == r2) {
reg = jit_get_reg(jit_class_gpr);
movr(rn(reg), r2);
movr(r0, r1);
SUBX_(r0, rn(reg));
jit_unget_reg(reg);
}
else {
movr(r0, r1);
SUBX_(r0, r2);
}
}
static void
_subxi(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i0);
subxr(r0, r1, rn(reg));
jit_unget_reg(reg);
}
static void
_rsbi(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
subi(r0, r1, i0);
negr(r0, r0);
}
static void
_mulr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
if (r0 == r2)
MUL_(r0, r1);
else {
movr(r0, r1);
MUL_(r0, r2);
}
}
static void
_muli(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
if (s16_p(i0)) {
movr(r0, r1);
MULI_(r0, x16(i0));
}
else {
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i0);
mulr(r0, r1, rn(reg));
jit_unget_reg(reg);
}
}
static void
_qmulr(jit_state_t *_jit,
jit_int32_t r0, jit_int32_t r1, jit_int32_t r2, jit_int32_t r3)
{
jit_int32_t reg;
/* The only invalid condition is r0 == r1 */
jit_int32_t t2, t3, s2, s3;
if (r2 == r0 || r2 == r1) {
s2 = jit_get_reg(jit_class_gpr);
t2 = rn(s2);
movr(t2, r2);
}
else
t2 = r2;
if (r3 == r0 || r3 == r1) {
s3 = jit_get_reg(jit_class_gpr);
t3 = rn(s3);
movr(t3, r3);
}
else
t3 = r3;
qmulr_u(r0, r1, r2, r3);
reg = jit_get_reg(jit_class_gpr);
/**/
rshi(rn(reg), t2, 63);
mulr(rn(reg), rn(reg), t3);
addr(r1, r1, rn(reg));
/**/
rshi(rn(reg), t3, 63);
mulr(rn(reg), rn(reg), t2);
addr(r1, r1, rn(reg));
jit_unget_reg(reg);
if (t2 != r2)
jit_unget_reg(s2);
if (t3 != r3)
jit_unget_reg(s3);
}
static void
_qmuli(jit_state_t *_jit,
jit_int32_t r0, jit_int32_t r1, jit_int32_t r2, jit_word_t i0)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i0);
qmulr(r0, r1, r2, rn(reg));
jit_unget_reg(reg);
}
static void
_qmulr_u(jit_state_t *_jit,
jit_int32_t r0, jit_int32_t r1, jit_int32_t r2, jit_int32_t r3)
{
jit_int32_t regno;
regno = jit_get_reg_pair();
movr(rn(regno) + 1, r2);
MULU_(rn(regno), r3);
movr(r0, rn(regno) + 1);
movr(r1, rn(regno));
jit_unget_reg_pair(regno);
}
static void
_qmuli_u(jit_state_t *_jit,
jit_int32_t r0, jit_int32_t r1, jit_int32_t r2, jit_word_t i0)
{
jit_int32_t regno;
regno = jit_get_reg_pair();
movr(rn(regno) + 1, r2);
movi(rn(regno), i0);
MULU_(rn(regno), rn(regno));
movr(r0, rn(regno) + 1);
movr(r1, rn(regno));
jit_unget_reg_pair(regno);
}
static void
_divr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t regno;
regno = xdivr(r1, r2);
movr(r0, rn(regno) + 1);
}
static void
_divi(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t regno;
regno = xdivi(r1, i0);
movr(r0, rn(regno) + 1);
}
static void
_divr_u(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t regno;
regno = xdivr_u(r1, r2);
movr(r0, rn(regno) + 1);
}
static void
_divi_u(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t regno;
regno = xdivi_u(r1, i0);
movr(r0, rn(regno) + 1);
}
static void
_remr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t regno;
regno = xdivr(r1, r2);
movr(r0, rn(regno));
}
static void
_remi(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t regno;
regno = xdivi(r1, i0);
movr(r0, rn(regno));
}
static void
_remr_u(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t regno;
regno = xdivr_u(r1, r2);
movr(r0, rn(regno));
}
static void
_remi_u(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t regno;
regno = xdivi_u(r1, i0);
movr(r0, rn(regno));
}
static void
_qdivr(jit_state_t *_jit,
jit_int32_t r0, jit_int32_t r1, jit_int32_t r2, jit_int32_t r3)
{
jit_int32_t regno;
regno = xdivr(r2, r3);
movr(r0, rn(regno) + 1);
movr(r1, rn(regno));
}
static void
_qdivi(jit_state_t *_jit,
jit_int32_t r0, jit_int32_t r1, jit_int32_t r2, jit_word_t i0)
{
jit_int32_t regno;
regno = xdivi(r2, i0);
movr(r0, rn(regno) + 1);
movr(r1, rn(regno));
}
static void
_qdivr_u(jit_state_t *_jit,
jit_int32_t r0, jit_int32_t r1, jit_int32_t r2, jit_int32_t r3)
{
jit_int32_t regno;
regno = xdivr_u(r2, r3);
movr(r0, rn(regno) + 1);
movr(r1, rn(regno));
}
static void
_qdivi_u(jit_state_t *_jit,
jit_int32_t r0, jit_int32_t r1, jit_int32_t r2, jit_word_t i0)
{
jit_int32_t regno;
regno = xdivi_u(r2, i0);
movr(r0, rn(regno) + 1);
movr(r1, rn(regno));
}
# if __WORDSIZE == 32
static void
_lshr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t reg;
if (r0 == r2) {
reg = jit_get_reg_but_zero(0);
movr(rn(reg), r2);
movr(r0, r1);
SLL(r0, 0, rn(reg));
jit_unget_reg_but_zero(reg);
}
else {
movr(r0, r1);
SLL(r0, 0, r2);
}
}
#endif
static void
_lshi(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
reg = jit_get_reg_but_zero(0);
movi(rn(reg), i0);
lshr(r0, r1, rn(reg));
jit_unget_reg_but_zero(reg);
}
# if __WORDSIZE == 32
static void
_rshr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t reg;
if (r0 == r2) {
reg = jit_get_reg_but_zero(0);
movr(rn(reg), r2);
movr(r0, r1);
SRA(r0, 0, rn(reg));
jit_unget_reg_but_zero(reg);
}
else {
movr(r0, r1);
SRA(r0, 0, r2);
}
}
#endif
static void
_rshi(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
reg = jit_get_reg_but_zero(0);
movi(rn(reg), i0);
rshr(r0, r1, rn(reg));
jit_unget_reg_but_zero(reg);
}
# if __WORDSIZE == 32
static void
_rshr_u(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t reg;
if (r0 == r2) {
reg = jit_get_reg_but_zero(0);
movr(rn(reg), r2);
movr(r0, r1);
SRL(r0, 0, rn(reg));
jit_unget_reg_but_zero(reg);
}
else {
movr(r0, r1);
SRL(r0, 0, r2);
}
}
#endif
static void
_rshi_u(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
reg = jit_get_reg_but_zero(0);
movi(rn(reg), i0);
rshr_u(r0, r1, rn(reg));
jit_unget_reg_but_zero(reg);
}
static void
_comr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), -1);
movr(r0, r1);
XOR_(r0, rn(reg));
jit_unget_reg(reg);
}
static void
_andr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
if (r0 == r2)
AND_(r0, r1);
else {
movr(r0, r1);
AND_(r0, r2);
}
}
static void
_andi(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
movr(r0, r1);
NILL(r0, x16(i0));
NILH(r0, x16((jit_uword_t)i0 >> 16));
#if __WORDSIZE == 64
NIHL(r0, x16((jit_uword_t)i0 >> 32));
NIHH(r0, x16((jit_uword_t)i0 >> 48));
#endif
}
static void
_orr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
if (r0 == r2)
OR_(r0, r1);
else {
movr(r0, r1);
OR_(r0, r2);
}
}
static void
_ori(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
movr(r0, r1);
OILL(r0, x16(i0));
OILH(r0, x16((jit_uword_t)i0 >> 16));
#if __WORDSIZE == 64
OIHL(r0, x16((jit_uword_t)i0 >> 32));
OIHH(r0, x16((jit_uword_t)i0 >> 48));
#endif
}
static void
_xorr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
if (r0 == r2)
XOR_(r0, r1);
else {
movr(r0, r1);
XOR_(r0, r2);
}
}
static void
_xori(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
reg = jit_get_reg(jit_class_gpr);
movi(rn(reg), i0);
xorr(r0, r1, rn(reg));
jit_unget_reg(reg);
}
static void
_ldi_c(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
{
movi(r0, i0);
ldr_c(r0, r0);
}
static void
_ldxr_c(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
if (r0 == r2) {
addr(r0, r0, r1);
ldr_c(r0, r0);
}
else {
movr(r0, r1);
addr(r0, r0, r2);
ldr_c(r0, r0);
}
}
static void
_ldxi_c(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
if (s20_p(i0)) {
#if __WORDSIZE == 32
LB(r0, x20(i0), 0, r1);
#else
LGB(r0, x20(i0), 0, r1);
#endif
}
else if (r0 != r1) {
movi(r0, i0);
addr(r0, r0, r1);
ldr_c(r0, r0);
}
else {
reg = jit_get_reg_but_zero(0);
movi(rn(reg), i0);
addr(rn(reg), rn(reg), r1);
ldr_c(r0, rn(reg));
jit_unget_reg_but_zero(reg);
}
}
static void
_ldi_uc(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
{
movi(r0, i0);
ldr_uc(r0, r0);
}
static void
_ldxr_uc(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
if (r0 == r2) {
addr(r0, r0, r1);
ldr_uc(r0, r0);
}
else {
movr(r0, r1);
addr(r0, r0, r2);
ldr_uc(r0, r0);
}
}
static void
_ldxi_uc(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
if (s20_p(i0))
LLGC(r0, x20(i0), 0, r1);
else if (r0 != r1) {
movi(r0, i0);
addr(r0, r0, r1);
ldr_uc(r0, r0);
}
else {
reg = jit_get_reg_but_zero(0);
movi(rn(reg), i0);
addr(rn(reg), rn(reg), r1);
ldr_uc(r0, rn(reg));
jit_unget_reg_but_zero(reg);
}
}
static void
_ldi_s(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
{
movi(r0, i0);
ldr_s(r0, r0);
}
static void
_ldxr_s(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
if (r0 == r2) {
addr(r0, r0, r1);
ldr_s(r0, r0);
}
else {
movr(r0, r1);
addr(r0, r0, r2);
ldr_s(r0, r0);
}
}
static void
_ldxi_s(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
#if __WORDSIZE == 32
if (u12_p(i0))
LH(r0, i0, 0, r1);
else
#endif
if (s20_p(i0)) {
#if __WORDSIZE == 32
LHY(r0, x20(i0), 0, r1);
#else
LGH(r0, x20(i0), 0, r1);
#endif
}
else if (r0 != r1) {
movi(r0, i0);
addr(r0, r0, r1);
ldr_s(r0, r0);
}
else {
reg = jit_get_reg_but_zero(0);
movi(rn(reg), i0);
addr(rn(reg), rn(reg), r1);
ldr_s(r0, rn(reg));
jit_unget_reg_but_zero(reg);
}
}
static void
_ldi_us(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
{
movi(r0, i0);
ldr_us(r0, r0);
}
static void
_ldxr_us(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
if (r0 == r2) {
addr(r0, r0, r1);
ldr_us(r0, r0);
}
else {
movr(r0, r1);
addr(r0, r0, r2);
ldr_us(r0, r0);
}
}
static void
_ldxi_us(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
if (s20_p(i0))
LLGH(r0, x20(i0), 0, r1);
else if (r0 != r1) {
movi(r0, i0);
addr(r0, r0, r1);
ldr_us(r0, r0);
}
else {
reg = jit_get_reg_but_zero(0);
movi(rn(reg), i0);
addr(rn(reg), rn(reg), r1);
ldr_us(r0, rn(reg));
jit_unget_reg_but_zero(reg);
}
}
static void
_ldi_i(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
{
movi(r0, i0);
ldr_i(r0, r0);
}
static void
_ldxr_i(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
if (r0 == r2) {
addr(r0, r0, r1);
ldr_i(r0, r0);
}
else {
movr(r0, r1);
addr(r0, r0, r2);
ldr_i(r0, r0);
}
}
static void
_ldxi_i(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
if (s20_p(i0))
LGF(r0, x20(i0), 0, r1);
else if (r0 != r1) {
movi(r0, i0);
addr(r0, r0, r1);
ldr_i(r0, r0);
}
else {
reg = jit_get_reg_but_zero(0);
movi(rn(reg), i0);
addr(rn(reg), rn(reg), r1);
ldr_i(r0, rn(reg));
jit_unget_reg_but_zero(reg);
}
}
#if __WORDSIZE == 64
static void
_ldi_ui(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
{
movi(r0, i0);
ldr_ui(r0, r0);
}
static void
_ldxr_ui(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
if (r0 == r2) {
addr(r0, r0, r1);
ldr_ui(r0, r0);
}
else {
movr(r0, r1);
addr(r0, r0, r2);
ldr_ui(r0, r0);
}
}
static void
_ldxi_ui(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
if (s20_p(i0))
LLGF(r0, x20(i0), 0, r1);
else if (r0 != r1) {
movi(r0, i0);
addr(r0, r0, r1);
ldr_ui(r0, r0);
}
else {
reg = jit_get_reg_but_zero(0);
movi(rn(reg), i0);
addr(rn(reg), rn(reg), r1);
ldr_ui(r0, rn(reg));
jit_unget_reg_but_zero(reg);
}
}
static void
_ldi_l(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
{
movi(r0, i0);
ldr_l(r0, r0);
}
static void
_ldxr_l(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
if (r0 == r2) {
addr(r0, r0, r1);
ldr_l(r0, r0);
}
else {
movr(r0, r1);
addr(r0, r0, r2);
ldr_l(r0, r0);
}
}
static void
_ldxi_l(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
jit_int32_t reg;
if (s20_p(i0))
LG(r0, x20(i0), 0, r1);
else if (r0 != r1) {
movi(r0, i0);
addr(r0, r0, r1);
ldr_l(r0, r0);
}
else {
reg = jit_get_reg_but_zero(0);
movi(rn(reg), i0);
addr(rn(reg), rn(reg), r1);
ldr_l(r0, rn(reg));
jit_unget_reg_but_zero(reg);
}
}
#endif
static void
_sti_c(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0)
{
jit_int32_t reg;
reg = jit_get_reg_but_zero(0);
movi(rn(reg), i0);
str_c(rn(reg), r0);
jit_unget_reg_but_zero(reg);
}
static void
_stxr_c(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t reg;
reg = jit_get_reg_but_zero(0);
movr(rn(reg), r0);
addr(rn(reg), rn(reg), r1);
str_c(rn(reg), r2);
jit_unget_reg_but_zero(reg);
}
static void
_stxi_c(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_int32_t reg;
if (u12_p(i0))
STC(r1, i0, 0, r0);
else if (s20_p(i0))
STCY(r1, x20(i0), 0, r0);
else {
reg = jit_get_reg_but_zero(0);
addi(rn(reg), r0, i0);
str_c(rn(reg), r1);
jit_unget_reg_but_zero(reg);
}
}
static void
_sti_s(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0)
{
jit_int32_t reg;
reg = jit_get_reg_but_zero(0);
movi(rn(reg), i0);
str_s(rn(reg), r0);
jit_unget_reg_but_zero(reg);
}
static void
_stxr_s(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t reg;
reg = jit_get_reg_but_zero(0);
movr(rn(reg), r0);
addr(rn(reg), rn(reg), r1);
str_s(rn(reg), r2);
jit_unget_reg_but_zero(reg);
}
static void
_stxi_s(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_int32_t reg;
if (u12_p(i0))
STH(r1, i0, 0, r0);
else if (s20_p(i0))
STHY(r1, x20(i0), 0, r0);
else {
reg = jit_get_reg_but_zero(0);
addi(rn(reg), r0, i0);
str_s(rn(reg), r1);
jit_unget_reg_but_zero(reg);
}
}
static void
_sti_i(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0)
{
jit_int32_t reg;
reg = jit_get_reg_but_zero(0);
movi(rn(reg), i0);
str_i(rn(reg), r0);
jit_unget_reg_but_zero(reg);
}
static void
_stxr_i(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t reg;
reg = jit_get_reg_but_zero(0);
movr(rn(reg), r0);
addr(rn(reg), rn(reg), r1);
str_i(rn(reg), r2);
jit_unget_reg_but_zero(reg);
}
static void
_stxi_i(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_int32_t reg;
if (u12_p(i0))
ST(r1, i0, 0, r0);
else if (s20_p(i0))
STY(r1, x20(i0), 0, r0);
else {
reg = jit_get_reg_but_zero(0);
addi(rn(reg), r0, i0);
str_i(rn(reg), r1);
jit_unget_reg_but_zero(reg);
}
}
#if __WORDSIZE == 64
static void
_sti_l(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0)
{
jit_int32_t reg;
reg = jit_get_reg_but_zero(0);
movi(rn(reg), i0);
str_l(rn(reg), r0);
jit_unget_reg_but_zero(reg);
}
static void
_stxr_l(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_int32_t r2)
{
jit_int32_t reg;
reg = jit_get_reg_but_zero(0);
movr(rn(reg), r0);
addr(rn(reg), rn(reg), r1);
str_l(rn(reg), r2);
jit_unget_reg_but_zero(reg);
}
static void
_stxi_l(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
jit_int32_t reg;
if (s20_p(i0))
STG(r1, x20(i0), 0, r0);
else {
reg = jit_get_reg_but_zero(0);
addi(rn(reg), r0, i0);
str_l(rn(reg), r1);
jit_unget_reg_but_zero(reg);
}
}
#endif
static void
_jmpi(jit_state_t *_jit, jit_word_t i0)
{
jit_word_t d;
jit_int32_t reg;
d = (i0 - _jit->pc.w) >> 1;
if (s16_p(d))
J(x16(d));
else if (s32_p(d))
BRL(d);
else {
reg = jit_get_reg_but_zero(jit_class_nospill);
movi(rn(reg), i0);
jmpr(rn(reg));
jit_unget_reg_but_zero(reg);
}
}
static jit_word_t
_jmpi_p(jit_state_t *_jit, jit_word_t i0)
{
jit_word_t w;
jit_int32_t reg;
reg = jit_get_reg_but_zero(jit_class_nospill);
w = movi_p(rn(reg), i0);
jmpr(rn(reg));
jit_unget_reg_but_zero(reg);
return (w);
}
static void
_calli(jit_state_t *_jit, jit_word_t i0)
{
jit_word_t d;
jit_int32_t reg;
d = (i0 - _jit->pc.w) >> 1;
if (s32_p(d))
BRASL(_R14_REGNO, d);
else {
reg = jit_get_reg_but_zero(0);
movi(rn(reg), i0);
callr(rn(reg));
jit_unget_reg_but_zero(reg);
}
}
static jit_word_t
_calli_p(jit_state_t *_jit, jit_word_t i0)
{
jit_word_t w;
jit_int32_t reg;
reg = jit_get_reg_but_zero(0);
w = movi_p(rn(reg), i0);
callr(rn(reg));
jit_unget_reg_but_zero(reg);
return (w);
}
static jit_int32_t gprs[] = {
_R2, _R3, _R4, _R5,
_R6, _R7, _R8, _R9, _R10, _R11, _R12, _R13
};
static void
_prolog(jit_state_t *_jit, jit_node_t *i0)
{
jit_int32_t regno, offset;
if (_jitc->function->define_frame || _jitc->function->assume_frame) {
jit_int32_t frame = -_jitc->function->frame;
assert(_jitc->function->self.aoff >= frame);
if (_jitc->function->assume_frame)
return;
_jitc->function->self.aoff = frame;
}
if (_jitc->function->allocar)
_jitc->function->self.aoff &= -8;
_jitc->function->stack = ((_jitc->function->self.alen -
/* align stack at 8 bytes */
_jitc->function->self.aoff) + 7) & -8;
/* *IFF* a non variadic function,
* Lightning does not reserve stack space for spilling arguments
* in registers.
* S390x, as per gcc, has 8 stack slots for spilling arguments,
* (%r6 is callee save) and uses an alloca like approach to save
* callee save fpr registers.
* Since argument registers are not saved in any lightning port,
* use the 8 slots to spill any modified fpr register, and still
* use the same stack frame logic as gcc.
* Save at least %r13 to %r15, as %r13 is used as frame pointer.
* *IFF* a variadic function, a "standard" stack frame, with
* fpr registers saved in an alloca'ed area, is used.
*/
if ((_jitc->function->self.call & jit_call_varargs) &&
jit_arg_reg_p(_jitc->function->vagp))
regno = _jitc->function->vagp;
else {
for (regno = 4; regno < jit_size(gprs) - 1; regno++) {
if (jit_regset_tstbit(&_jitc->function->regset, gprs[regno]))
break;
}
}
#if __WORDSIZE == 32
# define FP_OFFSET 64
if (_jitc->function->self.call & jit_call_varargs)
offset = regno * 4 + 8;
else
offset = (regno - 4) * 4 + 32;
STM(rn(gprs[regno]), _R15_REGNO, x20(offset), _R15_REGNO);
#else
# define FP_OFFSET 128
if (_jitc->function->self.call & jit_call_varargs)
offset = regno * 8 + 16;
else
offset = (regno - 4) * 8 + 48;
STMG(rn(gprs[regno]), _R15_REGNO, x20(offset), _R15_REGNO);
#endif
#define SPILL(R, O) \
do { \
if (jit_regset_tstbit(&_jitc->function->regset, R)) \
stxi_d(O, _R15_REGNO, rn(R)); \
} while (0)
if (_jitc->function->self.call & jit_call_varargs) {
for (regno = _jitc->function->vafp; jit_arg_f_reg_p(regno); ++regno)
stxi_d(FP_OFFSET + regno * 8, _R15_REGNO, rn(_F0 - regno));
SPILL(_F8, _jitc->function->vaoff + offsetof(jit_va_list_t, f8));
SPILL(_F9, _jitc->function->vaoff + offsetof(jit_va_list_t, f9));
SPILL(_F10, _jitc->function->vaoff + offsetof(jit_va_list_t, f10));
SPILL(_F11, _jitc->function->vaoff + offsetof(jit_va_list_t, f11));
SPILL(_F12, _jitc->function->vaoff + offsetof(jit_va_list_t, f12));
SPILL(_F13, _jitc->function->vaoff + offsetof(jit_va_list_t, f13));
SPILL(_F14, _jitc->function->vaoff + offsetof(jit_va_list_t, f14));
}
else {
/* First 4 in low address */
#if __WORDSIZE == 32
SPILL(_F10, 0);
SPILL(_F11, 8);
SPILL(_F12, 16);
SPILL(_F13, 24);
/* gpr registers here */
SPILL(_F14, 72);
SPILL(_F8, 80);
SPILL(_F9, 88);
#else
SPILL(_F10, 16);
SPILL(_F11, 24);
SPILL(_F12, 32);
SPILL(_F13, 48);
/* Last 3 in high address */
SPILL(_F14, 136);
SPILL(_F8, 144);
SPILL(_F9, 152);
#endif
}
#undef SPILL
movr(_R13_REGNO, _R15_REGNO);
subi(_R15_REGNO, _R15_REGNO, stack_framesize + _jitc->function->stack);
if (_jitc->function->allocar) {
regno = jit_get_reg(jit_class_gpr);
movi(rn(regno), _jitc->function->self.aoff);
stxi_i(_jitc->function->aoffoff, _R13_REGNO, rn(regno));
jit_unget_reg(regno);
}
}
static void
_epilog(jit_state_t *_jit, jit_node_t *i0)
{
jit_int32_t regno, offset;
if (_jitc->function->assume_frame)
return;
if ((_jitc->function->self.call & jit_call_varargs) &&
jit_arg_reg_p(_jitc->function->vagp))
regno = _jitc->function->vagp;
else {
for (regno = 4; regno < jit_size(gprs) - 1; regno++) {
if (jit_regset_tstbit(&_jitc->function->regset, gprs[regno]))
break;
}
}
#if __WORDSIZE == 32
if (_jitc->function->self.call & jit_call_varargs)
offset = regno * 4 + 8;
else
offset = (regno - 4) * 4 + 32;
#else
if (_jitc->function->self.call & jit_call_varargs)
offset = regno * 8 + 16;
else
offset = (regno - 4) * 8 + 48;
#endif
movr(_R15_REGNO, _R13_REGNO);
#define LOAD(R, O) \
do { \
if (jit_regset_tstbit(&_jitc->function->regset, R)) \
ldxi_d(rn(R), _R15_REGNO, O); \
} while (0)
if (_jitc->function->self.call & jit_call_varargs) {
LOAD(_F8, _jitc->function->vaoff + offsetof(jit_va_list_t, f8));
LOAD(_F9, _jitc->function->vaoff + offsetof(jit_va_list_t, f9));
LOAD(_F10, _jitc->function->vaoff + offsetof(jit_va_list_t, f10));
LOAD(_F11, _jitc->function->vaoff + offsetof(jit_va_list_t, f11));
LOAD(_F12, _jitc->function->vaoff + offsetof(jit_va_list_t, f12));
LOAD(_F13, _jitc->function->vaoff + offsetof(jit_va_list_t, f13));
LOAD(_F14, _jitc->function->vaoff + offsetof(jit_va_list_t, f14));
}
else {
#if __WORDSIZE == 32
LOAD(_F10, 0);
LOAD(_F11, 8);
LOAD(_F12, 16);
LOAD(_F13, 24);
LOAD(_F14, 72);
LOAD(_F8, 80);
LOAD(_F9, 88);
#else
LOAD(_F10, 16);
LOAD(_F11, 24);
LOAD(_F12, 32);
LOAD(_F13, 48);
LOAD(_F14, 136);
LOAD(_F8, 144);
LOAD(_F9, 152);
#endif
}
#undef LOAD
#if __WORDSIZE == 32
LM(rn(gprs[regno]), _R15_REGNO, x20(offset), _R15_REGNO);
#else
LMG(rn(gprs[regno]), _R15_REGNO, x20(offset), _R15_REGNO);
#endif
BR(_R14_REGNO);
}
static void
_vastart(jit_state_t *_jit, jit_int32_t r0)
{
jit_int32_t reg;
assert(_jitc->function->self.call & jit_call_varargs);
/* Return jit_va_list_t in the register argument */
addi(r0, _R13_REGNO, _jitc->function->vaoff);
reg = jit_get_reg(jit_class_gpr);
/* Initialize gp offset in the save area. */
movi(rn(reg), _jitc->function->vagp);
stxi(offsetof(jit_va_list_t, gpoff), r0, rn(reg));
/* Initialize fp offset in the save area. */
movi(rn(reg), _jitc->function->vafp);
stxi(offsetof(jit_va_list_t, fpoff), r0, rn(reg));
/* Initialize overflow pointer to the first stack argument. */
addi(rn(reg), _R13_REGNO, _jitc->function->self.size);
stxi(offsetof(jit_va_list_t, over), r0, rn(reg));
/* Initialize register save area pointer. */
stxi(offsetof(jit_va_list_t, save), r0, _R13_REGNO);
jit_unget_reg(reg);
}
static void
_vaarg(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
jit_int32_t rg0;
jit_int32_t rg1;
jit_int32_t rg2;
jit_word_t ge_code;
jit_word_t lt_code;
assert(_jitc->function->self.call & jit_call_varargs);
rg0 = jit_get_reg_but_zero(0);
rg1 = jit_get_reg_but_zero(0);
/* Load the gp offset in save area in the first temporary. */
ldxi(rn(rg0), r1, offsetof(jit_va_list_t, gpoff));
/* Jump over if there are no remaining arguments in the save area. */
ge_code = bgei_p(_jit->pc.w, rn(rg0), 5);
/* Load the save area pointer in the second temporary. */
ldxi(rn(rg1), r1, offsetof(jit_va_list_t, save));
/* Scale offset */
rg2 = jit_get_reg_but_zero(0);
lshi(rn(rg2), rn(rg0),
#if __WORDSIZE == 32
2
#else
3
#endif
);
/* Add offset to saved area. */
addi(rn(rg2), rn(rg2), 2 * sizeof(jit_word_t));
/* Load the vararg argument in the first argument. */
ldxr(r0, rn(rg1), rn(rg2));
jit_unget_reg_but_zero(rg2);
/* Update the gp offset. */
addi(rn(rg0), rn(rg0), 1);
stxi(offsetof(jit_va_list_t, gpoff), r1, rn(rg0));
/* Will only need one temporary register below. */
jit_unget_reg_but_zero(rg1);
/* Jump over overflow code. */
lt_code = jmpi_p(_jit->pc.w);
/* Where to land if argument is in overflow area. */
patch_at(ge_code, _jit->pc.w);
/* Load overflow pointer. */
ldxi(rn(rg0), r1, offsetof(jit_va_list_t, over));
/* Load argument. */
ldr(r0, rn(rg0));
/* Update overflow pointer. */
addi(rn(rg0), rn(rg0), sizeof(jit_word_t));
stxi(offsetof(jit_va_list_t, over), r1, rn(rg0));
/* Where to land if argument is in save area. */
patch_at(lt_code, _jit->pc.w);
jit_unget_reg_but_zero(rg0);
}
static void
_patch_at(jit_state_t *_jit, jit_word_t instr, jit_word_t label)
{
jit_word_t d;
union {
jit_uint16_t *s;
jit_word_t w;
} u;
u.w = instr;
union {
struct {
jit_uint16_t op : 8;
jit_uint16_t r1 : 4;
jit_uint16_t r3 : 4;
} b;
jit_uint16_t s;
} i0;
union {
struct {
jit_uint16_t i2;
} b;
jit_uint16_t s;
} i1;
union {
struct {
jit_uint32_t ih : 16;
jit_uint32_t il : 16;
} b;
jit_uint32_t i;
} i12;
i0.s = u.s[0];
/* movi_p */
if (i0.b.op ==
#if __WORDSIZE == 32
0xA7 && i0.b.r3 == 8
#else
0xA5
#endif
) {
#if __WORDSIZE == 64
assert(i0.b.r3 == 3);
#endif
i1.b.i2 = (jit_uword_t)label;
u.s[1] = i1.s;
i0.s = u.s[2];
assert(i0.b.op == 0xA5 && i0.b.r3 == 2);
i1.b.i2 = (jit_uword_t)label >> 16;
u.s[3] = i1.s;
#if __WORDSIZE == 64
i0.s = u.s[4];
assert(i0.b.op == 0xA5 && i0.b.r3 == 1);
i1.b.i2 = (jit_uword_t)label >> 32;
u.s[5] = i1.s;
i0.s = u.s[6];
assert(i0.b.op == 0xA5 && i0.b.r3 == 0);
i1.b.i2 = (jit_uword_t)label >> 48;
u.s[7] = i1.s;
#endif
}
/* BRC */
else if (i0.b.op == 0xA7) {
assert(i0.b.r3 == 0x4);
d = (label - instr) >> 1;
assert(s16_p(d));
i1.b.i2 = d;
u.s[1] = i1.s;
}
/* BRCL */
else if (i0.b.op == 0xC0) {
assert(i0.b.r3 == 0x4);
d = (label - instr) >> 1;
assert(s32_p(d));
i12.i = d;
u.s[1] = i12.b.ih;
u.s[2] = i12.b.il;
}
else
abort();
}
#endif
|