aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/riscv/riscv-vector-builtins.cc
blob: b9b9d33adab61b14dc7cc8564013a807a4dbc18a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
/* Builtins implementation for RISC-V 'V' Extension for GNU compiler.
   Copyright (C) 2022-2024 Free Software Foundation, Inc.
   Contributed by Ju-Zhe Zhong (juzhe.zhong@rivai.ai), RiVAI Technologies Ltd.

   This file is part of GCC.

   GCC is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3, or (at your option)
   any later version.

   GCC is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with GCC; see the file COPYING3.  If not see
   <http://www.gnu.org/licenses/>.  */

#define IN_TARGET_CODE 1

#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "tm_p.h"
#include "memmodel.h"
#include "insn-codes.h"
#include "optabs.h"
#include "recog.h"
#include "diagnostic.h"
#include "expr.h"
#include "function.h"
#include "fold-const.h"
#include "gimplify.h"
#include "explow.h"
#include "stor-layout.h"
#include "alias.h"
#include "langhooks.h"
#include "stringpool.h"
#include "attribs.h"
#include "targhooks.h"
#include "regs.h"
#include "emit-rtl.h"
#include "basic-block.h"
#include "gimple.h"
#include "gimple-iterator.h"
#include "riscv-vector-builtins.h"
#include "riscv-vector-builtins-shapes.h"
#include "riscv-vector-builtins-bases.h"
#include "sifive-vector-builtins-bases.h"

using namespace riscv_vector;

namespace riscv_vector {

/* Static information about each vector type.  */
struct vector_type_info
{
  /* The name of the type as declared by riscv_vector.h
     which is recommend to use. For example: 'vint32m1_t'.  */
  const char *name;

  /* ABI name of vector type. The type is always available
     under this name, even when riscv_vector.h isn't included.
     For example:  '__rvv_int32m1_t'.  */
  const char *abi_name;

  /* The C++ mangling of ABI_NAME.  */
  const char *mangled_name;
};

/* Describes a function decl.  */
class GTY (()) registered_function
{
public:
  function_instance GTY ((skip)) instance;

  /* The decl itself.  */
  tree GTY ((skip)) decl;

  /* The overload hash of non-overloaded intrinsic is determined by
     the overload name and argument list. Adding the overload name to
     the hash is also to address the following situations:
     vint16mf4_t  __riscv_vreinterpret_i16mf4 (vfloat16mf4_t src);
     vuint16mf4_t __riscv_vreinterpret_u16mf4 (vfloat16mf4_t src);
     The base, shape and argument list of the vreinterpret instance are
     the same, only the overload name is different. Therefore, it is
     enough to add overload_name and argument list to the hash value.*/
  const char *overload_name;

  /* The argument list part of the hash value. Add the unsigned/signed type
     and machine mode of each argument to the hash value. */
  vec<tree> GTY ((skip)) argument_types;

  /* True if the decl represents an overloaded function that needs to be
     resolved. */
  bool overloaded_p;

  /* The hash value to indicate the non-overloaded function. Generate hash value
     based on overload_name and argument_types. */
  hashval_t overloaded_hash () const;

  /* Generate hash value based on the overload_name and the argument list passed
     by the user when calling. */
  hashval_t overloaded_hash (const vec<tree, va_gc> &);

  /* The required extension for the register function.  */
  enum required_ext required;
};

/* Hash traits for registered_function.  */
struct registered_function_hasher : nofree_ptr_hash<registered_function>
{
  typedef function_instance compare_type;

  static hashval_t hash (value_type);
  static bool equal (value_type, const compare_type &);
};

/* Hash traits for overload registered_function. */
struct non_overloaded_registered_function_hasher
  : nofree_ptr_hash<registered_function>
{
  static hashval_t hash (value_type);
  static bool equal (value_type, const compare_type &);
};

/* Static information about each RVV type.  */
static CONSTEXPR const vector_type_info vector_types[] = {
#define DEF_RVV_TYPE(NAME, NCHARS, ABI_NAME, ARGS...)                          \
  {#NAME, #ABI_NAME, "u" #NCHARS #ABI_NAME},
#define DEF_RVV_TUPLE_TYPE(NAME, NCHARS, ABI_NAME, ARGS...)                    \
  {#NAME, #ABI_NAME, "u" #NCHARS #ABI_NAME},
#include "riscv-vector-builtins.def"
};

/* Static information about operand suffix for each RVV type.  */
const char *const operand_suffixes[NUM_OP_TYPES] = {
  "", /* OP_TYPE_none.  */
#define DEF_RVV_OP_TYPE(NAME) "_" # NAME,
#include "riscv-vector-builtins.def"
};

/* Static information about type suffix for each RVV type.  */
const rvv_builtin_suffixes type_suffixes[NUM_VECTOR_TYPES + 1] = {
#define DEF_RVV_TYPE(NAME, NCHARS, ABI_NAME, SCALAR_TYPE, VECTOR_MODE,         \
		     VECTOR_SUFFIX, SCALAR_SUFFIX, VSETVL_SUFFIX)              \
  {#VECTOR_SUFFIX, #SCALAR_SUFFIX, #VSETVL_SUFFIX},
#define DEF_RVV_TUPLE_TYPE(NAME, NCHARS, ABI_NAME, SUBPART_TYPE, SCALAR_TYPE,  \
			   NF, VECTOR_SUFFIX)                                  \
  {#VECTOR_SUFFIX, "", ""},
#include "riscv-vector-builtins.def"
};

/* Static information about predication suffix for each RVV type.  */
const char *const predication_suffixes[NUM_PRED_TYPES] = {
  "", /* PRED_TYPE_none.  */
#define DEF_RVV_PRED_TYPE(NAME) "_" # NAME,
#include "riscv-vector-builtins.def"
};

/* A list of all signed integer will be registered for intrinsic functions.  */
static const rvv_type_info none_ops[] = {{NUM_VECTOR_TYPES, 0}};

/* A list of all signed integer will be registered for intrinsic functions.  */
static const rvv_type_info i_ops[] = {
#define DEF_RVV_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of all signed integer can be widened will be registered for intrinsic
 * functions.  */
static const rvv_type_info wi_ops[] = {
#define DEF_RVV_WI_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of all unsigned integer can be widened will be registered for
 * intrinsic functions.  */
static const rvv_type_info wu_ops[] = {
#define DEF_RVV_WU_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of all floating-point can be widened will be registered for intrinsic
 * functions.  */
static const rvv_type_info wf_ops[] = {
#define DEF_RVV_WF_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of all signed integer that SEW = 64 require full 'V' extension will be
   registered for intrinsic functions.  */
static const rvv_type_info full_v_i_ops[] = {
#define DEF_RVV_FULL_V_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of all unsigned integer that SEW = 64 require full 'V' extension will
   be registered for intrinsic functions.  */
static const rvv_type_info full_v_u_ops[] = {
#define DEF_RVV_FULL_V_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of all unsigned integer will be registered for intrinsic functions.  */
static const rvv_type_info u_ops[] = {
#define DEF_RVV_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of all signed integer will be registered for intrinsic functions.  */
static const rvv_type_info convert_i_ops[] = {
#define DEF_RVV_CONVERT_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of all unsigned integer will be registered for intrinsic functions.  */
static const rvv_type_info convert_u_ops[] = {
#define DEF_RVV_CONVERT_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of all signed integer will be registered for intrinsic functions.  */
static const rvv_type_info wconvert_i_ops[] = {
#define DEF_RVV_WCONVERT_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of all unsigned integer will be registered for intrinsic functions. */
static const rvv_type_info wconvert_u_ops[] = {
#define DEF_RVV_WCONVERT_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of all floating-point will be registered for intrinsic functions. */
static const rvv_type_info wconvert_f_ops[] = {
#define DEF_RVV_WCONVERT_F_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of all floating-point will be registered for intrinsic functions. */
static const rvv_type_info f32_ops[] = {
#define DEF_RVV_F32_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of all integer will be registered for intrinsic functions.  */
static const rvv_type_info iu_ops[] = {
#define DEF_RVV_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#define DEF_RVV_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of all types will be registered for intrinsic functions.  */
static const rvv_type_info all_ops[] = {
#define DEF_RVV_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#define DEF_RVV_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#define DEF_RVV_F_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of all types will be registered for intrinsic functions.  */
static const rvv_type_info ei16_ops[] = {
#define DEF_RVV_EI16_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of all bool will be registered for intrinsic functions.  */
static const rvv_type_info b_ops[] = {
#define DEF_RVV_B_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of all float will be registered for intrinsic functions.  */
static const rvv_type_info f_ops[] = {
#define DEF_RVV_F_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of Double-Widening signed integer will be registered for intrinsic
 * functions.  */
static const rvv_type_info wexti_ops[] = {
#define DEF_RVV_WEXTI_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of Double-Widening float will be registered for intrinsic functions.
 */
static const rvv_type_info wextf_ops[] = {
#define DEF_RVV_WEXTF_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of Quad-Widening signed integer will be registered for intrinsic
 * functions.  */
static const rvv_type_info qexti_ops[] = {
#define DEF_RVV_QEXTI_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of Oct-Widening signed integer will be registered for intrinsic
 * functions.  */
static const rvv_type_info oexti_ops[] = {
#define DEF_RVV_OEXTI_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of Double-Widening unsigned integer will be registered for intrinsic
 * functions.  */
static const rvv_type_info wextu_ops[] = {
#define DEF_RVV_WEXTU_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of Double-Widening all integer will be registered for intrinsic
 * functions.  */
static const rvv_type_info wextiu_ops[] = {
#define DEF_RVV_WEXTI_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#define DEF_RVV_WEXTU_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of Quad-Widening unsigned integer will be registered for intrinsic
 * functions.  */
static const rvv_type_info qextu_ops[] = {
#define DEF_RVV_QEXTU_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of Oct-Widening unsigned integer will be registered for intrinsic
 * functions.  */
static const rvv_type_info oextu_ops[] = {
#define DEF_RVV_OEXTU_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of eew8 interpret will be registered for intrinsic functions.  */
static const rvv_type_info eew8_interpret_ops[] = {
#define DEF_RVV_EEW8_INTERPRET_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of eew16 interpret will be registered for intrinsic functions.  */
static const rvv_type_info eew16_interpret_ops[] = {
#define DEF_RVV_EEW16_INTERPRET_OPS(TYPE, REQUIRE)                             \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of eew32 interpret will be registered for intrinsic functions.  */
static const rvv_type_info eew32_interpret_ops[] = {
#define DEF_RVV_EEW32_INTERPRET_OPS(TYPE, REQUIRE)                             \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of eew64 interpret will be registered for intrinsic functions.  */
static const rvv_type_info eew64_interpret_ops[] = {
#define DEF_RVV_EEW64_INTERPRET_OPS(TYPE, REQUIRE)                             \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of bool1 interpret will be registered for intrinsic functions.  */
static const rvv_type_info bool1_interpret_ops[] = {
#define DEF_RVV_BOOL1_INTERPRET_OPS(TYPE, REQUIRE)                             \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of bool2 interpret will be registered for intrinsic functions.  */
static const rvv_type_info bool2_interpret_ops[] = {
#define DEF_RVV_BOOL2_INTERPRET_OPS(TYPE, REQUIRE)                             \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of bool4 interpret will be registered for intrinsic functions.  */
static const rvv_type_info bool4_interpret_ops[] = {
#define DEF_RVV_BOOL4_INTERPRET_OPS(TYPE, REQUIRE)                             \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of bool8 interpret will be registered for intrinsic functions.  */
static const rvv_type_info bool8_interpret_ops[] = {
#define DEF_RVV_BOOL8_INTERPRET_OPS(TYPE, REQUIRE)                             \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of bool16 interpret will be registered for intrinsic functions.  */
static const rvv_type_info bool16_interpret_ops[] = {
#define DEF_RVV_BOOL16_INTERPRET_OPS(TYPE, REQUIRE)                            \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of bool32 interpret will be registered for intrinsic functions.  */
static const rvv_type_info bool32_interpret_ops[] = {
#define DEF_RVV_BOOL32_INTERPRET_OPS(TYPE, REQUIRE)                            \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of bool64 interpret will be registered for intrinsic functions.  */
static const rvv_type_info bool64_interpret_ops[] = {
#define DEF_RVV_BOOL64_INTERPRET_OPS(TYPE, REQUIRE)                            \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of vint8m1 interpret will be registered for intrinsic functions.  */
static const rvv_type_info signed_eew8_lmul1_interpret_ops[] = {
#define DEF_RVV_SIGNED_EEW8_LMUL1_INTERPRET_OPS(TYPE, REQUIRE)                 \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of vint16m1 interpret will be registered for intrinsic functions.  */
static const rvv_type_info signed_eew16_lmul1_interpret_ops[] = {
#define DEF_RVV_SIGNED_EEW16_LMUL1_INTERPRET_OPS(TYPE, REQUIRE)                \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of vint32m1 interpret will be registered for intrinsic functions.  */
static const rvv_type_info signed_eew32_lmul1_interpret_ops[] = {
#define DEF_RVV_SIGNED_EEW32_LMUL1_INTERPRET_OPS(TYPE, REQUIRE)                \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of vint64m1 interpret will be registered for intrinsic functions.  */
static const rvv_type_info signed_eew64_lmul1_interpret_ops[] = {
#define DEF_RVV_SIGNED_EEW64_LMUL1_INTERPRET_OPS(TYPE, REQUIRE)                \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of vuint8m1 interpret will be registered for intrinsic functions.  */
static const rvv_type_info unsigned_eew8_lmul1_interpret_ops[] = {
#define DEF_RVV_UNSIGNED_EEW8_LMUL1_INTERPRET_OPS(TYPE, REQUIRE)               \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of vuint16m1 interpret will be registered for intrinsic functions.  */
static const rvv_type_info unsigned_eew16_lmul1_interpret_ops[] = {
#define DEF_RVV_UNSIGNED_EEW16_LMUL1_INTERPRET_OPS(TYPE, REQUIRE)              \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of vuint32m1 interpret will be registered for intrinsic functions.  */
static const rvv_type_info unsigned_eew32_lmul1_interpret_ops[] = {
#define DEF_RVV_UNSIGNED_EEW32_LMUL1_INTERPRET_OPS(TYPE, REQUIRE)              \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of vuint64m1 interpret will be registered for intrinsic functions.  */
static const rvv_type_info unsigned_eew64_lmul1_interpret_ops[] = {
#define DEF_RVV_UNSIGNED_EEW64_LMUL1_INTERPRET_OPS(TYPE, REQUIRE)              \
  {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of x2 vlmul ext will be registered for intrinsic functions.  */
static const rvv_type_info vlmul_ext_x2_ops[] = {
#define DEF_RVV_X2_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of x4 vlmul ext will be registered for intrinsic functions.  */
static const rvv_type_info vlmul_ext_x4_ops[] = {
#define DEF_RVV_X4_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of x8 vlmul ext will be registered for intrinsic functions.  */
static const rvv_type_info vlmul_ext_x8_ops[] = {
#define DEF_RVV_X8_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of x16 vlmul ext will be registered for intrinsic functions.  */
static const rvv_type_info vlmul_ext_x16_ops[] = {
#define DEF_RVV_X16_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of x32 vlmul ext will be registered for intrinsic functions.  */
static const rvv_type_info vlmul_ext_x32_ops[] = {
#define DEF_RVV_X32_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of x64 vlmul ext will be registered for intrinsic functions.  */
static const rvv_type_info vlmul_ext_x64_ops[] = {
#define DEF_RVV_X64_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of LMUL1 will be registered for intrinsic functions.  */
static const rvv_type_info lmul1_ops[] = {
#define DEF_RVV_LMUL1_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of LMUL2 will be registered for intrinsic functions.  */
static const rvv_type_info lmul2_ops[] = {
#define DEF_RVV_LMUL2_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of LMUL4 will be registered for intrinsic functions.  */
static const rvv_type_info lmul4_ops[] = {
#define DEF_RVV_LMUL4_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of Tuple types will be registered for intrinsic functions.  */
static const rvv_type_info tuple_ops[] = {
#define DEF_RVV_TUPLE_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* Below types will be registered for vector-crypto intrinsic functions*/
/* A list of sew32 will be registered for vector-crypto intrinsic functions.  */
static const rvv_type_info crypto_sew32_ops[] = {
#define DEF_RVV_CRYPTO_SEW32_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of sew64 will be registered for vector-crypto intrinsic functions.  */
static const rvv_type_info crypto_sew64_ops[] = {
#define DEF_RVV_CRYPTO_SEW64_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

/* A list of signed integer will be registered for intrinsic
 * functions.  */
static const rvv_type_info qmacc_ops[] = {
#define DEF_RVV_QMACC_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
#include "riscv-vector-builtins-types.def"
  {NUM_VECTOR_TYPES, 0}};

static CONSTEXPR const rvv_arg_type_info rvv_arg_type_info_end
  = rvv_arg_type_info (NUM_BASE_TYPES);

/* A list of args for size_t func () function.  */
static CONSTEXPR const rvv_arg_type_info void_args[] = {rvv_arg_type_info_end};

/* A list of args for size_t func () function.  */
static CONSTEXPR const rvv_arg_type_info end_args[]
  = {rvv_arg_type_info_end};

/* A list of args for size_t func (size_t) function.  */
static CONSTEXPR const rvv_arg_type_info size_args[]
  = {rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};

/* A list of args for vector_type func (const scalar_type *) function.  */
static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr), rvv_arg_type_info_end};

/* A list of args for vector_type func (const scalar_type *, size_t *) function.
 */
static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_size_ptr_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
     rvv_arg_type_info (RVV_BASE_size_ptr), rvv_arg_type_info_end};

/* A list of args for void func (scalar_type *, vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info scalar_ptr_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
     rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (const scalar_type *, ptrdiff_t)
 * function.  */
static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_ptrdiff_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
     rvv_arg_type_info (RVV_BASE_ptrdiff), rvv_arg_type_info_end};

/* A list of args for void func (scalar_type *, ptrdiff_t, vector_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info scalar_ptr_ptrdiff_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
     rvv_arg_type_info (RVV_BASE_ptrdiff), rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (const scalar_type *, eew8_index_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_eew8_index_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
     rvv_arg_type_info (RVV_BASE_eew8_index), rvv_arg_type_info_end};

/* A list of args for vector_type func (const scalar_type *, eew16_index_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_eew16_index_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
     rvv_arg_type_info (RVV_BASE_eew16_index), rvv_arg_type_info_end};

/* A list of args for vector_type func (const scalar_type *, eew32_index_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_eew32_index_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
     rvv_arg_type_info (RVV_BASE_eew32_index), rvv_arg_type_info_end};

/* A list of args for vector_type func (const scalar_type *, eew64_index_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_eew64_index_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
     rvv_arg_type_info (RVV_BASE_eew64_index), rvv_arg_type_info_end};

/* A list of args for void func (scalar_type *, eew8_index_type, vector_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info scalar_ptr_eew8_index_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
     rvv_arg_type_info (RVV_BASE_eew8_index),
     rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};

/* A list of args for void func (scalar_type *, eew16_index_type, vector_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info scalar_ptr_eew16_index_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
     rvv_arg_type_info (RVV_BASE_eew16_index),
     rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};

/* A list of args for void func (scalar_type *, eew32_index_type, vector_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info scalar_ptr_eew32_index_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
     rvv_arg_type_info (RVV_BASE_eew32_index),
     rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};

/* A list of args for void func (scalar_type *, eew64_index_type, vector_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info scalar_ptr_eew64_index_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
     rvv_arg_type_info (RVV_BASE_eew64_index),
     rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info vv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, vector_type, vector_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info vvv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, vector_type, vector_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info vxv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_scalar),
     rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, vector_type, mask_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info vvm_args[]
  = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_mask), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, mask_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info vm_args[]
  = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_mask),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, scalar_type, mask_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info vxm_args[]
  = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_scalar),
     rvv_arg_type_info (RVV_BASE_mask), rvv_arg_type_info_end};

/* A list of args for vector_type func (signed vector_type, unsigned
 * vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info su_vv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_unsigned_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, scalar_type) function.  */
static CONSTEXPR const rvv_arg_type_info vx_args[]
  = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_scalar),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (signed vector_type, unsigned
 * scalar_type) function.  */
static CONSTEXPR const rvv_arg_type_info su_vx_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_unsigned_scalar), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, shift_type) function.  */
static CONSTEXPR const rvv_arg_type_info shift_vv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_shift_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, shift_type) function.  */
static CONSTEXPR const rvv_arg_type_info gather_vv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_unsigned_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, shift_type) function.  */
static CONSTEXPR const rvv_arg_type_info gatherei16_vv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_eew16_index), rvv_arg_type_info_end};

/* A list of args for double demote type func (vector_type, shift_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info shift_wv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_vector),
     rvv_arg_type_info_end};

static CONSTEXPR const rvv_arg_type_info clip_args[]
  = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_scalar),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info v_args[]
  = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info v_x2_trunc_args[]
  = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info v_x4_trunc_args[]
  = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info v_x8_trunc_args[]
  = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info v_x16_trunc_args[]
  = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x16), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info v_x32_trunc_args[]
  = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x32), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info v_x64_trunc_args[]
  = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x64), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, lmul1_type) function.  */
static CONSTEXPR const rvv_arg_type_info vs_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_lmul1_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, widen_lmul1_type) function.
 */
static CONSTEXPR const rvv_arg_type_info wvs_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_widen_lmul1_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info f_v_args[]
  = {rvv_arg_type_info (RVV_BASE_float_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info trunc_f_v_args[]
  = {rvv_arg_type_info (RVV_BASE_double_trunc_float_vector),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info w_v_args[]
  = {rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info bf_w_v_args[]
  = {rvv_arg_type_info (RVV_BASE_double_trunc_bfloat_vector),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info bf_wwvv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_double_trunc_bfloat_vector),
     rvv_arg_type_info (RVV_BASE_double_trunc_bfloat_vector),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info bf_wwxv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_double_trunc_bfloat_scalar),
     rvv_arg_type_info (RVV_BASE_double_trunc_bfloat_vector),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info m_args[]
  = {rvv_arg_type_info (RVV_BASE_mask), rvv_arg_type_info_end};

/* A list of args for vector_type func (scalar_type) function.  */
static CONSTEXPR const rvv_arg_type_info x_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, size) function.  */
static CONSTEXPR const rvv_arg_type_info v_size_args[]
  = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_size),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (double demote_type, size_t) function.  */
static CONSTEXPR const rvv_arg_type_info wv_size_args[]
  = {rvv_arg_type_info (RVV_BASE_double_trunc_vector),
    rvv_arg_type_info (RVV_BASE_size),rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, vector_type, size)
 * function.  */
static CONSTEXPR const rvv_arg_type_info vv_size_args[]
  = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};

/* A list of args for vector_type func (double demote type) function.  */
static CONSTEXPR const rvv_arg_type_info vf2_args[]
  = {rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (double demote type, double demote type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info wvv_args[]
  = {rvv_arg_type_info (RVV_BASE_double_trunc_vector),
     rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, double demote type, double
 * demote type) function.  */
static CONSTEXPR const rvv_arg_type_info wwvv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_double_trunc_vector),
     rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, double demote type, double
 * demote type) function.  */
static CONSTEXPR const rvv_arg_type_info wwxv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_double_trunc_scalar),
     rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, double demote type, double
 * demote type) function.  */
static CONSTEXPR const rvv_arg_type_info su_wwvv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_double_trunc_vector),
     rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_vector),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, double demote type, double
 * demote type) function.  */
static CONSTEXPR const rvv_arg_type_info su_wwxv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_double_trunc_scalar),
     rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_vector),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type, double demote type, double
 * demote type) function.  */
static CONSTEXPR const rvv_arg_type_info us_wwxv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_scalar),
     rvv_arg_type_info (RVV_BASE_double_trunc_vector),
     rvv_arg_type_info_end};

/* A static operand information for vector_type func (vector_type, quad lmul1
 * type, quad half lmul type) function registration. */
static CONSTEXPR const rvv_arg_type_info qqvv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_quad_lmul1_vector),
     rvv_arg_type_info (RVV_BASE_quad_emul_vector), rvv_arg_type_info_end};

static CONSTEXPR const rvv_arg_type_info uqqvv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_quad_lmul1_unsigned_vector),
     rvv_arg_type_info (RVV_BASE_quad_emul_unsigned_vector),
     rvv_arg_type_info_end};

static CONSTEXPR const rvv_arg_type_info su_qqvv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_quad_lmul1_vector),
     rvv_arg_type_info (RVV_BASE_quad_emul_unsigned_vector),
     rvv_arg_type_info_end};

static CONSTEXPR const rvv_arg_type_info us_qqvv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_quad_lmul1_unsigned_vector),
     rvv_arg_type_info (RVV_BASE_quad_emul_vector), rvv_arg_type_info_end};

/* A static operand information for vector_type func (vector_type, quad lmul1
 * type, quad emul type) function registration. */
static CONSTEXPR const rvv_arg_type_info qdvv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_quad_lmul1_vector),
     rvv_arg_type_info (RVV_BASE_quad_fixed_vector), rvv_arg_type_info_end};

static CONSTEXPR const rvv_arg_type_info uqdvv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_quad_lmul1_unsigned_vector),
     rvv_arg_type_info (RVV_BASE_quad_fixed_unsigned_vector),
     rvv_arg_type_info_end};

static CONSTEXPR const rvv_arg_type_info su_qdvv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_quad_lmul1_vector),
     rvv_arg_type_info (RVV_BASE_quad_fixed_unsigned_vector),
     rvv_arg_type_info_end};

static CONSTEXPR const rvv_arg_type_info us_qdvv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_quad_lmul1_unsigned_vector),
     rvv_arg_type_info (RVV_BASE_quad_fixed_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (signed double demote type,
 * unsigneddouble demote type) function.  */
static CONSTEXPR const rvv_arg_type_info su_wvv_args[]
  = {rvv_arg_type_info (RVV_BASE_double_trunc_vector),
     rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (double demote type, double demote type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info wvx_args[]
  = {rvv_arg_type_info (RVV_BASE_double_trunc_vector),
     rvv_arg_type_info (RVV_BASE_double_trunc_scalar), rvv_arg_type_info_end};

/* A list of args for vector_type func (signed double demote type, unsigned
 * double demote type) function.  */
static CONSTEXPR const rvv_arg_type_info su_wvx_args[]
  = {rvv_arg_type_info (RVV_BASE_double_trunc_vector),
     rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_scalar),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (double demote type, double demote type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info wwv_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (double demote type, double demote type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info wwx_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info (RVV_BASE_double_trunc_scalar), rvv_arg_type_info_end};

/* A list of args for vector_type func (quad demote type) function.  */
static CONSTEXPR const rvv_arg_type_info vf4_args[]
  = {rvv_arg_type_info (RVV_BASE_quad_trunc_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (oct demote type) function.  */
static CONSTEXPR const rvv_arg_type_info vf8_args[]
  = {rvv_arg_type_info (RVV_BASE_oct_trunc_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (double demote type) function.  */
static CONSTEXPR const rvv_arg_type_info x_x_v_args[]
  = {rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info x_v_args[]
  = {rvv_arg_type_info (RVV_BASE_signed_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info xu_v_args[]
  = {rvv_arg_type_info (RVV_BASE_unsigned_vector), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info w_x_v_args[]
  = {rvv_arg_type_info (RVV_BASE_double_trunc_signed_vector),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info w_xu_v_args[]
  = {rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_vector),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info ext_x2_vset_args[]
  = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x2),
     rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info ext_x4_vset_args[]
  = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x4),
     rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info ext_x8_vset_args[]
  = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x8),
     rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info ext_x2_vget_args[]
  = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x2),
     rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info ext_x4_vget_args[]
  = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x4),
     rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info ext_x8_vget_args[]
  = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x8),
     rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info tuple_vset_args[]
  = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_size),
     rvv_arg_type_info (RVV_BASE_tuple_subpart), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info tuple_vcreate_args[]
  = {rvv_arg_type_info (RVV_BASE_tuple_subpart), rvv_arg_type_info_end};

/* A list of args for vector_type func (vector_type) function.  */
static CONSTEXPR const rvv_arg_type_info ext_vcreate_args[]
  = {rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info_end};

/* A list of args for vector_type func (const scalar_type *, size_t)
 * function.  */
static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_size_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
     rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};

/* A list of args for vector_type func (const scalar_type *, eew8_index_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_index_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
     rvv_arg_type_info (RVV_BASE_unsigned_vector), rvv_arg_type_info_end};

/* A list of args for void func (scalar_type *, eew8_index_type, vector_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info scalar_ptr_index_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
     rvv_arg_type_info (RVV_BASE_unsigned_vector),
     rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};

/* A list of args for void func (scalar_type *, size_t, vector_type)
 * function.  */
static CONSTEXPR const rvv_arg_type_info scalar_ptr_size_args[]
  = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
     rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info (RVV_BASE_vector),
     rvv_arg_type_info_end};

/* A list of none preds that will be registered for intrinsic functions.  */
static CONSTEXPR const predication_type_index none_preds[]
  = {PRED_TYPE_none, NUM_PRED_TYPES};

/* vop/vop_m/vop_tu/vop_tum/vop_tumu/vop_mu will be registered.  */
static CONSTEXPR const predication_type_index full_preds[]
  = {PRED_TYPE_none, PRED_TYPE_m,  PRED_TYPE_tu,  PRED_TYPE_tum,
     PRED_TYPE_tumu, PRED_TYPE_mu, NUM_PRED_TYPES};

/* vop/vop_m/vop_tu/vop_tum/ will be registered.  */
static CONSTEXPR const predication_type_index no_mu_preds[]
  = {PRED_TYPE_none, PRED_TYPE_m, PRED_TYPE_tu, PRED_TYPE_tum, NUM_PRED_TYPES};

/* vop/vop_tu will be registered.  */
static CONSTEXPR const predication_type_index none_tu_preds[]
  = {PRED_TYPE_none, PRED_TYPE_tu, NUM_PRED_TYPES};

/* vop/vop_m will be registered.  */
static CONSTEXPR const predication_type_index none_m_preds[]
  = {PRED_TYPE_none, PRED_TYPE_m, NUM_PRED_TYPES};

/* vop/vop_m/vop_mu will be registered.  */
static CONSTEXPR const predication_type_index none_m_mu_preds[]
  = {PRED_TYPE_none, PRED_TYPE_m, PRED_TYPE_mu, NUM_PRED_TYPES};

/* A static operand information for size_t func () function registration. */
static CONSTEXPR const rvv_op_info i_none_size_void_ops
  = {i_ops,				/* Types */
     OP_TYPE_none,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_size), /* Return type */
     void_args /* Args */};

/* A static operand information for size_t func (size_t) function registration.
 */
static CONSTEXPR const rvv_op_info i_none_size_size_ops
  = {i_ops,				/* Types */
     OP_TYPE_none,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_size), /* Return type */
     size_args /* Args */};

/* A static operand information for vector_type func () function registration.
 */
static CONSTEXPR const rvv_op_info all_none_void_ops
  = {all_ops,				  /* Types */
     OP_TYPE_none,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     void_args /* Args */};

/* A static operand information for vector_type func (const scalar_type *)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_ops
  = {all_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     scalar_const_ptr_args /* Args */};

/* A static operand information for vector_type func (const scalar_type *)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_size_ptr_ops
  = {all_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     scalar_const_ptr_size_ptr_args /* Args */};

/* A static operand information for void func (scalar_type *, vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_scalar_ptr_ops
  = {all_ops,				/* Types */
     OP_TYPE_v,				/* Suffix */
     rvv_arg_type_info (RVV_BASE_void), /* Return type */
     scalar_ptr_args /* Args */};

/* A static operand information for vector_type func (const scalar_type *)
 * function registration. */
static CONSTEXPR const rvv_op_info b_v_scalar_const_ptr_ops
  = {b_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     scalar_const_ptr_args /* Args */};

/* A static operand information for void func (scalar_type *, vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info b_v_scalar_ptr_ops
  = {b_ops,				/* Types */
     OP_TYPE_v,				/* Suffix */
     rvv_arg_type_info (RVV_BASE_void), /* Return type */
     scalar_ptr_args /* Args */};

/* A static operand information for vector_type func (vector_type, vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info b_mmm_ops
  = {b_ops,				  /* Types */
     OP_TYPE_mm,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vv_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info b_mm_ops
  = {b_ops,				  /* Types */
     OP_TYPE_m,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info u_vm_ops
  = {u_ops,				  /* Types */
     OP_TYPE_m,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     m_args /* Args */};

/* A static operand information for vector_type func ()
 * function registration. */
static CONSTEXPR const rvv_op_info b_m_ops
  = {b_ops,				  /* Types */
     OP_TYPE_m,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     end_args /* Args */};

/* A static operand information for vector_type func ()
 * function registration. */
static CONSTEXPR const rvv_op_info u_v_ops
  = {u_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     end_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info u_vv_ops
  = {u_ops,					/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     v_args /* Args */};

/* A static operand information for unsigned long func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info b_ulong_m_ops
  = {b_ops,					 /* Types */
     OP_TYPE_m,					 /* Suffix */
     rvv_arg_type_info (RVV_BASE_unsigned_long), /* Return type */
     v_args /* Args */};

/* A static operand information for long func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info b_long_m_ops
  = {b_ops,				/* Types */
     OP_TYPE_m,				/* Suffix */
     rvv_arg_type_info (RVV_BASE_long), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (const scalar_type *,
 * ptrdiff_t) function registration. */
static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_ptrdiff_ops
  = {all_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     scalar_const_ptr_ptrdiff_args /* Args */};

/* A static operand information for vector_type func (const scalar_type *,
 * eew8_index_type) function registration. */
static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_eew8_index_ops
  = {all_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     scalar_const_ptr_eew8_index_args /* Args */};

/* A static operand information for vector_type func (const scalar_type *,
 * eew16_index_type) function registration. */
static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_eew16_index_ops
  = {all_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     scalar_const_ptr_eew16_index_args /* Args */};

/* A static operand information for vector_type func (const scalar_type *,
 * eew32_index_type) function registration. */
static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_eew32_index_ops
  = {all_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     scalar_const_ptr_eew32_index_args /* Args */};

/* A static operand information for vector_type func (const scalar_type *,
 * eew64_index_type) function registration. */
static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_eew64_index_ops
  = {all_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     scalar_const_ptr_eew64_index_args /* Args */};

/* A static operand information for void func (scalar_type *, ptrdiff_t,
 * vector_type) function registration. */
static CONSTEXPR const rvv_op_info all_v_scalar_ptr_ptrdiff_ops
  = {all_ops,				/* Types */
     OP_TYPE_v,				/* Suffix */
     rvv_arg_type_info (RVV_BASE_void), /* Return type */
     scalar_ptr_ptrdiff_args /* Args */};

/* A static operand information for void func (scalar_type *, eew8_index_type,
 * vector_type) function registration. */
static CONSTEXPR const rvv_op_info all_v_scalar_ptr_eew8_index_ops
  = {all_ops,				/* Types */
     OP_TYPE_v,				/* Suffix */
     rvv_arg_type_info (RVV_BASE_void), /* Return type */
     scalar_ptr_eew8_index_args /* Args */};

/* A static operand information for void func (scalar_type *, eew16_index_type,
 * vector_type) function registration. */
static CONSTEXPR const rvv_op_info all_v_scalar_ptr_eew16_index_ops
  = {all_ops,				/* Types */
     OP_TYPE_v,				/* Suffix */
     rvv_arg_type_info (RVV_BASE_void), /* Return type */
     scalar_ptr_eew16_index_args /* Args */};

/* A static operand information for void func (scalar_type *, eew32_index_type,
 * vector_type) function registration. */
static CONSTEXPR const rvv_op_info all_v_scalar_ptr_eew32_index_ops
  = {all_ops,				/* Types */
     OP_TYPE_v,				/* Suffix */
     rvv_arg_type_info (RVV_BASE_void), /* Return type */
     scalar_ptr_eew32_index_args /* Args */};

/* A static operand information for void func (scalar_type *, eew64_index_type,
 * vector_type) function registration. */
static CONSTEXPR const rvv_op_info all_v_scalar_ptr_eew64_index_ops
  = {all_ops,				/* Types */
     OP_TYPE_v,				/* Suffix */
     rvv_arg_type_info (RVV_BASE_void), /* Return type */
     scalar_ptr_eew64_index_args /* Args */};

/* A static operand information for vector_type func (vector_type, vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_vvv_ops
  = {iu_ops,				/* Types */
     OP_TYPE_vv,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vv_args /* Args */};

/* A static operand information for vector_type func (vector_type, vector_type,
 * vector_type) function registration. */
static CONSTEXPR const rvv_op_info iu_vvvv_ops
  = {iu_ops,				  /* Types */
     OP_TYPE_vv,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vvv_args /* Args */};

/* A static operand information for vector_type func (vector_type, scalar_type,
 * vector_type) function registration. */
static CONSTEXPR const rvv_op_info iu_vvxv_ops
  = {iu_ops,				  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vxv_args /* Args */};

/* A static operand information for vector_type func (vector_type, vector_type,
 * vector_type) function registration. */
static CONSTEXPR const rvv_op_info f_vvvv_ops
  = {f_ops,				  /* Types */
     OP_TYPE_vv,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vvv_args /* Args */};

/* A static operand information for vector_type func (vector_type, scalar_type,
 * vector_type) function registration. */
static CONSTEXPR const rvv_op_info f_vvfv_ops
  = {f_ops,				  /* Types */
     OP_TYPE_vf,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vxv_args /* Args */};

/* A static operand information for vector_type func (vector_type, vector_type,
 * mask_type) function registration. */
static CONSTEXPR const rvv_op_info iu_vvvm_ops
  = {iu_ops,				  /* Types */
     OP_TYPE_vvm,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vvm_args /* Args */};

/* A static operand information for vector_type func (vector_type, vector_type,
 * mask_type) function registration. */
static CONSTEXPR const rvv_op_info all_vvvm_ops
  = {all_ops,				  /* Types */
     OP_TYPE_vvm,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vvm_args /* Args */};

/* A static operand information for vector_type func (vector_type, vector_type,
 * mask_type) function registration. */
static CONSTEXPR const rvv_op_info all_vvm_ops
  = {all_ops,				  /* Types */
     OP_TYPE_vm,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vm_args /* Args */};

/* A static operand information for vector_type func (vector_type, scalar_type,
 * mask_type) function registration. */
static CONSTEXPR const rvv_op_info iu_vvxm_ops
  = {iu_ops,				  /* Types */
     OP_TYPE_vxm,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vxm_args /* Args */};

/* A static operand information for vector_type func (vector_type, scalar_type,
 * mask_type) function registration. */
static CONSTEXPR const rvv_op_info f_vvfm_ops
  = {f_ops,				  /* Types */
     OP_TYPE_vfm,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vxm_args /* Args */};

/* A static operand information for mask_type func (vector_type, vector_type,
 * mask_type) function registration. */
static CONSTEXPR const rvv_op_info iu_mvvm_ops
  = {iu_ops,				  /* Types */
     OP_TYPE_vvm,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_mask), /* Return type */
     vvm_args /* Args */};

/* A static operand information for mask_type func (vector_type, scalar_type,
 * mask_type) function registration. */
static CONSTEXPR const rvv_op_info iu_mvxm_ops
  = {iu_ops,				  /* Types */
     OP_TYPE_vxm,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_mask), /* Return type */
     vxm_args /* Args */};

/* A static operand information for mask_type func (vector_type, vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_mvv_ops
  = {iu_ops,				/* Types */
     OP_TYPE_vv,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_mask), /* Return type */
     vv_args /* Args */};

/* A static operand information for mask_type func (vector_type, vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info i_mvv_ops
  = {i_ops,				/* Types */
     OP_TYPE_vv,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_mask), /* Return type */
     vv_args /* Args */};

/* A static operand information for mask_type func (vector_type, vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info u_mvv_ops
  = {u_ops,				/* Types */
     OP_TYPE_vv,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_mask), /* Return type */
     vv_args /* Args */};

/* A static operand information for mask_type func (vector_type, vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_mvv_ops
  = {f_ops,				/* Types */
     OP_TYPE_vv,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_mask), /* Return type */
     vv_args /* Args */};

/* A static operand information for mask_type func (vector_type, scalar_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_mvx_ops
  = {iu_ops,				/* Types */
     OP_TYPE_vx,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_mask), /* Return type */
     vx_args /* Args */};

/* A static operand information for mask_type func (vector_type, scalar_type)
 * function registration. */
static CONSTEXPR const rvv_op_info i_mvx_ops
  = {i_ops,				/* Types */
     OP_TYPE_vx,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_mask), /* Return type */
     vx_args /* Args */};

/* A static operand information for mask_type func (vector_type, scalar_type)
 * function registration. */
static CONSTEXPR const rvv_op_info u_mvx_ops
  = {u_ops,				/* Types */
     OP_TYPE_vx,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_mask), /* Return type */
     vx_args /* Args */};

/* A static operand information for mask_type func (vector_type, scalar_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_mvf_ops
  = {f_ops,				/* Types */
     OP_TYPE_vf,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_mask), /* Return type */
     vx_args /* Args */};

/* A static operand information for vector_type func (vector_type, vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info i_vvv_ops
  = {i_ops,				/* Types */
     OP_TYPE_vv,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vv_args /* Args */};

/* A static operand information for vector_type func (vector_type, vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info u_vvv_ops
  = {u_ops,				/* Types */
     OP_TYPE_vv,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vv_args /* Args */};

/* A static operand information for vector_type func (vector_type, vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_vvv_ops
  = {f_ops,				/* Types */
     OP_TYPE_vv,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vv_args /* Args */};

/* A static operand information for vector_type func (vector_type, vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_vvf_ops
  = {f_ops,				/* Types */
     OP_TYPE_vf,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vx_args /* Args */};

/* A static operand information for vector_type func (vector_type, vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info full_v_i_vvv_ops
  = {full_v_i_ops,			/* Types */
     OP_TYPE_vv,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vv_args /* Args */};

/* A static operand information for vector_type func (vector_type, vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info full_v_u_vvv_ops
  = {full_v_u_ops,			/* Types */
     OP_TYPE_vv,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vv_args /* Args */};

/* A static operand information for vector_type func (signed vector_type,
 * unsigned vector_type) function registration. */
static CONSTEXPR const rvv_op_info full_v_i_su_vvv_ops
  = {full_v_i_ops,			  /* Types */
     OP_TYPE_vv,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     su_vv_args /* Args */};

/* A static operand information for vector_type func (vector_type, scalar_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_vvx_ops
  = {iu_ops,				/* Types */
     OP_TYPE_vx,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vx_args /* Args */};

/* A static operand information for vector_type func (vector_type, scalar_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_vvx_ops
  = {all_ops,				  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     v_size_args /* Args */};

/* A static operand information for vector_type func (vector_type, vector_type,
 * scalar_type) function registration. */
static CONSTEXPR const rvv_op_info all_vvvx_ops
  = {all_ops,				  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vv_size_args /* Args */};

/* A static operand information for vector_type func (vector_type, scalar_type)
 * function registration. */
static CONSTEXPR const rvv_op_info i_vvx_ops
  = {i_ops,				/* Types */
     OP_TYPE_vx,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vx_args /* Args */};

/* A static operand information for vector_type func (vector_type, scalar_type)
 * function registration. */
static CONSTEXPR const rvv_op_info u_vvx_ops
  = {u_ops,				/* Types */
     OP_TYPE_vx,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vx_args /* Args */};

/* A static operand information for vector_type func (vector_type, scalar_type)
 * function registration that require full 'V' extension. */
static CONSTEXPR const rvv_op_info full_v_i_vvx_ops
  = {full_v_i_ops,			  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vx_args /* Args */};

/* A static operand information for vector_type func (vector_type, scalar_type)
 * function registration that require full 'V' extension. */
static CONSTEXPR const rvv_op_info full_v_u_vvx_ops
  = {full_v_u_ops,			  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vx_args /* Args */};

/* A static operand information for vector_type func (signed vector_type,
 * unsigned scalar_type) function registration that require full 'V' extension.
 */
static CONSTEXPR const rvv_op_info full_v_i_su_vvx_ops
  = {full_v_i_ops,			  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     su_vx_args /* Args */};

/* A static operand information for vector_type func (vector_type, shift_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_shift_vvv_ops
  = {iu_ops,				/* Types */
     OP_TYPE_vv,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     shift_vv_args /* Args */};

/* A static operand information for scalar_type func (vector_type, size_t)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_x_s_u_ops
  = {iu_ops,          /* Types */
     OP_TYPE_vx,        /* Suffix */
     rvv_arg_type_info (RVV_BASE_scalar), /* Return type */
     v_size_args /* Args */};

/* A static operand information for vector_type func (vector_type, size_t)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_shift_vvx_ops
  = {iu_ops,				  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     v_size_args /* Args */};

/* A static operand information for vector_type func (vector_type, shift_type)
 * function registration. */
static CONSTEXPR const rvv_op_info i_shift_vvv_ops
  = {i_ops,				/* Types */
     OP_TYPE_vv,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     shift_vv_args /* Args */};

/* A static operand information for vector_type func (vector_type, size_t)
 * function registration. */
static CONSTEXPR const rvv_op_info i_shift_vvx_ops
  = {i_ops,				  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     v_size_args /* Args */};

/* A static operand information for vector_type func (vector_type, shift_type)
 * function registration. */
static CONSTEXPR const rvv_op_info u_shift_vvv_ops
  = {u_ops,				/* Types */
     OP_TYPE_vv,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     shift_vv_args /* Args */};

/* A static operand information for vector_type func (vector_type, size_t)
 * function registration. */
static CONSTEXPR const rvv_op_info u_shift_vvx_ops
  = {u_ops,				  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     v_size_args /* Args */};

/* A static operand information for vector_type func (vector_type, index_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_gather_vvv_ops
  = {all_ops,				  /* Types */
     OP_TYPE_vv,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     gather_vv_args /* Args */};

/* A static operand information for vector_type func (vector_type, size_t)
 * function registration. */
static CONSTEXPR const rvv_op_info all_gather_vvx_ops
  = {all_ops,				  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     v_size_args /* Args */};

/* A static operand information for vector_type func (vector_type, index_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_gatherei16_vvv_ops
  = {ei16_ops,				  /* Types */
     OP_TYPE_vv,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     gatherei16_vv_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_v_ops
  = {iu_ops,			/* Types */
     OP_TYPE_v,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     v_args /* Args */};

/* A static operand information for scalar_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_x_s_ops
  = {iu_ops,				  /* Types */
     OP_TYPE_s,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_scalar), /* Return type */
     v_args /* Args */};

/* A static operand information for scalar_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_f_s_ops
  = {f_ops,				  /* Types */
     OP_TYPE_s,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_scalar), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_vs_ops
  = {iu_ops,					/* Types */
     OP_TYPE_vs,				/* Suffix */
     rvv_arg_type_info (RVV_BASE_lmul1_vector), /* Return type */
     vs_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_vs_ops
  = {f_ops,					/* Types */
     OP_TYPE_vs,				/* Suffix */
     rvv_arg_type_info (RVV_BASE_lmul1_vector), /* Return type */
     vs_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info wi_vs_ops
  = {wi_ops,					      /* Types */
     OP_TYPE_vs,				      /* Suffix */
     rvv_arg_type_info (RVV_BASE_widen_lmul1_vector), /* Return type */
     wvs_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info wu_vs_ops
  = {wu_ops,					      /* Types */
     OP_TYPE_vs,				      /* Suffix */
     rvv_arg_type_info (RVV_BASE_widen_lmul1_vector), /* Return type */
     wvs_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info wf_vs_ops
  = {wf_ops,					      /* Types */
     OP_TYPE_vs,				      /* Suffix */
     rvv_arg_type_info (RVV_BASE_widen_lmul1_vector), /* Return type */
     wvs_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_v_ops
  = {f_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_to_u_v_ops
  = {convert_u_ops,			  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     f_v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_to_i_f_v_ops
  = {convert_i_ops,			  /* Types */
     OP_TYPE_f_v,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     f_v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_to_wi_f_v_ops
  = {wconvert_i_ops,			  /* Types */
     OP_TYPE_f_v,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     trunc_f_v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_to_ni_f_w_ops
  = {f_ops,						      /* Types */
     OP_TYPE_f_w,					      /* Suffix */
     rvv_arg_type_info (RVV_BASE_double_trunc_signed_vector), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_to_nu_f_w_ops
  = {f_ops,	  /* Types */
     OP_TYPE_f_w, /* Suffix */
     rvv_arg_type_info (
       RVV_BASE_double_trunc_unsigned_vector), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info i_to_f_x_v_ops
  = {f_ops,				  /* Types */
     OP_TYPE_x_v,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     x_v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info u_to_f_xu_v_ops
  = {f_ops,				  /* Types */
     OP_TYPE_xu_v,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     xu_v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info i_to_wf_x_v_ops
  = {f_ops,				  /* Types */
     OP_TYPE_x_v,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     w_x_v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info u_to_wf_xu_v_ops
  = {f_ops,				  /* Types */
     OP_TYPE_xu_v,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     w_xu_v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info i_to_nf_x_w_ops
  = {wconvert_i_ops,					     /* Types */
     OP_TYPE_x_w,					     /* Suffix */
     rvv_arg_type_info (RVV_BASE_double_trunc_float_vector), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info u_to_nf_xu_w_ops
  = {wconvert_u_ops,					     /* Types */
     OP_TYPE_xu_w,					     /* Suffix */
     rvv_arg_type_info (RVV_BASE_double_trunc_float_vector), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_to_u_f_v_ops
  = {convert_u_ops,			  /* Types */
     OP_TYPE_f_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     f_v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_to_wu_f_v_ops
  = {wconvert_u_ops,			  /* Types */
     OP_TYPE_f_v,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     trunc_f_v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_to_wf_f_v_ops
  = {f_ops,				  /* Types */
     OP_TYPE_f_v,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     w_v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_to_nf_f_w_ops
  = {wconvert_f_ops,					     /* Types */
     OP_TYPE_f_w,					     /* Suffix */
     rvv_arg_type_info (RVV_BASE_double_trunc_float_vector), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f32_to_bf16_f_w_ops
  = {f32_ops,						      /* Types */
     OP_TYPE_f_w,					      /* Suffix */
     rvv_arg_type_info (RVV_BASE_double_trunc_bfloat_vector), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info bf16_to_f32_f_v_ops
  = {f32_ops,				  /* Types */
     OP_TYPE_f_v,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     bf_w_v_args /* Args */};

/* A static operand information for vector_type func (vector_type, double demote
 * type, double demote type) function registration. */
static CONSTEXPR const rvv_op_info f32_wwvv_ops
  = {f32_ops,				  /* Types */
     OP_TYPE_vv,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     bf_wwvv_args /* Args */};

/* A static operand information for vector_type func (vector_type, double demote
 * scalar_type, double demote type) function registration. */
static CONSTEXPR const rvv_op_info f32_wwfv_ops
  = {f32_ops,				  /* Types */
     OP_TYPE_vf,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     bf_wwxv_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_ops
  = {all_ops,			/* Types */
     OP_TYPE_v,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info i_v_u_ops
  = {i_ops,					/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_unsigned_vector), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info u_v_i_ops
  = {u_ops,					/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_signed_vector), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_v_eew8_interpret_ops
  = {eew8_interpret_ops,			  /* Types */
     OP_TYPE_v,					  /* Suffix */
     rvv_arg_type_info (RVV_BASE_eew8_interpret), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_v_eew16_interpret_ops
  = {eew16_interpret_ops,			   /* Types */
     OP_TYPE_v,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_eew16_interpret), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_v_eew32_interpret_ops
  = {eew32_interpret_ops,			   /* Types */
     OP_TYPE_v,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_eew32_interpret), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_v_eew64_interpret_ops
  = {eew64_interpret_ops,			   /* Types */
     OP_TYPE_v,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_eew64_interpret), /* Return type */
     v_args /* Args */};

/* A static operand information for vbool1_t func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_v_bool1_interpret_ops
  = {bool1_interpret_ops,			   /* Types */
     OP_TYPE_v,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_bool1_interpret), /* Return type */
     v_args					   /* Args */};

/* A static operand information for vbool2_t func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_v_bool2_interpret_ops
  = {bool2_interpret_ops,			   /* Types */
     OP_TYPE_v,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_bool2_interpret), /* Return type */
     v_args					   /* Args */};

/* A static operand information for vbool4_t func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_v_bool4_interpret_ops
  = {bool4_interpret_ops,			   /* Types */
     OP_TYPE_v,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_bool4_interpret), /* Return type */
     v_args					   /* Args */};

/* A static operand information for vbool8_t func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_v_bool8_interpret_ops
  = {bool8_interpret_ops,			   /* Types */
     OP_TYPE_v,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_bool8_interpret), /* Return type */
     v_args					   /* Args */};

/* A static operand information for vbool16_t func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_v_bool16_interpret_ops
  = {bool16_interpret_ops,			    /* Types */
     OP_TYPE_v,					    /* Suffix */
     rvv_arg_type_info (RVV_BASE_bool16_interpret), /* Return type */
     v_args					    /* Args */};

/* A static operand information for vbool32_t func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_v_bool32_interpret_ops
  = {bool32_interpret_ops,			    /* Types */
     OP_TYPE_v,					    /* Suffix */
     rvv_arg_type_info (RVV_BASE_bool32_interpret), /* Return type */
     v_args					    /* Args */};

/* A static operand information for vbool64_t func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_v_bool64_interpret_ops
  = {bool64_interpret_ops,			    /* Types */
     OP_TYPE_v,					    /* Suffix */
     rvv_arg_type_info (RVV_BASE_bool64_interpret), /* Return type */
     v_args					    /* Args */};

/* A static operand information for vint8_t func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info b_v_signed_eew8_lmul1_interpret_ops
  = {signed_eew8_lmul1_interpret_ops,			      /* Types */
     OP_TYPE_v,						      /* Suffix */
     rvv_arg_type_info (RVV_BASE_signed_eew8_lmul1_interpret),/* Return type */
     v_args						      /* Args */};

/* A static operand information for vint16_t func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info b_v_signed_eew16_lmul1_interpret_ops
  = {signed_eew16_lmul1_interpret_ops,			       /* Types */
     OP_TYPE_v,						       /* Suffix */
     rvv_arg_type_info (RVV_BASE_signed_eew16_lmul1_interpret),/* Return type */
     v_args						       /* Args */};

/* A static operand information for vint32_t func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info b_v_signed_eew32_lmul1_interpret_ops
  = {signed_eew32_lmul1_interpret_ops,			       /* Types */
     OP_TYPE_v,						       /* Suffix */
     rvv_arg_type_info (RVV_BASE_signed_eew32_lmul1_interpret),/* Return type */
     v_args						       /* Args */};

/* A static operand information for vint64_t func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info b_v_signed_eew64_lmul1_interpret_ops
  = {signed_eew64_lmul1_interpret_ops,			       /* Types */
     OP_TYPE_v,						       /* Suffix */
     rvv_arg_type_info (RVV_BASE_signed_eew64_lmul1_interpret),/* Return type */
     v_args						       /* Args */};

/* A static operand information for vuint8_t func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info b_v_unsigned_eew8_lmul1_interpret_ops
  = {unsigned_eew8_lmul1_interpret_ops,				/* Types */
     OP_TYPE_v,							/* Suffix */
     rvv_arg_type_info (RVV_BASE_unsigned_eew8_lmul1_interpret),/* Return type */
     v_args							/* Args */};

/* A static operand information for vuint16_t func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info b_v_unsigned_eew16_lmul1_interpret_ops
  = {unsigned_eew16_lmul1_interpret_ops,			 /* Types */
     OP_TYPE_v,							 /* Suffix */
     rvv_arg_type_info (RVV_BASE_unsigned_eew16_lmul1_interpret),/* Return type */
     v_args							 /* Args */};

/* A static operand information for vuint32_t func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info b_v_unsigned_eew32_lmul1_interpret_ops
  = {unsigned_eew32_lmul1_interpret_ops,			 /* Types */
     OP_TYPE_v,							 /* Suffix */
     rvv_arg_type_info (RVV_BASE_unsigned_eew32_lmul1_interpret),/* Return type */
     v_args							 /* Args */};

/* A static operand information for vuint64_t func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info b_v_unsigned_eew64_lmul1_interpret_ops
  = {unsigned_eew64_lmul1_interpret_ops,			 /* Types */
     OP_TYPE_v,							 /* Suffix */
     rvv_arg_type_info (RVV_BASE_unsigned_eew64_lmul1_interpret),/* Return type */
     v_args							 /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x2_ops
  = {vlmul_ext_x2_ops,				/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x4_ops
  = {vlmul_ext_x4_ops,				/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x8_ops
  = {vlmul_ext_x8_ops,				/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x16_ops
  = {vlmul_ext_x16_ops,				 /* Types */
     OP_TYPE_v,					 /* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x16), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x32_ops
  = {vlmul_ext_x32_ops,				 /* Types */
     OP_TYPE_v,					 /* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x32), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x64_ops
  = {vlmul_ext_x64_ops,				 /* Types */
     OP_TYPE_v,					 /* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x64), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x2_ops
  = {vlmul_ext_x2_ops,			  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     v_x2_trunc_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x4_ops
  = {vlmul_ext_x4_ops,			  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     v_x4_trunc_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x8_ops
  = {vlmul_ext_x8_ops,			  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     v_x8_trunc_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x16_ops
  = {vlmul_ext_x16_ops,			  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     v_x16_trunc_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x32_ops
  = {vlmul_ext_x32_ops,			  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     v_x32_trunc_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x64_ops
  = {vlmul_ext_x64_ops,			  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     v_x64_trunc_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_v_i_ops
  = {f_ops,					 /* Types */
     OP_TYPE_v,					 /* Suffix */
     rvv_arg_type_info (RVV_BASE_signed_vector), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_v_u_ops
  = {f_ops,					   /* Types */
     OP_TYPE_v,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_unsigned_vector), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info i_v_f_ops
  = {f_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     x_v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info u_v_f_ops
  = {f_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     xu_v_args /* Args */};

/* A static operand information for vector_type func (scalar_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_x_ops
  = {iu_ops,			/* Types */
     OP_TYPE_x,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     x_args /* Args */};

/* A static operand information for vector_type func (scalar_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_s_x_ops
  = {iu_ops,				  /* Types */
     OP_TYPE_x,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     x_args /* Args */};

/* A static operand information for vector_type func (scalar_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_f_ops
  = {f_ops,			/* Types */
     OP_TYPE_f,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     x_args /* Args */};

/* A static operand information for vector_type func (scalar_type)
 * function registration. */
static CONSTEXPR const rvv_op_info f_s_f_ops
  = {f_ops,				  /* Types */
     OP_TYPE_f,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     x_args /* Args */};

/* A static operand information for vector_type func (double demote type)
 * function registration. */
static CONSTEXPR const rvv_op_info i_vf2_ops
  = {wexti_ops,				  /* Types */
     OP_TYPE_vf2,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vf2_args /* Args */};

/* A static operand information for vector_type func (quad demote type)
 * function registration. */
static CONSTEXPR const rvv_op_info i_vf4_ops
  = {qexti_ops,				  /* Types */
     OP_TYPE_vf4,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vf4_args /* Args */};

/* A static operand information for vector_type func (oct demote type)
 * function registration. */
static CONSTEXPR const rvv_op_info i_vf8_ops
  = {oexti_ops,				  /* Types */
     OP_TYPE_vf8,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vf8_args /* Args */};

/* A static operand information for vector_type func (double demote type)
 * function registration. */
static CONSTEXPR const rvv_op_info u_vf2_ops
  = {wextu_ops,				  /* Types */
     OP_TYPE_vf2,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vf2_args /* Args */};

/* A static operand information for vector_type func (quad demote type)
 * function registration. */
static CONSTEXPR const rvv_op_info u_vf4_ops
  = {qextu_ops,				  /* Types */
     OP_TYPE_vf4,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vf4_args /* Args */};

/* A static operand information for vector_type func (oct demote type)
 * function registration. */
static CONSTEXPR const rvv_op_info u_vf8_ops
  = {oextu_ops,				  /* Types */
     OP_TYPE_vf8,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vf8_args /* Args */};

/* A static operand information for vector_type func (double demote type, double
 * demote type) function registration. */
static CONSTEXPR const rvv_op_info i_wvv_ops
  = {wexti_ops,				  /* Types */
     OP_TYPE_vv,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wvv_args /* Args */};

/* A static operand information for vector_type func (double demote type, double
 * demote type) function registration. */
static CONSTEXPR const rvv_op_info f_wvv_ops
  = {wextf_ops,				  /* Types */
     OP_TYPE_vv,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wvv_args /* Args */};

/* A static operand information for vector_type func (vector_type, double demote
 * type, double demote type) function registration. */
static CONSTEXPR const rvv_op_info i_wwvv_ops
  = {wexti_ops,				  /* Types */
     OP_TYPE_vv,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wwvv_args /* Args */};

/* A static operand information for vector_type func (vector_type, double demote
 * scalar_type, double demote type) function registration. */
static CONSTEXPR const rvv_op_info i_wwxv_ops
  = {wexti_ops,				  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wwxv_args /* Args */};

/* A static operand information for vector_type func (vector_type, double demote
 * type, double demote type) function registration. */
static CONSTEXPR const rvv_op_info f_wwvv_ops
  = {wextf_ops,				  /* Types */
     OP_TYPE_vv,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wwvv_args /* Args */};

/* A static operand information for vector_type func (vector_type, double demote
 * scalar_type, double demote type) function registration. */
static CONSTEXPR const rvv_op_info f_wwfv_ops
  = {wextf_ops,				  /* Types */
     OP_TYPE_vf,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wwxv_args /* Args */};

/* A static operand information for vector_type func (vector_type, double demote
 * type, double demote type) function registration. */
static CONSTEXPR const rvv_op_info u_wwvv_ops
  = {wextu_ops,				  /* Types */
     OP_TYPE_vv,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wwvv_args /* Args */};

/* A static operand information for vector_type func (vector_type, double demote
 * scalar_type, double demote type) function registration. */
static CONSTEXPR const rvv_op_info u_wwxv_ops
  = {wextu_ops,				  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wwxv_args /* Args */};

/* A static operand information for vector_type func (vector_type, double demote
 * type, double demote type) function registration. */
static CONSTEXPR const rvv_op_info i_su_wwvv_ops
  = {wexti_ops,				  /* Types */
     OP_TYPE_vv,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     su_wwvv_args /* Args */};

/* A static operand information for vector_type func (vector_type, double demote
 * scalar_type, double demote type) function registration. */
static CONSTEXPR const rvv_op_info i_su_wwxv_ops
  = {wexti_ops,				  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     su_wwxv_args /* Args */};

/* A static operand information for vector_type func (vector_type, double demote
 * scalar_type, double demote type) function registration. */
static CONSTEXPR const rvv_op_info i_us_wwxv_ops
  = {wexti_ops,				  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     us_wwxv_args /* Args */};

/* A static operand information for vector_type func (vector_type, quad demote
 * type, quad demote type) function registration. */
static CONSTEXPR const rvv_op_info i_qqvv_ops
  = {qmacc_ops,				  /* Types */
     OP_TYPE_4x8x4,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     qqvv_args /* Args */};

/* A static operand information for vector_type func (vector_type, quad demote
 * type, quad demote type) function registration. */
static CONSTEXPR const rvv_op_info u_qqvv_ops
  = {qmacc_ops,				  /* Types */
     OP_TYPE_4x8x4,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     uqqvv_args /* Args */};

/* A static operand information for vector_type func (vector_type, quad demote
 * type, quad demote type) function registration. */
static CONSTEXPR const rvv_op_info i_su_qqvv_ops
  = {qmacc_ops,				  /* Types */
     OP_TYPE_4x8x4,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     su_qqvv_args /* Args */};

/* A static operand information for vector_type func (vector_type, quad demote
 * type, quad demote type) function registration. */
static CONSTEXPR const rvv_op_info i_us_qqvv_ops
  = {qmacc_ops,				  /* Types */
     OP_TYPE_4x8x4,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     us_qqvv_args /* Args */};

/* A static operand information for vector_type func (vector_type, quad demote
 * type, quad demote type) function registration. */
static CONSTEXPR const rvv_op_info i_qdvv_ops
  = {qmacc_ops,				  /* Types */
     OP_TYPE_2x8x2,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     qdvv_args /* Args */};

/* A static operand information for vector_type func (vector_type, quad demote
 * type, quad demote type) function registration. */
static CONSTEXPR const rvv_op_info u_qdvv_ops
  = {qmacc_ops,				  /* Types */
     OP_TYPE_2x8x2,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     uqdvv_args /* Args */};

/* A static operand information for vector_type func (vector_type, quad demote
 * type, quad demote type) function registration. */
static CONSTEXPR const rvv_op_info i_su_qdvv_ops
  = {qmacc_ops,				  /* Types */
     OP_TYPE_2x8x2,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     su_qdvv_args /* Args */};

/* A static operand information for vector_type func (vector_type, quad demote
 * type, quad demote type) function registration. */
static CONSTEXPR const rvv_op_info i_us_qdvv_ops
  = {qmacc_ops,				  /* Types */
     OP_TYPE_2x8x2,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     us_qdvv_args /* Args */};

/* A static operand information for vector_type func (signed double demote type,
 * unsigned double demote type) function registration. */
static CONSTEXPR const rvv_op_info i_su_wvv_ops
  = {wexti_ops,				  /* Types */
     OP_TYPE_vv,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     su_wvv_args /* Args */};

/* A static operand information for vector_type func (double demote type, double
 * demote type) function registration. */
static CONSTEXPR const rvv_op_info u_wvv_ops
  = {wextu_ops,				  /* Types */
     OP_TYPE_vv,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wvv_args /* Args */};

/* A static operand information for vector_type func (double demote type, size type)
 * function registration. */
static CONSTEXPR const rvv_op_info u_shift_wvx_ops
  = {wextu_ops,				  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wv_size_args /* Args */};

/* A static operand information for vector_type func (double demote type, double
 * demote scalar_type) function registration. */
static CONSTEXPR const rvv_op_info i_wvx_ops
  = {wexti_ops,				  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wvx_args /* Args */};

/* A static operand information for vector_type func (double demote type, double
 * demote scalar_type) function registration. */
static CONSTEXPR const rvv_op_info f_wvf_ops
  = {wextf_ops,				  /* Types */
     OP_TYPE_vf,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wvx_args /* Args */};

/* A static operand information for vector_type func (signed double demote type,
 * unsigned double demote scalar_type) function registration. */
static CONSTEXPR const rvv_op_info i_su_wvx_ops
  = {wexti_ops,				  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     su_wvx_args /* Args */};

/* A static operand information for vector_type func (vector_type, double
 * demote type) function registration. */
static CONSTEXPR const rvv_op_info i_wwv_ops
  = {wexti_ops,				  /* Types */
     OP_TYPE_wv,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wwv_args /* Args */};

/* A static operand information for vector_type func (vector_type, double
 * demote type) function registration. */
static CONSTEXPR const rvv_op_info f_wwv_ops
  = {wextf_ops,				  /* Types */
     OP_TYPE_wv,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wwv_args /* Args */};

/* A static operand information for vector_type func (vector_type, double
 * demote scalar_type) function registration. */
static CONSTEXPR const rvv_op_info i_wwx_ops
  = {wexti_ops,				  /* Types */
     OP_TYPE_wx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wwx_args /* Args */};

/* A static operand information for vector_type func (vector_type, double
 * demote scalar_type) function registration. */
static CONSTEXPR const rvv_op_info f_wwf_ops
  = {wextf_ops,				  /* Types */
     OP_TYPE_wf,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wwx_args /* Args */};

/* A static operand information for vector_type func (vector_type, double
 * demote type) function registration. */
static CONSTEXPR const rvv_op_info u_wwv_ops
  = {wextu_ops,				  /* Types */
     OP_TYPE_wv,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wwv_args /* Args */};

/* A static operand information for vector_type func (vector_type, double
 * demote scalar_type) function registration. */
static CONSTEXPR const rvv_op_info u_wwx_ops
  = {wextu_ops,				  /* Types */
     OP_TYPE_wx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wwx_args /* Args */};

/* A static operand information for vector_type func (double demote type, double
 * demote scalar_type) function registration. */
static CONSTEXPR const rvv_op_info u_wvx_ops
  = {wextu_ops,				  /* Types */
     OP_TYPE_vx,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     wvx_args /* Args */};

/* A static operand information for vector_type func (double demote type)
 * function registration. */
static CONSTEXPR const rvv_op_info i_x_x_v_ops
  = {wexti_ops,				  /* Types */
     OP_TYPE_x_v,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     x_x_v_args /* Args */};

/* A static operand information for vector_type func (unsigned double demote
 * type) function registration. */
static CONSTEXPR const rvv_op_info u_x_x_v_ops
  = {wextu_ops,				  /* Types */
     OP_TYPE_x_v,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     x_x_v_args /* Args */};

/* A static operand information for double demote type func (vector_type,
 * shift_type) function registration. */
static CONSTEXPR const rvv_op_info i_narrow_shift_vwv_ops
  = {wexti_ops,					       /* Types */
     OP_TYPE_wv,				       /* Suffix */
     rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
     shift_wv_args /* Args */};

/* A static operand information for double demote type func (vector_type,
 * shift_type) function registration. */
static CONSTEXPR const rvv_op_info u_narrow_shift_vwv_ops
  = {wextu_ops,					       /* Types */
     OP_TYPE_wv,				       /* Suffix */
     rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
     shift_wv_args /* Args */};

/* A static operand information for double demote type func (vector_type,
 * size_t) function registration. */
static CONSTEXPR const rvv_op_info i_narrow_shift_vwx_ops
  = {wexti_ops,					       /* Types */
     OP_TYPE_wx,				       /* Suffix */
     rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
     v_size_args /* Args */};

/* A static operand information for double demote type func (vector_type,
 * shift_type) function registration. */
static CONSTEXPR const rvv_op_info u_clip_qf_ops
  = {f32_ops,				      /* Types */
     OP_TYPE_none,			      /* Suffix */
     rvv_arg_type_info (RVV_BASE_eew8_index), /* Return type */
     clip_args /* Args */};

/* A static operand information for double demote type func (vector_type,
 * shift_type) function registration. */
static CONSTEXPR const rvv_op_info i_clip_qf_ops
  = {f32_ops,					     /* Types */
     OP_TYPE_none,				     /* Suffix */
     rvv_arg_type_info (RVV_BASE_signed_eew8_index), /* Return type */
     clip_args /* Args */};

/* A static operand information for double demote type func (vector_type,
 * size_t) function registration. */
static CONSTEXPR const rvv_op_info u_narrow_shift_vwx_ops
  = {wextu_ops,					       /* Types */
     OP_TYPE_wx,				       /* Suffix */
     rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
     v_size_args /* Args */};

/* A static operand information for double demote type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info iu_trunc_ops
  = {wextiu_ops,				       /* Types */
     OP_TYPE_x_w,				       /* Suffix */
     rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
     v_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vset_lmul1_x2_ops
  = {lmul1_ops,					/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
     ext_x2_vset_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vset_lmul1_x4_ops
  = {lmul1_ops,					/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
     ext_x4_vset_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vset_lmul1_x8_ops
  = {lmul1_ops,					/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), /* Return type */
     ext_x8_vset_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vset_lmul2_x2_ops
  = {lmul2_ops,					/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
     ext_x2_vset_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vset_lmul2_x4_ops
  = {lmul2_ops,					/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
     ext_x4_vset_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vset_lmul4_x2_ops
  = {lmul4_ops,					/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
     ext_x2_vset_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vget_lmul1_x2_ops
  = {lmul1_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     ext_x2_vget_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vget_lmul1_x4_ops
  = {lmul1_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     ext_x4_vget_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vget_lmul1_x8_ops
  = {lmul1_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     ext_x8_vget_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vget_lmul2_x2_ops
  = {lmul2_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     ext_x2_vget_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vget_lmul2_x4_ops
  = {lmul2_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     ext_x4_vget_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vget_lmul4_x2_ops
  = {lmul4_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     ext_x2_vget_args /* Args */};

/* A static operand information for size_t func () function registration. */
static CONSTEXPR const rvv_op_info p_none_void_ops
  = {none_ops,				/* Types */
     OP_TYPE_none,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_size), /* Return type */
     void_args /* Args */};

/* A static operand information for unsigned long func () function registration. */
static CONSTEXPR const rvv_op_info ul_none_void_ops
  = {none_ops,				/* Types */
     OP_TYPE_none,			/* Suffix */
     rvv_arg_type_info (RVV_BASE_unsigned_long), /* Return type */
     void_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vset_tuple_ops
  = {tuple_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     tuple_vset_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vget_tuple_ops
  = {tuple_ops,					 /* Types */
     OP_TYPE_v,					 /* Suffix */
     rvv_arg_type_info (RVV_BASE_tuple_subpart), /* Return type */
     v_size_args /* Args */};

/* A static operand information for vector_type func (const scalar_type *)
 * function registration. */
static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_ops
  = {tuple_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     scalar_const_ptr_args /* Args */};

/* A static operand information for void func (scalar_type *, vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_ops
  = {tuple_ops,				/* Types */
     OP_TYPE_v,				/* Suffix */
     rvv_arg_type_info (RVV_BASE_void), /* Return type */
     scalar_ptr_args /* Args */};

/* A static operand information for vector_type func (const scalar_type *,
 * ptrdiff_t) function registration. */
static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_ptrdiff_ops
  = {tuple_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     scalar_const_ptr_ptrdiff_args /* Args */};

/* A static operand information for void func (scalar_type *, ptrdiff_t,
 * vector_type) function registration. */
static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_ptrdiff_ops
  = {tuple_ops,				/* Types */
     OP_TYPE_v,				/* Suffix */
     rvv_arg_type_info (RVV_BASE_void), /* Return type */
     scalar_ptr_ptrdiff_args /* Args */};

/* A static operand information for vector_type func (const scalar_type *,
 * eew8_index_type) function registration. */
static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_eew8_index_ops
  = {tuple_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     scalar_const_ptr_eew8_index_args /* Args */};

/* A static operand information for vector_type func (const scalar_type *,
 * eew16_index_type) function registration. */
static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_eew16_index_ops
  = {tuple_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     scalar_const_ptr_eew16_index_args /* Args */};

/* A static operand information for vector_type func (const scalar_type *,
 * eew32_index_type) function registration. */
static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_eew32_index_ops
  = {tuple_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     scalar_const_ptr_eew32_index_args /* Args */};

/* A static operand information for vector_type func (const scalar_type *,
 * eew64_index_type) function registration. */
static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_eew64_index_ops
  = {tuple_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     scalar_const_ptr_eew64_index_args /* Args */};

/* A static operand information for void func (scalar_type *, eew8_index_type,
 * vector_type) function registration. */
static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_eew8_index_ops
  = {tuple_ops,				/* Types */
     OP_TYPE_v,				/* Suffix */
     rvv_arg_type_info (RVV_BASE_void), /* Return type */
     scalar_ptr_eew8_index_args /* Args */};

/* A static operand information for void func (scalar_type *, eew16_index_type,
 * vector_type) function registration. */
static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_eew16_index_ops
  = {tuple_ops,				/* Types */
     OP_TYPE_v,				/* Suffix */
     rvv_arg_type_info (RVV_BASE_void), /* Return type */
     scalar_ptr_eew16_index_args /* Args */};

/* A static operand information for void func (scalar_type *, eew32_index_type,
 * vector_type) function registration. */
static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_eew32_index_ops
  = {tuple_ops,				/* Types */
     OP_TYPE_v,				/* Suffix */
     rvv_arg_type_info (RVV_BASE_void), /* Return type */
     scalar_ptr_eew32_index_args /* Args */};

/* A static operand information for void func (scalar_type *, eew64_index_type,
 * vector_type) function registration. */
static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_eew64_index_ops
  = {tuple_ops,				/* Types */
     OP_TYPE_v,				/* Suffix */
     rvv_arg_type_info (RVV_BASE_void), /* Return type */
     scalar_ptr_eew64_index_args /* Args */};

/* A static operand information for vector_type func (const scalar_type *)
 * function registration. */
static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_size_ptr_ops
  = {tuple_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     scalar_const_ptr_size_ptr_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vcreate_tuple_ops
  = {tuple_ops,				  /* Types */
     OP_TYPE_v,				  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     tuple_vcreate_args /* Args */};

/* A static operand information for vector_type func () function registration.
 */
static CONSTEXPR const rvv_op_info all_none_void_tuple_ops
  = {tuple_ops,				  /* Types */
     OP_TYPE_none,			  /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     void_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vcreate_lmul1_x2_ops
  = {lmul1_ops,					/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
     ext_vcreate_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vcreate_lmul1_x4_ops
  = {lmul1_ops,					/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
     ext_vcreate_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vcreate_lmul1_x8_ops
  = {lmul1_ops,					/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), /* Return type */
     ext_vcreate_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vcreate_lmul2_x2_ops
  = {lmul2_ops,					/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
     ext_vcreate_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vcreate_lmul2_x4_ops
  = {lmul2_ops,					/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
     ext_vcreate_args /* Args */};

/* A static operand information for vector_type func (vector_type)
 * function registration. */
static CONSTEXPR const rvv_op_info all_v_vcreate_lmul4_x2_ops
  = {lmul4_ops,					/* Types */
     OP_TYPE_v,					/* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
     ext_vcreate_args /* Args */};

/* A static operand information for vector_type func (const scalar_type *,
 * size_t) function registration.  */
static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_size_ops
  = {all_ops,				  /* Types  */
     OP_TYPE_v,				  /* Suffix  */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type  */
     scalar_const_ptr_size_args /* Args */};

/* A static operand information for void func (scalar_type *, size_t,
 * vector_type) function registration.  */
static CONSTEXPR const rvv_op_info all_v_scalar_ptr_size_ops
  = {all_ops,				/* Types  */
     OP_TYPE_v,				/* Suffix  */
     rvv_arg_type_info (RVV_BASE_void), /* Return type  */
     scalar_ptr_size_args /* Args */};

/* A static operand information for vector_type func (const scalar_type *,
 * index_type) function registration.  */
static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_index_ops
  = {all_ops,				  /* Types  */
     OP_TYPE_v,				  /* Suffix  */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type  */
     scalar_const_ptr_index_args /* Args */};

/* A static operand information for void func (scalar_type *, index_type,
 * vector_type) function registration.  */
static CONSTEXPR const rvv_op_info all_v_scalar_ptr_index_ops
  = {all_ops,				/* Types  */
     OP_TYPE_v,				/* Suffix  */
     rvv_arg_type_info (RVV_BASE_void), /* Return type  */
     scalar_ptr_index_args /* Args */};

/* A static operand information for vector_type func (vector_type).
   Some insns just supports SEW=32, such as the crypto vector Zvkg extension.
 * function registration.  */
static CONSTEXPR const rvv_arg_type_info vs_lmul_x2_args[]
  = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x2),
     rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};

static CONSTEXPR const rvv_arg_type_info vs_lmul_x4_args[]
  = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x4),
     rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};

static CONSTEXPR const rvv_arg_type_info vs_lmul_x8_args[]
  = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x8),
     rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};

static CONSTEXPR const rvv_arg_type_info vs_lmul_x16_args[]
  = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x16),
     rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};

static CONSTEXPR const rvv_op_info u_vvv_crypto_sew32_ops
  = {crypto_sew32_ops,			   /* Types */
     OP_TYPE_vv,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vv_args /* Args */};

static CONSTEXPR const rvv_op_info u_vvvv_crypto_sew32_ops
  = {crypto_sew32_ops,			   /* Types */
     OP_TYPE_vv,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vvv_args /* Args */};

static CONSTEXPR const rvv_op_info u_vvv_size_crypto_sew32_ops
  = {crypto_sew32_ops,			   /* Types */
     OP_TYPE_vi,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vv_size_args /* Args */};

static CONSTEXPR const rvv_op_info u_vv_size_crypto_sew32_ops
  = {crypto_sew32_ops,			   /* Types */
     OP_TYPE_vi,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     v_size_args /* Args */};

static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_ops
  = {crypto_sew32_ops,			   /* Types */
     OP_TYPE_vs,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vv_args /* Args */};

static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_lmul_x2_ops
  = {crypto_sew32_ops,			   /* Types */
     OP_TYPE_vs,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
     vs_lmul_x2_args /* Args */};

static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_lmul_x4_ops
  = {crypto_sew32_ops,			   /* Types */
     OP_TYPE_vs,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
     vs_lmul_x4_args /* Args */};

static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_lmul_x8_ops
  = {crypto_sew32_ops,			   /* Types */
     OP_TYPE_vs,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), /* Return type */
     vs_lmul_x8_args /* Args */};

static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_lmul_x16_ops
  = {crypto_sew32_ops,			   /* Types */
     OP_TYPE_vs,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_vlmul_ext_x16), /* Return type */
     vs_lmul_x16_args /* Args */};

/* A static operand information for vector_type func (vector_type).
   Some insns just supports SEW=64, such as the crypto vector Zvbc extension
   vclmul.vv, vclmul.vx.
 * function registration.  */
static CONSTEXPR const rvv_op_info u_vvv_crypto_sew64_ops
  = {crypto_sew64_ops,			   /* Types */
     OP_TYPE_vv,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vv_args /* Args */};

static CONSTEXPR const rvv_op_info u_vvx_crypto_sew64_ops
  = {crypto_sew64_ops,			   /* Types */
     OP_TYPE_vx,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vx_args /* Args */};

static CONSTEXPR const rvv_op_info u_vvvv_crypto_sew64_ops
  = {crypto_sew64_ops,			   /* Types */
     OP_TYPE_vv,					   /* Suffix */
     rvv_arg_type_info (RVV_BASE_vector), /* Return type */
     vvv_args /* Args */};

/* A list of all RVV base function types.  */
static CONSTEXPR const function_type_info function_types[] = {
#define DEF_RVV_TYPE_INDEX(                                                    \
  VECTOR, MASK, SIGNED, UNSIGNED, SIGNED_EEW8_INDEX, EEW8_INDEX, EEW16_INDEX,  \
  EEW32_INDEX, EEW64_INDEX, SHIFT, DOUBLE_TRUNC, QUAD_TRUNC, QUAD_EMUL,        \
  QUAD_EMUL_SIGNED, QUAD_EMUL_UNSIGNED, QUAD_FIX, QUAD_FIX_SIGNED,             \
  QUAD_FIX_UNSIGNED, OCT_TRUNC, DOUBLE_TRUNC_SCALAR, DOUBLE_TRUNC_SIGNED,      \
  DOUBLE_TRUNC_UNSIGNED, DOUBLE_TRUNC_UNSIGNED_SCALAR,                         \
  DOUBLE_TRUNC_BFLOAT_SCALAR, DOUBLE_TRUNC_BFLOAT, DOUBLE_TRUNC_FLOAT, FLOAT,  \
  LMUL1, WLMUL1, QLMUL1, QLMUL1_SIGNED, QLMUL1_UNSIGNED, EEW8_INTERPRET,       \
  EEW16_INTERPRET, EEW32_INTERPRET, EEW64_INTERPRET, BOOL1_INTERPRET,          \
  BOOL2_INTERPRET, BOOL4_INTERPRET, BOOL8_INTERPRET, BOOL16_INTERPRET,         \
  BOOL32_INTERPRET, BOOL64_INTERPRET, SIGNED_EEW8_LMUL1_INTERPRET,             \
  SIGNED_EEW16_LMUL1_INTERPRET, SIGNED_EEW32_LMUL1_INTERPRET,                  \
  SIGNED_EEW64_LMUL1_INTERPRET, UNSIGNED_EEW8_LMUL1_INTERPRET,                 \
  UNSIGNED_EEW16_LMUL1_INTERPRET, UNSIGNED_EEW32_LMUL1_INTERPRET,              \
  UNSIGNED_EEW64_LMUL1_INTERPRET, X2_VLMUL_EXT, X4_VLMUL_EXT, X8_VLMUL_EXT,    \
  X16_VLMUL_EXT, X32_VLMUL_EXT, X64_VLMUL_EXT, TUPLE_SUBPART)                  \
  {                                                                            \
    VECTOR_TYPE_##VECTOR,                                                      \
    VECTOR_TYPE_INVALID,                                                       \
    VECTOR_TYPE_##MASK,                                                        \
    VECTOR_TYPE_##SIGNED,                                                      \
    VECTOR_TYPE_##UNSIGNED,                                                    \
    VECTOR_TYPE_INVALID,                                                       \
    VECTOR_TYPE_INVALID,                                                       \
    VECTOR_TYPE_INVALID,                                                       \
    VECTOR_TYPE_INVALID,                                                       \
    VECTOR_TYPE_INVALID,                                                       \
    VECTOR_TYPE_INVALID,                                                       \
    VECTOR_TYPE_INVALID,                                                       \
    VECTOR_TYPE_INVALID,                                                       \
    VECTOR_TYPE_INVALID,                                                       \
    VECTOR_TYPE_##SIGNED_EEW8_INDEX,                                           \
    VECTOR_TYPE_##EEW8_INDEX,                                                  \
    VECTOR_TYPE_##EEW16_INDEX,                                                 \
    VECTOR_TYPE_##EEW32_INDEX,                                                 \
    VECTOR_TYPE_##EEW64_INDEX,                                                 \
    VECTOR_TYPE_##SHIFT,                                                       \
    VECTOR_TYPE_##DOUBLE_TRUNC,                                                \
    VECTOR_TYPE_##QUAD_TRUNC,                                                  \
    VECTOR_TYPE_##QUAD_EMUL,                                                   \
    VECTOR_TYPE_##QUAD_EMUL_SIGNED,                                            \
    VECTOR_TYPE_##QUAD_EMUL_UNSIGNED,                                          \
    VECTOR_TYPE_##QUAD_FIX,                                                    \
    VECTOR_TYPE_##QUAD_FIX_SIGNED,                                             \
    VECTOR_TYPE_##QUAD_FIX_UNSIGNED,                                           \
    VECTOR_TYPE_##OCT_TRUNC,                                                   \
    VECTOR_TYPE_##DOUBLE_TRUNC_SCALAR,                                         \
    VECTOR_TYPE_##DOUBLE_TRUNC_SIGNED,                                         \
    VECTOR_TYPE_##DOUBLE_TRUNC_UNSIGNED,                                       \
    VECTOR_TYPE_##DOUBLE_TRUNC_UNSIGNED_SCALAR,                                \
    VECTOR_TYPE_##DOUBLE_TRUNC_BFLOAT_SCALAR,                                  \
    VECTOR_TYPE_##DOUBLE_TRUNC_BFLOAT,                                         \
    VECTOR_TYPE_##DOUBLE_TRUNC_FLOAT,                                          \
    VECTOR_TYPE_##FLOAT,                                                       \
    VECTOR_TYPE_##LMUL1,                                                       \
    VECTOR_TYPE_##WLMUL1,                                                      \
    VECTOR_TYPE_##QLMUL1,                                                      \
    VECTOR_TYPE_##QLMUL1_SIGNED,                                               \
    VECTOR_TYPE_##QLMUL1_UNSIGNED,                                             \
    VECTOR_TYPE_##EEW8_INTERPRET,                                              \
    VECTOR_TYPE_##EEW16_INTERPRET,                                             \
    VECTOR_TYPE_##EEW32_INTERPRET,                                             \
    VECTOR_TYPE_##EEW64_INTERPRET,                                             \
    VECTOR_TYPE_##BOOL1_INTERPRET,                                             \
    VECTOR_TYPE_##BOOL2_INTERPRET,                                             \
    VECTOR_TYPE_##BOOL4_INTERPRET,                                             \
    VECTOR_TYPE_##BOOL8_INTERPRET,                                             \
    VECTOR_TYPE_##BOOL16_INTERPRET,                                            \
    VECTOR_TYPE_##BOOL32_INTERPRET,                                            \
    VECTOR_TYPE_##BOOL64_INTERPRET,                                            \
    VECTOR_TYPE_##SIGNED_EEW8_LMUL1_INTERPRET,                                 \
    VECTOR_TYPE_##SIGNED_EEW16_LMUL1_INTERPRET,                                \
    VECTOR_TYPE_##SIGNED_EEW32_LMUL1_INTERPRET,                                \
    VECTOR_TYPE_##SIGNED_EEW64_LMUL1_INTERPRET,                                \
    VECTOR_TYPE_##UNSIGNED_EEW8_LMUL1_INTERPRET,                               \
    VECTOR_TYPE_##UNSIGNED_EEW16_LMUL1_INTERPRET,                              \
    VECTOR_TYPE_##UNSIGNED_EEW32_LMUL1_INTERPRET,                              \
    VECTOR_TYPE_##UNSIGNED_EEW64_LMUL1_INTERPRET,                              \
    VECTOR_TYPE_##X2_VLMUL_EXT,                                                \
    VECTOR_TYPE_##X4_VLMUL_EXT,                                                \
    VECTOR_TYPE_##X8_VLMUL_EXT,                                                \
    VECTOR_TYPE_##X16_VLMUL_EXT,                                               \
    VECTOR_TYPE_##X32_VLMUL_EXT,                                               \
    VECTOR_TYPE_##X64_VLMUL_EXT,                                               \
    VECTOR_TYPE_INVALID,                                                       \
    VECTOR_TYPE_##TUPLE_SUBPART,                                               \
  },
#include "riscv-vector-builtins.def"
}; // namespace riscv_vector

/* A list of all RVV intrinsic functions.  */
static function_group_info function_groups[] = {
#define DEF_RVV_FUNCTION(NAME, SHAPE, PREDS, OPS_INFO)                         \
  {#NAME, &bases::NAME, &shapes::SHAPE, PREDS, OPS_INFO, REQUIRED_EXTENSIONS},
#include "riscv-vector-builtins-functions.def"
#undef DEF_RVV_FUNCTION
#define DEF_RVV_FUNCTION(NAME, SHAPE, PREDS, OPS_INFO)                         \
  {#NAME, &bases::NAME, &shapes::SHAPE, PREDS, OPS_INFO, REQUIRED_EXTENSIONS},
#include "thead-vector-builtins-functions.def"
#define DEF_RVV_FUNCTION(NAME, SHAPE, PREDS, OPS_INFO)                         \
  {#NAME, &bases::NAME, &shapes::SHAPE, PREDS, OPS_INFO, REQUIRED_EXTENSIONS},
#include "sifive-vector-builtins-functions.def"
};

/* The RVV types, with their built-in
   "__rvv..._t" name.  Allow an index of NUM_VECTOR_TYPES, which always
   yields a null tree.  */
static GTY (()) tree abi_vector_types[NUM_VECTOR_TYPES + 1];

/* Same, but with the riscv_vector.h "v..._t" name.  */
extern GTY (()) rvv_builtin_types_t builtin_types[NUM_VECTOR_TYPES + 1];
rvv_builtin_types_t builtin_types[NUM_VECTOR_TYPES + 1];

/* The list of all registered function decls, indexed by code.  */
static GTY (()) vec<registered_function *, va_gc> *registered_functions;

/* All registered function decls, hashed on the function_instance
   that they implement.  This is used for looking up implementations of
   overloaded functions.  */
static hash_table<registered_function_hasher> *function_table;

/* All registered function decls, hashed on overload_name and argument list
   of the registered_function.  This is used for looking up implementations
   of non-overloaded functions. */
static hash_table<non_overloaded_registered_function_hasher>
  *non_overloaded_function_table;

/* RAII class for enabling enough RVV features to define the built-in
   types and implement the riscv_vector.h pragma.

   Note: According to 'TYPE_MODE' macro implementation, we need set
   have_regs_of_mode[mode] to be true if we want to get the exact mode
   from 'TYPE_MODE'. However, have_regs_of_mode has not been set yet in
   targetm.init_builtins (). We need rvv_switcher to set have_regs_of_mode
   before targetm.init_builtins () and recover back have_regs_of_mode
   after targetm.init_builtins ().  */
class rvv_switcher
{
public:
  rvv_switcher ();
  ~rvv_switcher ();

private:
  bool m_old_have_regs_of_mode[MAX_MACHINE_MODE];
};

rvv_switcher::rvv_switcher ()
{
  /* Set have_regs_of_mode before targetm.init_builtins ().  */
  memcpy (m_old_have_regs_of_mode, have_regs_of_mode,
	  sizeof (have_regs_of_mode));
  for (int i = 0; i < NUM_MACHINE_MODES; ++i)
    if (riscv_v_ext_vector_mode_p ((machine_mode) i))
      have_regs_of_mode[i] = true;
}

rvv_switcher::~rvv_switcher ()
{
  /* Recover back have_regs_of_mode.  */
  memcpy (have_regs_of_mode, m_old_have_regs_of_mode,
	  sizeof (have_regs_of_mode));
}

/* Add attribute NAME to ATTRS.  */
static tree
add_attribute (const char *name, tree attrs)
{
  return tree_cons (get_identifier (name), NULL_TREE, attrs);
}

/* Add type attributes to builtin type tree, currently only the mangled name. */
static void
add_vector_type_attribute (tree type, const char *mangled_name)
{
  tree mangled_name_tree = get_identifier (mangled_name);
  tree value = tree_cons (NULL_TREE, mangled_name_tree, NULL_TREE);
  TYPE_ATTRIBUTES (type)
    = tree_cons (get_identifier ("RVV type"), value, TYPE_ATTRIBUTES (type));
}

/* Force TYPE to be a sizeless type.  */
static void
make_type_sizeless (tree type)
{
  TYPE_ATTRIBUTES (type) = tree_cons (get_identifier ("RVV sizeless type"),
				      NULL_TREE, TYPE_ATTRIBUTES (type));
}

/* Return true if TYPE is a sizeless type.  */
static bool
sizeless_type_p (const_tree type)
{
  if (type == error_mark_node)
    return NULL_TREE;
  return lookup_attribute ("RVV sizeless type", TYPE_ATTRIBUTES (type));
}

/* If TYPE is an ABI-defined RVV type, return its attribute descriptor,
   otherwise return null.  */
tree
lookup_vector_type_attribute (const_tree type)
{
  if (type == error_mark_node)
    return NULL_TREE;
  return lookup_attribute ("RVV type", TYPE_ATTRIBUTES (type));
}

/* Return a representation of "const T *".  */
static tree
build_const_pointer (tree t)
{
  return build_pointer_type (build_qualified_type (t, TYPE_QUAL_CONST));
}

/* Helper function for register a single built-in RVV ABI type.  */
static void
register_builtin_type (vector_type_index type, tree eltype, machine_mode mode)
{
  builtin_types[type].scalar = eltype;
  builtin_types[type].scalar_ptr = build_pointer_type (eltype);
  builtin_types[type].scalar_const_ptr = build_const_pointer (eltype);
  /* TODO: We currently just skip the register of the illegal RVV type.
     Ideally, we should report error message more friendly instead of
     reporting "unknown" type. Support more friendly error message in
     the future.  */
  if (!riscv_v_ext_vector_mode_p (mode))
    return;

  tree vectype = build_vector_type_for_mode (eltype, mode);
  gcc_assert (VECTOR_MODE_P (TYPE_MODE (vectype)) && TYPE_MODE (vectype) == mode
	      && TYPE_MODE_RAW (vectype) == mode && TYPE_ALIGN (vectype) <= 128
	      && known_eq (tree_to_poly_uint64 (TYPE_SIZE (vectype)),
			   GET_MODE_BITSIZE (mode)));
  vectype = build_distinct_type_copy (vectype);
  gcc_assert (vectype == TYPE_MAIN_VARIANT (vectype));
  SET_TYPE_STRUCTURAL_EQUALITY (vectype);
  TYPE_ARTIFICIAL (vectype) = 1;
  TYPE_INDIVISIBLE_P (vectype) = 1;
  add_vector_type_attribute (vectype, vector_types[type].mangled_name);
  make_type_sizeless (vectype);
  abi_vector_types[type] = vectype;
  lang_hooks.types.register_builtin_type (vectype, vector_types[type].abi_name);
}

/* Register the tuple type that contains NUM_VECTORS vectors of type TYPE.  */
static void
register_tuple_type (vector_type_index type, vector_type_index subpart_type,
		     tree eltype, unsigned int nf)
{
  /* TODO: We currently just skip the register of the illegal RVV type.
    Ideally, we should report error message more friendly instead of
    reporting "unknown" type. Support more friendly error message in
    the future.  */
  if (!abi_vector_types[subpart_type])
    return;
  tree tuple_type = lang_hooks.types.make_type (RECORD_TYPE);

  /* The contents of the type are opaque, so we can define them in any
     way that maps to the correct ABI type.

     Here we choose to use the same layout as for riscv_vector.h, with
     "__val":

	struct vfooxN_t { vfoo_t __val[N]; };

     (It wouldn't be possible to write that directly in C or C++ for
     sizeless types, but that's not a problem for this function.)

     Using arrays simplifies the handling of vget and vset for variable
     arguments.  */
  tree array_type = build_array_type_nelts (abi_vector_types[subpart_type], nf);
  gcc_assert (array_type);
  gcc_assert (VECTOR_MODE_P (TYPE_MODE (array_type))
	      && TYPE_MODE_RAW (array_type) == TYPE_MODE (array_type));

  tree field = build_decl (input_location, FIELD_DECL, get_identifier ("__val"),
			   array_type);
  DECL_FIELD_CONTEXT (field) = tuple_type;
  TYPE_FIELDS (tuple_type) = field;
  add_vector_type_attribute (tuple_type, vector_types[type].mangled_name);
  make_type_sizeless (tuple_type);
  layout_type (tuple_type);
  gcc_assert (VECTOR_MODE_P (TYPE_MODE (tuple_type))
	      && TYPE_MODE_RAW (tuple_type) == TYPE_MODE (tuple_type));

  tree decl
    = build_decl (input_location, TYPE_DECL,
		  get_identifier (vector_types[type].abi_name), tuple_type);
  TYPE_NAME (tuple_type) = decl;
  TYPE_STUB_DECL (tuple_type) = decl;
  lang_hooks.decls.pushdecl (decl);
  /* ??? Undo the effect of set_underlying_type for C.  The C frontend
     doesn't recognize DECL as a built-in because (as intended) the decl has
     a real location instead of BUILTINS_LOCATION.  The frontend therefore
     treats the decl like a normal C "typedef struct foo foo;", expecting
     the type for tag "struct foo" to have a dummy unnamed TYPE_DECL instead
     of the named one we attached above.  It then sets DECL_ORIGINAL_TYPE
     on the supposedly unnamed decl, creating a circularity that upsets
     dwarf2out.

     We don't want to follow the normal C model and create "struct foo"
     tags for tuple types since (a) the types are supposed to be opaque
     and (b) they couldn't be defined as a real struct anyway.  Treating
     the TYPE_DECLs as "typedef struct foo foo;" without creating
     "struct foo" would lead to confusing error messages.  */
  DECL_ORIGINAL_TYPE (decl) = NULL_TREE;

  builtin_types[type].scalar = eltype;
  builtin_types[type].scalar_ptr = build_pointer_type (eltype);
  builtin_types[type].scalar_const_ptr = build_const_pointer (eltype);
  abi_vector_types[type] = tuple_type;
}

/* Register the built-in RVV ABI types, such as __rvv_int32m1_t.  */
static void
register_builtin_types ()
{
  /* Get type node from get_typenode_from_name to prevent we have different type
     node define in different target libraries, e.g. int32_t defined as
     `long` in RV32/newlib-stdint, but `int` for RV32/glibc-stdint.h.
     NOTE: uint[16|32|64]_type_node already defined in tree.h.  */
  tree int8_type_node = get_typenode_from_name (INT8_TYPE);
  tree uint8_type_node = get_typenode_from_name (UINT8_TYPE);
  tree int16_type_node = get_typenode_from_name (INT16_TYPE);
  tree int32_type_node = get_typenode_from_name (INT32_TYPE);
  tree int64_type_node = get_typenode_from_name (INT64_TYPE);

  machine_mode mode;
#define DEF_RVV_TYPE(NAME, NCHARS, ABI_NAME, SCALAR_TYPE, VECTOR_MODE,         \
		     ARGS...)                                                  \
  mode = VECTOR_MODE##mode;                                                    \
  register_builtin_type (VECTOR_TYPE_##NAME, SCALAR_TYPE##_type_node, mode);
#define DEF_RVV_TUPLE_TYPE(NAME, NCHARS, ABI_NAME, SUBPART_TYPE, SCALAR_TYPE,  \
			   NF, VECTOR_SUFFIX)                                  \
  register_tuple_type (VECTOR_TYPE_##NAME, VECTOR_TYPE_##SUBPART_TYPE,         \
		       SCALAR_TYPE##_type_node, NF);
#include "riscv-vector-builtins.def"
}

/* Similar as register_builtin_types but perform the registration if and
   only if the element of abi_vector_type is NULL_TREE.  */
static void
register_builtin_types_on_null ()
{
  /* Get type node from get_typenode_from_name to prevent we have different type
     node define in different target libraries, e.g. int32_t defined as
     `long` in RV32/newlib-stdint, but `int` for RV32/glibc-stdint.h.
     NOTE: uint[16|32|64]_type_node already defined in tree.h.  */
  tree int8_type_node = get_typenode_from_name (INT8_TYPE);
  tree uint8_type_node = get_typenode_from_name (UINT8_TYPE);
  tree int16_type_node = get_typenode_from_name (INT16_TYPE);
  tree int32_type_node = get_typenode_from_name (INT32_TYPE);
  tree int64_type_node = get_typenode_from_name (INT64_TYPE);

  machine_mode mode;
#define DEF_RVV_TYPE(NAME, NCHARS, ABI_NAME, SCALAR_TYPE, VECTOR_MODE,         \
		     ARGS...)                                                  \
  mode = VECTOR_MODE##mode;                                                    \
  if (abi_vector_types[VECTOR_TYPE_##NAME] == NULL_TREE)                       \
    register_builtin_type (VECTOR_TYPE_##NAME, SCALAR_TYPE##_type_node, mode);

#define DEF_RVV_TUPLE_TYPE(NAME, NCHARS, ABI_NAME, SUBPART_TYPE, SCALAR_TYPE,  \
			   NF, VECTOR_SUFFIX)                                  \
  if (abi_vector_types[VECTOR_TYPE_##NAME] == NULL_TREE)                       \
    register_tuple_type (VECTOR_TYPE_##NAME, VECTOR_TYPE_##SUBPART_TYPE,       \
			 SCALAR_TYPE##_type_node, NF);
#include "riscv-vector-builtins.def"
}

/* Register vector type TYPE under its riscv_vector.h name.  */
static void
register_vector_type (vector_type_index type)
{
  tree vectype = abi_vector_types[type];

  /* When vectype is NULL, the corresponding builtin type
     is disabled according to '-march'.  */
  /* TODO: We currently just skip the register of the illegal RVV type.
     Ideally, we should report error message more friendly instead of
     reporting "unknown" type. Support more friendly error message in
     the future.  */
  if (!vectype)
    return;
  tree id = get_identifier (vector_types[type].name);
  tree decl = build_decl (input_location, TYPE_DECL, id, vectype);
  decl = lang_hooks.decls.pushdecl (decl);

  /* Record the new RVV type if pushdecl succeeded without error.  Use
     the ABI type otherwise, so that the type we record at least has the
     right form, even if it doesn't have the right name.  This should give
     better error recovery behavior than installing error_mark_node or
     installing an incorrect type.  */
  if (decl && TREE_CODE (decl) == TYPE_DECL
      && TREE_TYPE (decl) != error_mark_node
      && TYPE_MAIN_VARIANT (TREE_TYPE (decl)) == vectype)
    vectype = TREE_TYPE (decl);

  builtin_types[type].vector = vectype;
  builtin_types[type].vector_ptr = build_pointer_type (vectype);
}

/* Return true if the type has required_extensions.  */
static bool
required_extensions_p (enum rvv_base_type type)
{
  switch (type)
    {
      case RVV_BASE_eew8_index:
      case RVV_BASE_eew16_index:
      case RVV_BASE_eew32_index:
      case RVV_BASE_eew64_index:
      case RVV_BASE_float_vector:
      case RVV_BASE_double_trunc_float_vector:
      case RVV_BASE_double_trunc_vector:
      case RVV_BASE_widen_lmul1_vector:
      case RVV_BASE_eew8_interpret:
      case RVV_BASE_eew16_interpret:
      case RVV_BASE_eew32_interpret:
      case RVV_BASE_eew64_interpret:
      case RVV_BASE_bool1_interpret:
      case RVV_BASE_bool2_interpret:
      case RVV_BASE_bool4_interpret:
      case RVV_BASE_bool8_interpret:
      case RVV_BASE_bool16_interpret:
      case RVV_BASE_bool32_interpret:
      case RVV_BASE_bool64_interpret:
      case RVV_BASE_signed_eew8_lmul1_interpret:
      case RVV_BASE_signed_eew16_lmul1_interpret:
      case RVV_BASE_signed_eew32_lmul1_interpret:
      case RVV_BASE_signed_eew64_lmul1_interpret:
      case RVV_BASE_unsigned_eew8_lmul1_interpret:
      case RVV_BASE_unsigned_eew16_lmul1_interpret:
      case RVV_BASE_unsigned_eew32_lmul1_interpret:
      case RVV_BASE_unsigned_eew64_lmul1_interpret:
      case RVV_BASE_vlmul_ext_x2:
      case RVV_BASE_vlmul_ext_x4:
      case RVV_BASE_vlmul_ext_x8:
      case RVV_BASE_vlmul_ext_x16:
      case RVV_BASE_vlmul_ext_x32:
      case RVV_BASE_vlmul_ext_x64:
	return true;
      default:
	return false;
    }

  gcc_unreachable ();
}

static uint64_t
get_required_extensions (vector_type_index type_idx)
{
  for (unsigned int i = 0; all_ops[i].index != NUM_VECTOR_TYPES; i++)
    if (type_idx == all_ops[i].index)
      return all_ops[i].required_extensions;
  for (unsigned int i = 0; b_ops[i].index != NUM_VECTOR_TYPES; i++)
    if (type_idx == b_ops[i].index)
      return b_ops[i].required_extensions;
  gcc_unreachable ();
}

/* Check whether all the RVV_REQUIRE_* values in REQUIRED_EXTENSIONS are
   enabled.  */
static bool
check_required_extensions (const function_instance &instance)
{
  rvv_type_info type_info = instance.type;
  uint64_t required_extensions = type_info.required_extensions;
  const rvv_op_info *op_info = instance.op_info;

  if (required_extensions_p (op_info->ret.base_type))
    {
      enum vector_type_index ret_type_idx
	= op_info->ret.get_function_type_index (type_info.index);
      if (ret_type_idx == NUM_VECTOR_TYPES)
	return false;
      required_extensions |= get_required_extensions (ret_type_idx);
    }

  for (unsigned i = 0; op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
    {
      if (!required_extensions_p (op_info->args[i].base_type))
	continue;

      enum vector_type_index vector_type
	= op_info->args[i].get_function_type_index (type_info.index);
      if (vector_type == NUM_VECTOR_TYPES)
	return false;
      required_extensions |= get_required_extensions (vector_type);

      /* According to RVV ISA, EEW=64 index of indexed loads/stores require
	 XLEN = 64.  */
      if (op_info->args[i].base_type == RVV_BASE_eew64_index)
	required_extensions |= RVV_REQUIRE_RV64BIT;
    }

  uint64_t riscv_isa_flags = 0;

  if (TARGET_VECTOR_ELEN_BF_16)
    riscv_isa_flags |= RVV_REQUIRE_ELEN_BF_16;
  if (TARGET_VECTOR_ELEN_FP_16)
    riscv_isa_flags |= RVV_REQUIRE_ELEN_FP_16;
  if (TARGET_VECTOR_ELEN_FP_32)
    riscv_isa_flags |= RVV_REQUIRE_ELEN_FP_32;
  if (TARGET_VECTOR_ELEN_FP_64)
    riscv_isa_flags |= RVV_REQUIRE_ELEN_FP_64;
  if (TARGET_VECTOR_ELEN_64)
    riscv_isa_flags |= RVV_REQUIRE_ELEN_64;
  if (TARGET_64BIT)
    riscv_isa_flags |= RVV_REQUIRE_RV64BIT;
  if (TARGET_FULL_V)
    riscv_isa_flags |= RVV_REQUIRE_FULL_V;
  if (TARGET_MIN_VLEN > 32)
    riscv_isa_flags |= RVV_REQUIRE_MIN_VLEN_64;

  uint64_t missing_extensions = required_extensions & ~riscv_isa_flags;
  if (missing_extensions != 0)
    return false;
  return true;
}

/* Return true if predication is using a real mask operand.  */
static bool
use_real_mask_p (enum predication_type_index pred)
{
  return pred == PRED_TYPE_m || pred == PRED_TYPE_tum || pred == PRED_TYPE_tumu
	 || pred == PRED_TYPE_mu;
}

/* Return true if predication is using a real merge operand.  */
static bool
use_real_merge_p (enum predication_type_index pred)
{
  return pred == PRED_TYPE_tu || pred == PRED_TYPE_tum || pred == PRED_TYPE_tumu
	 || pred == PRED_TYPE_mu;
}

/* Get TAIL policy for predication. If predication indicates TU, return the TU.
   Otherwise, return the prefer default configuration.  */
static rtx
get_tail_policy_for_pred (enum predication_type_index pred)
{
  if (pred == PRED_TYPE_tu || pred == PRED_TYPE_tum || pred == PRED_TYPE_tumu)
    return gen_int_mode (TAIL_UNDISTURBED, Pmode);
  return gen_int_mode (get_prefer_tail_policy (), Pmode);
}

/* Get MASK policy for predication. If predication indicates MU, return the MU.
   Otherwise, return the prefer default configuration.  */
static rtx
get_mask_policy_for_pred (enum predication_type_index pred)
{
  if (pred == PRED_TYPE_tumu || pred == PRED_TYPE_mu)
    return gen_int_mode (MASK_UNDISTURBED, Pmode);
  return gen_int_mode (get_prefer_mask_policy (), Pmode);
}

tree
rvv_arg_type_info::get_scalar_ptr_type (vector_type_index type_idx) const
{
  /* According to the latest rvv-intrinsic-doc, it defines vsm.v intrinsic:
   __riscv_vsm (uint8_t *base, vbool1_t value, size_t vl).  */
  if (type_idx >= VECTOR_TYPE_vbool64_t && type_idx <= VECTOR_TYPE_vbool1_t)
    return builtin_types[VECTOR_TYPE_vuint8mf8_t].scalar_ptr;
  else
    return builtin_types[type_idx].scalar_ptr;
}

tree
rvv_arg_type_info::get_scalar_const_ptr_type (vector_type_index type_idx) const
{
  /* According to the latest rvv-intrinsic-doc, it defines vlm.v intrinsic:
   __riscv_vlm_v_b1 (const uint8_t *base, size_t vl).  */
  if (type_idx >= VECTOR_TYPE_vbool64_t && type_idx <= VECTOR_TYPE_vbool1_t)
    return builtin_types[VECTOR_TYPE_vuint8mf8_t].scalar_const_ptr;
  else
    return builtin_types[type_idx].scalar_const_ptr;
}

vector_type_index
rvv_arg_type_info::get_function_type_index (vector_type_index type_idx) const
{
  tree type
    = builtin_types[function_types[type_idx].type_indexes[base_type]].vector;
  return type ? function_types[type_idx].type_indexes[base_type]
	      : NUM_VECTOR_TYPES;
}

tree
rvv_arg_type_info::get_tree_type (vector_type_index type_idx) const
{
  /* If the builtin type is not registered means '-march' doesn't
     satisfy the require extension of the type. For example,
     vfloat32m1_t require floating-point extension. In this case,
     just return NULL_TREE.  */
  if (type_idx != VECTOR_TYPE_INVALID && !builtin_types[type_idx].vector)
    return NULL_TREE;

  switch (base_type)
    {
#define DEF_RVV_BASE_TYPE(NAME, TYPE)                                          \
  case RVV_BASE_##NAME:                                                        \
    return TYPE;
#include "riscv-vector-builtins.def"
    default:
      gcc_unreachable ();
    }
  gcc_unreachable ();
}

tree
rvv_arg_type_info::get_tuple_subpart_type (vector_type_index type_idx) const
{
  switch (type_idx)
    {
#define DEF_RVV_TUPLE_TYPE(NAME, NCHARS, ABI_NAME, SUBPART_TYPE, ARGS...)      \
  case VECTOR_TYPE_##NAME:                                                     \
    return builtin_types[VECTOR_TYPE_##SUBPART_TYPE].vector;
#include "riscv-vector-builtins.def"
    default:
      gcc_unreachable ();
    }
  gcc_unreachable ();
}

function_instance::function_instance (const char *base_name_in,
				      const function_base *base_in,
				      const function_shape *shape_in,
				      rvv_type_info type_in,
				      predication_type_index pred_in,
				      const rvv_op_info *op_info_in)
  : base_name (base_name_in), base (base_in), shape (shape_in), type (type_in),
    pred (pred_in), op_info (op_info_in)
{
}

bool
function_instance::operator== (const function_instance &other) const
{
  for (unsigned int i = 0; op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
    if (op_info->args[i].base_type != other.op_info->args[i].base_type)
      return false;
  return (base == other.base && shape == other.shape
	  && type.index == other.type.index && op_info->op == other.op_info->op
	  && pred == other.pred
	  && op_info->ret.base_type == other.op_info->ret.base_type);
}

bool
function_instance::any_type_float_p () const
{
  if (riscv_vector_float_type_p (get_return_type ()))
    return true;

  for (int i = 0; op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
    if (riscv_vector_float_type_p (get_arg_type (i)))
      return true;

  return false;
}

tree
function_instance::get_return_type () const
{
  return op_info->ret.get_tree_type (type.index);
}

tree
function_instance::get_arg_type (unsigned opno) const
{
  return op_info->args[opno].get_tree_type (type.index);
}

/* Return a hash code for a function_instance.  */
hashval_t
function_instance::hash () const
{
  inchash::hash h;
  /* BASE uniquely determines BASE_NAME, so we don't need to hash both.  */
  h.add_ptr (base);
  h.add_ptr (shape);
  h.add_int (type.index);
  h.add_int (op_info->op);
  h.add_int (pred);
  h.add_int (op_info->ret.base_type);
  for (unsigned int i = 0; op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
    h.add_int (op_info->args[i].base_type);
  return h.end ();
}

/* Return a set of CP_* flags that describe what the function could do,
   taking the command-line flags into account.  */
unsigned int
function_instance::call_properties () const
{
  unsigned int flags = base->call_properties (*this);

  /* -fno-trapping-math means that we can assume any FP exceptions
     are not user-visible.  */
  if (!flag_trapping_math)
    flags &= ~CP_RAISE_FP_EXCEPTIONS;

  return flags;
}

/* Return true if calls to the function could read some form of
   global state.  */
bool
function_instance::reads_global_state_p () const
{
  unsigned int flags = call_properties ();

  /* Preserve any dependence on rounding mode, flush to zero mode, etc.
     There is currently no way of turning this off; in particular,
     -fno-rounding-math (which is the default) means that we should make
     the usual assumptions about rounding mode, which for intrinsics means
     acting as the instructions do.  */
  if (flags & CP_READ_FPCR)
    return true;

  /* Handle direct reads of global state.  */
  return flags & (CP_READ_MEMORY | CP_READ_CSR);
}

/* Return true if calls to the function could modify some form of
   global state.  */
bool
function_instance::modifies_global_state_p () const
{
  unsigned int flags = call_properties ();

  /* Preserve any exception state written back to the FPCR,
     unless -fno-trapping-math says this is unnecessary.  */
  if (flags & CP_RAISE_FP_EXCEPTIONS)
    return true;

  /* Handle direct modifications of global state.  */
  return flags & (CP_WRITE_MEMORY | CP_WRITE_CSR);
}

/* Return true if calls to the function could raise a signal.  */
bool
function_instance::could_trap_p () const
{
  unsigned int flags = call_properties ();

  /* Handle functions that could raise SIGFPE.  */
  if (flags & CP_RAISE_FP_EXCEPTIONS)
    return true;

  /* Handle functions that could raise SIGBUS or SIGSEGV.  */
  if (flags & (CP_READ_MEMORY | CP_WRITE_MEMORY))
    return true;

  return false;
}

function_builder::function_builder ()
{
  m_direct_overloads = lang_GNU_CXX ();
  gcc_obstack_init (&m_string_obstack);
}

function_builder::~function_builder ()
{
  obstack_free (&m_string_obstack, NULL);
}

/* Allocate arguments of the function.  */
void
function_builder::allocate_argument_types (const function_instance &instance,
					   vec<tree> &argument_types) const
{
  for (unsigned int i = 0;
       instance.op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
    argument_types.quick_push (
      instance.op_info->args[i].get_tree_type (instance.type.index));
}

/* Apply predication into argument_types.  */
void
function_builder::apply_predication (const function_instance &instance,
				     tree return_type,
				     vec<tree> &argument_types) const
{
  /* These predication types need to apply merge type.  */
  if (instance.base->has_merge_operand_p ())
    if (instance.pred == PRED_TYPE_tu || instance.pred == PRED_TYPE_tum
	|| instance.pred == PRED_TYPE_tumu || instance.pred == PRED_TYPE_mu)
      argument_types.quick_insert (0, return_type);

  /* These predication types need to apply mask type.  */
  vector_type_index mask_type_index
    = function_types[instance.type.index].type_indexes[RVV_BASE_mask];
  tree mask_type = builtin_types[mask_type_index].vector;
  if (instance.pred == PRED_TYPE_m || instance.pred == PRED_TYPE_tum
      || instance.pred == PRED_TYPE_tumu || instance.pred == PRED_TYPE_mu)
    argument_types.quick_insert (0, mask_type);

  /* check if rounding mode parameter need  */
  if (instance.base->has_rounding_mode_operand_p ())
    argument_types.quick_push (unsigned_type_node);

  /* check if vl parameter need  */
  if (instance.base->apply_vl_p ())
    argument_types.quick_push (size_type_node);
}

/* Register all the functions in GROUP.  */
void
function_builder::register_function_group (const function_group_info &group)
{
  (*group.shape)->build (*this, group);
}

/* Add NAME to the end of the function name being built.  */
void
function_builder::append_name (const char *name)
{
  obstack_grow (&m_string_obstack, name, strlen (name));
}

/* Add "__riscv_" and "name".  */
void
function_builder::append_base_name (const char *name)
{
  append_name ("__riscv_");
  append_name (name);
}

/* Add SEW into function name.  */
void
function_builder::append_sew (int sew)
{
  switch (sew)
    {
    case 8:
      append_name ("8");
      break;
    case 16:
      append_name ("16");
      break;
    case 32:
      append_name ("32");
      break;
    case 64:
      append_name ("64");
      break;
    default:
      gcc_unreachable ();
    }
}

/* Add NF into function name.  */
void
function_builder::append_nf (int nf)
{
  switch (nf)
    {
    case 2:
      append_name ("2");
      break;
    case 3:
      append_name ("3");
      break;
    case 4:
      append_name ("4");
      break;
    case 5:
      append_name ("5");
      break;
    case 6:
      append_name ("6");
      break;
    case 7:
      append_name ("7");
      break;
    case 8:
      append_name ("8");
      break;
    default:
      gcc_unreachable ();
    }
}

/* Zero-terminate and complete the function name being built.  */
char *
function_builder::finish_name ()
{
  obstack_1grow (&m_string_obstack, 0);
  return (char *) obstack_finish (&m_string_obstack);
}

/* Return the appropriate function attributes for INSTANCE.  */
tree
function_builder::get_attributes (const function_instance &instance)
{
  tree attrs = NULL_TREE;

  if (!instance.modifies_global_state_p ())
    {
      if (instance.reads_global_state_p ())
	attrs = add_attribute ("pure", attrs);
      else
	attrs = add_attribute ("const", attrs);
    }

  if (!flag_non_call_exceptions || !instance.could_trap_p ())
    attrs = add_attribute ("nothrow", attrs);

  return add_attribute ("leaf", attrs);
}

/* Add a function called NAME with type FNTYPE and attributes ATTRS.
   INSTANCE describes what the function does.  */
registered_function &
function_builder::add_function (const function_instance &instance,
				const char *name, tree fntype, tree attrs,
				bool placeholder_p, const char *overload_name,
				const vec<tree> &argument_types,
				enum required_ext required,
				bool overloaded_p = false)
{
  unsigned int code = vec_safe_length (registered_functions);
  code = (code << RISCV_BUILTIN_SHIFT) + RISCV_BUILTIN_VECTOR;

  /* We need to be able to generate placeholders to ensure that we have a
     consistent numbering scheme for function codes between the C and C++
     frontends, so that everything ties up in LTO.

     Currently, tree-streamer-in.c:unpack_ts_function_decl_value_fields
     validates that tree nodes returned by TARGET_BUILTIN_DECL are non-NULL and
     some node other than error_mark_node. This is a holdover from when builtin
     decls were streamed by code rather than by value.

     Ultimately, we should be able to remove this validation of BUILT_IN_MD
     nodes and remove the target hook. For now, however, we need to appease the
     validation and return a non-NULL, non-error_mark_node node, so we
     arbitrarily choose integer_zero_node.  */
  tree decl = placeholder_p
		? integer_zero_node
		: simulate_builtin_function_decl (input_location, name, fntype,
						  code, NULL, attrs);

  registered_function &rfn = *ggc_alloc<registered_function> ();
  rfn.instance = instance;
  rfn.decl = decl;
  rfn.overload_name = overload_name ? xstrdup (overload_name) : NULL;
  rfn.argument_types = argument_types;
  rfn.overloaded_p = overloaded_p;
  rfn.required = required;
  vec_safe_push (registered_functions, &rfn);

  return rfn;
}

/* Add a built-in function for INSTANCE, with the argument types given
   by ARGUMENT_TYPES and the return type given by RETURN_TYPE. NAME is
   the "full" name for C function. OVERLOAD_NAME is the "short" name for
   C++ overloaded function. OVERLOAD_NAME can be nullptr because some
   instance doesn't have C++ overloaded function.  */
void
function_builder::add_unique_function (const function_instance &instance,
				       const function_shape *shape,
				       tree return_type,
				       vec<tree> &argument_types,
				       enum required_ext required)
{
  /* Do not add this function if it is invalid.  */
  if (!check_required_extensions (instance))
    return;

  /* Also add the function under its overloaded alias, if we want
     a separate decl for each instance of an overloaded function.  */
  char *overload_name = shape->get_name (*this, instance, true);

  /* Add the function under its full (unique) name.  */
  char *name = shape->get_name (*this, instance, false);
  tree fntype
    = build_function_type_array (return_type, argument_types.length (),
				 argument_types.address ());
  tree attrs = get_attributes (instance);
  registered_function &rfn
    = add_function (instance, name, fntype, attrs, false, overload_name,
		    argument_types.copy (), required);

  /* Enter the function into the hash table.  */
  hashval_t hash = instance.hash ();
  registered_function **rfn_slot
    = function_table->find_slot_with_hash (instance, hash, INSERT);
  gcc_assert (!*rfn_slot);
  *rfn_slot = &rfn;

  if (overload_name)
    {
      /* Attribute lists shouldn't be shared.  */
      tree attrs = get_attributes (instance);
      bool placeholder_p = !m_direct_overloads;
      add_function (instance, overload_name, fntype, attrs, placeholder_p, NULL,
		    vNULL, required);

      /* Enter the function into the non-overloaded hash table.  */
      hash = rfn.overloaded_hash ();
      rfn_slot = non_overloaded_function_table->find_slot_with_hash (&rfn, hash,
								     INSERT);
      gcc_assert (!*rfn_slot);
      *rfn_slot = &rfn;
    }
  obstack_free (&m_string_obstack, name);
}

/* Add overloaded function for gcc. */
void
function_builder::add_overloaded_function (const function_instance &instance,
					   const function_shape *shape,
					   enum required_ext required)
{
  if (!check_required_extensions (instance))
    return;

  char *name = shape->get_name (*this, instance, true);

  if (name)
    {
      /* To avoid API conflicting, take void return type and void argument
	 for the overloaded function.  */
      tree fntype = build_function_type (void_type_node, void_list_node);
      add_function (instance, name, fntype, NULL_TREE, m_direct_overloads, name,
		    vNULL, required, true);
      obstack_free (&m_string_obstack, name);
    }
}

function_call_info::function_call_info (location_t location_in,
					const function_instance &instance_in,
					tree fndecl_in)
  : function_instance (instance_in), location (location_in), fndecl (fndecl_in)
{}

gimple_folder::gimple_folder (const function_instance &instance, tree fndecl,
			      gimple_stmt_iterator *gsi_in, gcall *call_in)
  : function_call_info (gimple_location (call_in), instance, fndecl),
    gsi (gsi_in), call (call_in), lhs (gimple_call_lhs (call_in))
{
}

/* Try to fold the call.  Return the new statement on success and null
   on failure.  */
gimple *
gimple_folder::fold ()
{
  /* Don't fold anything when RVV is disabled; emit an error during
     expansion instead.  */
  if (!TARGET_VECTOR)
    return NULL;

  /* Punt if the function has a return type and no result location is
     provided.  The attributes should allow target-independent code to
     remove the calls if appropriate.  */
  if (!lhs && TREE_TYPE (gimple_call_fntype (call)) != void_type_node)
    return NULL;

  return base->fold (*this);
}

function_expander::function_expander (const function_instance &instance,
				      tree fndecl_in, tree exp_in,
				      rtx target_in)
  : function_call_info (EXPR_LOCATION (exp_in), instance, fndecl_in),
    exp (exp_in), target (target_in), opno (0)
{
  if (!function_returns_void_p ())
    {
      if (target != NULL_RTX && MEM_P (target))
	/* Since there is no intrinsic where target is a mem operand, it
	   should be converted to reg if it is a mem operand.  */
	target = force_reg (GET_MODE (target), target);
      create_output_operand (&m_ops[opno++], target,
			     TYPE_MODE (TREE_TYPE (exp)));
    }
}

/* Take argument ARGNO from EXP's argument list and convert it into
   an expand operand.  Store the operand in *M_OPS.  */
void
function_expander::add_input_operand (unsigned argno)
{
  tree arg = CALL_EXPR_ARG (exp, argno);
  rtx x = expand_normal (arg);
  add_input_operand (TYPE_MODE (TREE_TYPE (arg)), x);
}

/* Since we may normalize vop/vop_tu/vop_m/vop_tumu.. into a single patter.
   We add a undef for the intrinsics that don't need a real merge.  */
void
function_expander::add_vundef_operand (machine_mode mode)
{
  add_input_operand (mode, RVV_VUNDEF (mode));
}

/* Add a memory operand with mode MODE and address ADDR.  */
void
function_expander::add_mem_operand (machine_mode mode, unsigned argno)
{
  gcc_assert (VECTOR_MODE_P (mode));
  rtx addr = expand_normal (CALL_EXPR_ARG (exp, argno));
  rtx mem = gen_rtx_MEM (mode, memory_address (mode, addr));
  /* The memory is only guaranteed to be element-aligned.  */
  set_mem_align (mem, GET_MODE_ALIGNMENT (GET_MODE_INNER (mode)));
  add_fixed_operand (mem);
}

/* Return the machine_mode of the corresponding mask type.  */
machine_mode
function_expander::mask_mode (void) const
{
  vector_type_index mask_type_index
    = function_types[type.index].type_indexes[RVV_BASE_mask];
  return TYPE_MODE (builtin_types[mask_type_index].vector);
}

/* Implement the call using instruction ICODE, with a 1:1 mapping between
   arguments and input operands.  */
rtx
function_expander::use_exact_insn (insn_code icode)
{
  machine_mode mode = TYPE_MODE (TREE_TYPE (exp));

  /* Record the offset to get the argument.  */
  int arg_offset = 0;

  if (base->use_mask_predication_p ())
    {
      if (use_real_mask_p (pred))
	add_input_operand (arg_offset++);
      else
	add_all_one_mask_operand (mask_mode ());
    }

  /* Store operation doesn't have merge operand.  */
  if (!function_returns_void_p () && base->has_merge_operand_p ())
    {
      if (use_real_merge_p (pred))
	add_input_operand (arg_offset++);
      else
	add_vundef_operand (mode);
    }

  for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
    {
      if (base->has_rounding_mode_operand_p ()
	  && argno == call_expr_nargs (exp) - 2)
	{
	  /* Since the rounding mode argument position is not consistent with
	     the instruction pattern, we need to skip rounding mode argument
	     here.  */
	  continue;
	}
      add_input_operand (argno);
    }

  if (base->apply_tail_policy_p ())
    add_input_operand (Pmode, get_tail_policy_for_pred (pred));
  if (base->apply_mask_policy_p ())
    add_input_operand (Pmode, get_mask_policy_for_pred (pred));

  if (base->apply_vl_p ())
    add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));

  if (base->has_rounding_mode_operand_p ())
    add_input_operand (call_expr_nargs (exp) - 2);

  /* The RVV floating-point only support dynamic rounding mode in the
     FRM register.  */
  if (opno != insn_data[icode].n_generator_args)
    add_input_operand (Pmode, gen_int_mode (riscv_vector::FRM_DYN, Pmode));

  return generate_insn (icode);
}

/* Use contiguous load INSN.  */
rtx
function_expander::use_contiguous_load_insn (insn_code icode)
{
  gcc_assert (call_expr_nargs (exp) > 0);
  machine_mode mode = TYPE_MODE (TREE_TYPE (exp));

  /* Record the offset to get the argument.  */
  int arg_offset = 0;

  if (use_real_mask_p (pred))
    add_input_operand (arg_offset++);
  else
    add_all_one_mask_operand (mask_mode ());

  if (use_real_merge_p (pred))
    add_input_operand (arg_offset++);
  else
    add_vundef_operand (mode);

  add_mem_operand (mode, arg_offset++);

  for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
    add_input_operand (argno);

  if (GET_MODE_CLASS (mode) != MODE_VECTOR_BOOL)
    {
      add_input_operand (Pmode, get_tail_policy_for_pred (pred));
      add_input_operand (Pmode, get_mask_policy_for_pred (pred));
    }

  if (opno != insn_data[icode].n_generator_args)
    add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));

  return generate_insn (icode);
}

/* Use contiguous store INSN.  */
rtx
function_expander::use_contiguous_store_insn (insn_code icode)
{
  gcc_assert (call_expr_nargs (exp) > 0);
  machine_mode mode = TYPE_MODE (builtin_types[type.index].vector);

  /* Record the offset to get the argument.  */
  int arg_offset = 0;

  add_mem_operand (mode, use_real_mask_p (pred) ? 1 : 0);

  if (use_real_mask_p (pred))
    add_input_operand (arg_offset++);
  else
    add_all_one_mask_operand (mask_mode ());

  arg_offset++;
  for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
    add_input_operand (argno);

  add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
  return generate_insn (icode);
}

/* Implement the call using instruction ICODE, with a 1:1 mapping between
   arguments and input operands.  */
rtx
function_expander::use_compare_insn (rtx_code rcode, insn_code icode)
{
  machine_mode mode = TYPE_MODE (builtin_types[type.index].vector);
  machine_mode mask_mode = TYPE_MODE (TREE_TYPE (exp));

  /* Record the offset to get the argument.  */
  int arg_offset = 0;

  if (use_real_mask_p (pred))
    add_input_operand (arg_offset++);
  else
    add_all_one_mask_operand (mask_mode);

  if (use_real_merge_p (pred))
    add_input_operand (arg_offset++);
  else
    add_vundef_operand (mask_mode);

  rtx op1 = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
  rtx op2 = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
  if (!insn_operand_matches (icode, opno + 1, op1))
    op1 = force_reg (mode, op1);
  if (!insn_operand_matches (icode, opno + 2, op2))
    {
      if (VECTOR_MODE_P (GET_MODE (op2)))
	op2 = force_reg (mode, op2);
      else
	op2 = force_reg (GET_MODE_INNER (mode), op2);
    }
  rtx comparison = gen_rtx_fmt_ee (rcode, mask_mode, op1, op2);
  if (!VECTOR_MODE_P (GET_MODE (op2)))
    comparison = gen_rtx_fmt_ee (rcode, mask_mode, op1,
				 gen_rtx_VEC_DUPLICATE (mode, op2));
  add_fixed_operand (comparison);
  add_fixed_operand (op1);
  if (CONST_INT_P (op2))
    add_integer_operand (op2);
  else
    add_fixed_operand (op2);
  for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
    add_input_operand (argno);

  add_input_operand (Pmode, get_mask_policy_for_pred (pred));
  add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
  return generate_insn (icode);
}

/* Implement the call using instruction ICODE, with a 1:1 mapping between
   arguments and input operands.  */
rtx
function_expander::use_ternop_insn (bool vd_accum_p, insn_code icode)
{
  machine_mode mode = TYPE_MODE (builtin_types[type.index].vector);

  /* Record the offset to get the argument.  */
  int arg_offset = 0;

  if (use_real_mask_p (pred))
    add_input_operand (arg_offset++);
  else
    add_all_one_mask_operand (mask_mode ());

  rtx vd = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
  rtx vs1 = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
  rtx vs2 = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));

  if (VECTOR_MODE_P (GET_MODE (vs1)))
    {
      if (!vd_accum_p)
	add_input_operand (mode, vd);
      add_input_operand (mode, vs1);
      add_input_operand (mode, vs2);
      if (vd_accum_p)
	add_input_operand (mode, vd);
      add_input_operand (mode, vd);
    }
  else
    {
      add_input_operand (GET_MODE_INNER (mode), vs1);
      if (vd_accum_p)
	{
	  add_input_operand (mode, vs2);
	  add_input_operand (mode, vd);
	}
      else
	{
	  add_input_operand (mode, vd);
	  add_input_operand (mode, vs2);
	}
      add_input_operand (mode, vd);
    }

  for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
    {
      if (base->has_rounding_mode_operand_p ()
	  && argno == call_expr_nargs (exp) - 2)
	{
	  /* Since the rounding mode argument position is not consistent with
	     the instruction pattern, we need to skip rounding mode argument
	     here.  */
	  continue;
	}
      add_input_operand (argno);
    }

  add_input_operand (Pmode, get_tail_policy_for_pred (pred));
  add_input_operand (Pmode, get_mask_policy_for_pred (pred));
  add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));

  if (base->has_rounding_mode_operand_p ())
    add_input_operand (call_expr_nargs (exp) - 2);

  /* The RVV floating-point only support dynamic rounding mode in the
     FRM register.  */
  if (opno != insn_data[icode].n_generator_args)
    add_input_operand (Pmode, gen_int_mode (riscv_vector::FRM_DYN, Pmode));

  return generate_insn (icode);
}

/* Implement the call using instruction ICODE, with a 1:1 mapping between
   arguments and input operands.  */
rtx
function_expander::use_widen_ternop_insn (insn_code icode)
{
  /* Record the offset to get the argument.  */
  int arg_offset = 0;

  if (use_real_mask_p (pred))
    add_input_operand (arg_offset++);
  else
    add_all_one_mask_operand (mask_mode ());

  for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
    {
      if (base->has_rounding_mode_operand_p ()
	  && argno == call_expr_nargs (exp) - 2)
	{
	  /* Since the rounding mode argument position is not consistent with
	     the instruction pattern, we need to skip rounding mode argument
	     here.  */
	  continue;
	}
      add_input_operand (argno);
    }

  add_input_operand (Pmode, get_tail_policy_for_pred (pred));
  add_input_operand (Pmode, get_mask_policy_for_pred (pred));
  add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));

  if (base->has_rounding_mode_operand_p ())
    add_input_operand (call_expr_nargs (exp) - 2);

  /* The RVV floating-point only support dynamic rounding mode in the
     FRM register.  */
  if (opno != insn_data[icode].n_generator_args)
    add_input_operand (Pmode, gen_int_mode (riscv_vector::FRM_DYN, Pmode));

  return generate_insn (icode);
}

/* Implement the call using instruction ICODE, with a 1:1 mapping between
   arguments and input operands.  */
rtx
function_expander::use_scalar_move_insn (insn_code icode)
{
  machine_mode mode = TYPE_MODE (TREE_TYPE (exp));

  /* Record the offset to get the argument.  */
  int arg_offset = 0;
  add_scalar_move_mask_operand (mask_mode ());

  if (use_real_merge_p (pred))
    add_input_operand (arg_offset++);
  else
    add_vundef_operand (mode);

  for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
    add_input_operand (argno);

  add_input_operand (Pmode, get_tail_policy_for_pred (pred));
  add_input_operand (Pmode, get_mask_policy_for_pred (pred));
  add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
  return generate_insn (icode);
}

/* Generate instruction ICODE, given that its operands have already
   been added to M_OPS.  Return the value of the first operand.  */
rtx
function_expander::generate_insn (insn_code icode)
{
  gcc_assert (opno == insn_data[icode].n_generator_args);
  if (!maybe_expand_insn (icode, opno, m_ops))
    {
      error ("invalid argument to built-in function");
      return NULL_RTX;
    }
  return function_returns_void_p () ? const0_rtx : m_ops[0].value;
}

function_checker::function_checker (location_t location,
				    const function_instance &instance,
				    tree fndecl, tree fntype,
				    unsigned int nargs, tree *args)
  : function_call_info (location, instance, fndecl), m_fntype (fntype),
    m_nargs (nargs), m_args (args)
{}

/* Report that LOCATION has a call to FNDECL in which argument ARGNO
   was not an integer constant expression.  ARGNO counts from zero.  */
void
function_checker::report_non_ice (unsigned int argno) const
{
  error_at (location,
	    "argument %d of %qE must be an integer constant"
	    " expression",
	    argno + 1, fndecl);
}

/* Report that LOCATION has a call to FNDECL in which argument ARGNO has
   the value ACTUAL, whereas the function requires a value in the range
   [MIN, MAX].  ARGNO counts from zero.  */
void
function_checker::report_out_of_range (unsigned int argno, HOST_WIDE_INT actual,
				       HOST_WIDE_INT min,
				       HOST_WIDE_INT max) const
{
  error_at (location,
	    "passing %wd to argument %d of %qE, which expects"
	    " a value in the range [%wd, %wd]",
	    actual, argno + 1, fndecl, min, max);
}

/* Report that LOCATION has a call to FNDECL in which argument ARGNO has
   the value ACTUAL, whereas the function requires a value in the range
   [MIN, MAX] or OR_VAL.  ARGNO counts from zero.  */
void
function_checker::report_out_of_range_and_not (unsigned int argno,
					       HOST_WIDE_INT actual,
					       HOST_WIDE_INT min,
					       HOST_WIDE_INT max,
					       HOST_WIDE_INT or_val) const
{
  error_at (location,
	    "passing %wd to argument %d of %qE, which expects"
	    " a value in the range [%wd, %wd] or %wd",
	    actual, argno + 1, fndecl, min, max, or_val);
}


/* Check that argument ARGNO is an integer constant expression and
   store its value in VALUE_OUT if so.  The caller should first
   check that argument ARGNO exists.  */
bool
function_checker::require_immediate (unsigned int argno, HOST_WIDE_INT min,
				     HOST_WIDE_INT max) const
{
  gcc_assert (argno < m_nargs);
  tree arg = m_args[argno];

  /* The type and range are unsigned, so read the argument as an
     unsigned rather than signed HWI.  */
  if (!tree_fits_uhwi_p (arg))
    {
      report_non_ice (argno);
      return false;
    }
  return require_immediate_range (argno, min, max);
}

/* Check that argument REL_ARGNO is an integer constant expression in the
   range [MIN, MAX].  REL_ARGNO counts from the end of the predication
   arguments.  */
bool
function_checker::require_immediate_range (unsigned int argno,
					   HOST_WIDE_INT min,
					   HOST_WIDE_INT max) const
{
  gcc_assert (argno < m_nargs);
  tree arg = m_args[argno];
  HOST_WIDE_INT actual = tree_to_uhwi (arg);

  if (!IN_RANGE (actual, min, max))
    {
      report_out_of_range (argno, actual, min, max);
      return false;
    }

  return true;
}

/* Check that argument REL_ARGNO is an integer constant expression in the
   range [MIN, MAX] or OR_VAL.  REL_ARGNO counts from the end of the
   predication arguments.  */
bool
function_checker::require_immediate_range_or (unsigned int argno,
					      HOST_WIDE_INT min,
					      HOST_WIDE_INT max,
					      HOST_WIDE_INT or_val) const
{
  gcc_assert (min >= 0 && min <= max);
  gcc_assert (argno < m_nargs);

  tree arg = m_args[argno];
  HOST_WIDE_INT actual = tree_to_uhwi (arg);

  if (!IN_RANGE (actual, min, max) && actual != or_val)
    {
      report_out_of_range_and_not (argno, actual, min, max, or_val);
      return false;
    }

  return true;
}

/* Perform semantic checks on the call.  Return true if the call is valid,
   otherwise report a suitable error.  */
bool
function_checker::check ()
{
  return shape->check (*this);
}

inline hashval_t
registered_function_hasher::hash (value_type value)
{
  return value->instance.hash ();
}

inline bool
registered_function_hasher::equal (value_type value, const compare_type &key)
{
  return value->instance == key;
}

hashval_t
registered_function::overloaded_hash () const
{
  inchash::hash h;
  tree type;
  unsigned int unsigned_p, mode_p;
  h.add (overload_name, strlen (overload_name));
  for (unsigned int i = 0; i < argument_types.length (); i++)
    {
      type = argument_types[i];
      unsigned_p = POINTER_TYPE_P (type) ? TYPE_UNSIGNED (TREE_TYPE (type))
					 : TYPE_UNSIGNED (type);
      mode_p = POINTER_TYPE_P (type) ? TYPE_MODE (TREE_TYPE (type))
				     : TYPE_MODE (type);
      if (POINTER_TYPE_P (type) || lookup_vector_type_attribute (type))
	{
	  h.add_int (unsigned_p);
	  h.add_int (mode_p);
	}
      else if (instance.base->may_require_vxrm_p ()
	       || instance.base->may_require_frm_p ())
	{
	  h.add_int (argument_types.length ());
	  break;
	}
    }

  return h.end ();
}

hashval_t
registered_function::overloaded_hash (const vec<tree, va_gc> &arglist)
{
  argument_types = vNULL;
  unsigned int len = arglist.length ();

  for (unsigned int i = 0; i < len; i++)
    argument_types.safe_push (TREE_TYPE (arglist[i]));

  return overloaded_hash ();
}

inline hashval_t
non_overloaded_registered_function_hasher::hash (value_type value)
{
  return value->overloaded_hash ();
}

inline bool
non_overloaded_registered_function_hasher::equal (value_type value,
						  const compare_type &key)
{
  return ((strcmp (value->overload_name, key->overload_name) == 0)
	  && value->overloaded_hash () == key->overloaded_hash ());
}

/* If TYPE is a built-in type defined by the RVV ABI, return the mangled name,
   otherwise return NULL.  */
const char *
mangle_builtin_type (const_tree type)
{
  if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL)
    type = TREE_TYPE (TYPE_NAME (type));
  if (tree attr = lookup_vector_type_attribute (type))
    if (tree id = TREE_VALUE (chain_index (0, TREE_VALUE (attr))))
      return IDENTIFIER_POINTER (id);
  return NULL;
}

/* Return true if TYPE is a built-in RVV type defined by the ABI.  */
bool
builtin_type_p (const_tree type)
{
  if (!type)
    return false;

  return lookup_vector_type_attribute (type);
}

/* Initialize all compiler built-ins related to RVV that should be
   defined at start-up.  */
void
init_builtins ()
{
  rvv_switcher rvv;
  if (!TARGET_VECTOR)
    return;
  register_builtin_types ();
  if (in_lto_p)
    handle_pragma_vector ();
}

/* Reinitialize builtins similar to init_builtins,  but only the null
   builtin types will be registered.  */
void
reinit_builtins ()
{
  rvv_switcher rvv;

  if (!TARGET_VECTOR)
    return;

  register_builtin_types_on_null ();

  if (in_lto_p)
    handle_pragma_vector ();
}

/* Implement TARGET_VERIFY_TYPE_CONTEXT for RVV types.  */
bool
verify_type_context (location_t loc, type_context_kind context, const_tree type,
		     bool silent_p)
{
  if (!sizeless_type_p (type))
    return true;

  switch (context)
    {
    case TCTX_SIZEOF:
    case TCTX_STATIC_STORAGE:
      if (!silent_p)
	error_at (loc, "RVV type %qT does not have a fixed size", type);

      return false;

    case TCTX_ALIGNOF:
      if (!silent_p)
	error_at (loc, "RVV type %qT does not have a defined alignment", type);

      return false;

    case TCTX_THREAD_STORAGE:
      if (!silent_p)
	error_at (loc,
		  "variables of type %qT cannot have thread-local"
		  " storage duration",
		  type);

      return false;

    case TCTX_POINTER_ARITH:
      if (!silent_p)
	error_at (loc, "arithmetic on pointer to RVV type %qT", type);

      return false;

    case TCTX_FIELD:
      if (silent_p)
	;
      else if (lang_GNU_CXX ())
	error_at (loc, "member variables cannot have RVV type %qT", type);
      else
	error_at (loc, "fields cannot have RVV type %qT", type);

      return false;

    case TCTX_ARRAY_ELEMENT:
      if (!silent_p)
	error_at (loc, "array elements cannot have RVV type %qT", type);

      return false;

    case TCTX_ALLOCATION:
      if (!silent_p)
	error_at (loc, "cannot allocate objects with RVV type %qT", type);

      return false;

    case TCTX_DEALLOCATION:
      if (!silent_p)
	error_at (loc, "cannot delete objects with RVV type %qT", type);

      return false;

    case TCTX_EXCEPTIONS:
      if (!silent_p)
	error_at (loc, "cannot throw or catch RVV type %qT", type);

      return false;

    case TCTX_CAPTURE_BY_COPY:
      if (!silent_p)
	error_at (loc, "capture by copy of RVV type %qT", type);

      return false;
    }

  gcc_unreachable ();
}

/* Register the vxrm enum.  */
static void
register_vxrm ()
{
  auto_vec<string_int_pair, 4> values;
#define DEF_RVV_VXRM_ENUM(NAME, VALUE)                                          \
  values.quick_push (string_int_pair ("__RISCV_VXRM_" #NAME, VALUE));
#include "riscv-vector-builtins.def"
#undef DEF_RVV_VXRM_ENUM

  lang_hooks.types.simulate_enum_decl (input_location, "__RISCV_VXRM", &values);
}

/* Register the frm enum.  */
static void
register_frm ()
{
  auto_vec<string_int_pair, 5> values;
#define DEF_RVV_FRM_ENUM(NAME, VALUE)                                          \
  values.quick_push (string_int_pair ("__RISCV_FRM_" #NAME, VALUE));
#include "riscv-vector-builtins.def"
#undef DEF_RVV_FRM_ENUM

  lang_hooks.types.simulate_enum_decl (input_location, "__RISCV_FRM", &values);
}

/* Implement #pragma riscv intrinsic vector.  */
void
handle_pragma_vector ()
{
  if (function_table || non_overloaded_function_table)
    {
      error ("duplicate definition of %qs", "riscv_vector.h");
      return;
    }
  rvv_switcher rvv;

  /* Define the vector and tuple types.  */
  for (unsigned int type_i = 0; type_i < NUM_VECTOR_TYPES; ++type_i)
    register_vector_type ((enum vector_type_index) type_i);

  /* Define the enums.  */
  register_vxrm ();
  register_frm ();

  /* Define the functions.  */
  function_table = new hash_table<registered_function_hasher> (1023);
  non_overloaded_function_table
    = new hash_table<non_overloaded_registered_function_hasher> (1023);
  function_builder builder;
  for (unsigned int i = 0; i < ARRAY_SIZE (function_groups); ++i)
  {
    if (function_groups[i].match (function_groups[i].required_extensions))
      builder.register_function_group (function_groups[i]);
  }
}

/* Return the function decl with RVV function subcode CODE, or error_mark_node
   if no such function exists.  */
tree
builtin_decl (unsigned int code, bool)
{
  if (code >= vec_safe_length (registered_functions))
    return error_mark_node;

  return (*registered_functions)[code]->decl;
}

/* Attempt to fold STMT, given that it's a call to the RVV function
   with subcode CODE.  Return the new statement on success and null
   on failure.  Insert any other new statements at GSI.  */
gimple *
gimple_fold_builtin (unsigned int code, gimple_stmt_iterator *gsi, gcall *stmt)
{
  registered_function &rfn = *(*registered_functions)[code];
  return gimple_folder (rfn.instance, rfn.decl, gsi, stmt).fold ();
}

static bool
validate_instance_type_required_extensions (const rvv_type_info type,
					    tree exp)
{
  uint64_t exts = type.required_extensions;

  if ((exts & RVV_REQUIRE_ELEN_BF_16)
      && !TARGET_VECTOR_ELEN_BF_16_P (riscv_vector_elen_flags))
    {
      error_at (EXPR_LOCATION (exp),
		"built-in function %qE requires the "
		"zvfbfmin or zvfbfwma ISA extension",
		exp);
      return false;
    }

  if ((exts & RVV_REQUIRE_ELEN_FP_16)
    && !TARGET_VECTOR_ELEN_FP_16_P (riscv_vector_elen_flags))
    {
      error_at (EXPR_LOCATION (exp),
		"built-in function %qE requires the "
		"zvfhmin or zvfh ISA extension",
		exp);
      return false;
    }

  if ((exts & RVV_REQUIRE_ELEN_FP_32)
    && !TARGET_VECTOR_ELEN_FP_32_P (riscv_vector_elen_flags))
    {
      error_at (EXPR_LOCATION (exp),
		"built-in function %qE requires the "
		"zve32f, zve64f, zve64d or v ISA extension",
		exp);
      return false;
    }

  if ((exts & RVV_REQUIRE_ELEN_FP_64)
    && !TARGET_VECTOR_ELEN_FP_64_P (riscv_vector_elen_flags))
    {
      error_at (EXPR_LOCATION (exp),
		"built-in function %qE requires the zve64d or v ISA extension",
		exp);
      return false;
    }

  if ((exts & RVV_REQUIRE_ELEN_64)
    && !TARGET_VECTOR_ELEN_64_P (riscv_vector_elen_flags))
    {
      error_at (EXPR_LOCATION (exp),
		"built-in function %qE requires the "
		"zve64x, zve64f, zve64d or v ISA extension",
		exp);
      return false;
    }

  return true;
}

/* Expand a call to the RVV function with subcode CODE.  EXP is the call
   expression and TARGET is the preferred location for the result.
   Return the value of the lhs.  */
rtx
expand_builtin (unsigned int code, tree exp, rtx target)
{
  registered_function &rfn = *(*registered_functions)[code];

  if (!required_extensions_specified (rfn.required))
    {
      error_at (EXPR_LOCATION (exp),
		"built-in function %qE requires the %qs ISA extension",
		exp,
		required_ext_to_isa_name (rfn.required));
      return target;
    }

  if (!validate_instance_type_required_extensions (rfn.instance.type, exp))
    return target;

  return function_expander (rfn.instance, rfn.decl, exp, target).expand ();
}

/* Perform any semantic checks needed for a call to the RVV function
   with subcode CODE, such as testing for integer constant expressions.
   The call occurs at location LOCATION and has NARGS arguments,
   given by ARGS.  FNDECL is the original function decl, before
   overload resolution.

   Return true if the call is valid, otherwise report a suitable error.  */
bool
check_builtin_call (location_t location, vec<location_t>, unsigned int code,
		    tree fndecl, unsigned int nargs, tree *args)
{
  const registered_function &rfn = *(*registered_functions)[code];
  return function_checker (location, rfn.instance, fndecl,
			   TREE_TYPE (rfn.decl), nargs, args).check ();
}

tree
resolve_overloaded_builtin (location_t loc, unsigned int code, tree fndecl,
			    vec<tree, va_gc> *arglist)
{
  if (code >= vec_safe_length (registered_functions))
    return NULL_TREE;

  registered_function *rfun = (*registered_functions)[code];

  if (!rfun || !rfun->overloaded_p)
    return NULL_TREE;

  /* According to the rvv intrinsic doc, we have no such overloaded function
     with empty args.  Unfortunately, we register the empty args function as
     overloaded for avoiding conflict.  Thus, there will actual one register
     function after return NULL_TREE back to the middle-end, and finally result
     in ICE when expanding.  For example:

     1. First we registered void __riscv_vfredmax () as the overloaded function.
     2. Then resolve_overloaded_builtin (this func) return NULL_TREE.
     3. The functions register in step 1 bypass the args check as empty args.
     4. Finally, fall into expand_builtin with empty args and meet ICE.

     Here we report error when overloaded function with empty args.  */
  if (rfun->overloaded_p && arglist->length () == 0)
    error_at (loc, "no matching function call to %qE with empty arguments",
	      fndecl);

  hashval_t hash = rfun->overloaded_hash (*arglist);
  registered_function *rfn
    = non_overloaded_function_table->find_with_hash (rfun, hash);

  return rfn ? rfn->decl : NULL_TREE;
}

function_instance
get_read_vl_instance (void)
{
  return function_instance ("read_vl", bases::read_vl, shapes::read_vl,
			    none_ops[0], PRED_TYPE_none, &p_none_void_ops);
}

tree
get_read_vl_decl (void)
{
  function_instance instance = get_read_vl_instance ();
  hashval_t hash = instance.hash ();
  registered_function *rfn = function_table->find_with_hash (instance, hash);
  gcc_assert (rfn);
  return rfn->decl;
}

} // end namespace riscv_vector

inline void
gt_ggc_mx (function_instance *)
{}

inline void
gt_pch_nx (function_instance *)
{}

inline void
gt_pch_nx (function_instance *, gt_pointer_operator, void *)
{}

#include "gt-riscv-vector-builtins.h"