Skip to content

Commit 24416a2

Browse files
committed
Autogenerate most x86 platform intrinsics.
1 parent 5a167bd commit 24416a2

File tree

10 files changed

+1593
-174
lines changed

10 files changed

+1593
-174
lines changed
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
{
2+
"llvm_prefix": "llvm.x86.avx.",
3+
"intrinsics": [
4+
{
5+
"intrinsic": "256_addsub_{0.data_type}",
6+
"width": [256],
7+
"llvm": "addsub.{0.data_type}.256",
8+
"ret": "f(32-64)",
9+
"args": ["0", "0"]
10+
},
11+
{
12+
"intrinsic": "256_dp_ps",
13+
"width": [256],
14+
"llvm": "dp.ps.256",
15+
"ret": "f32",
16+
"args": ["0", "0", "S32"]
17+
},
18+
{
19+
"intrinsic": "256_hadd_{0.data_type}",
20+
"width": [256],
21+
"llvm": "hadd.{0.data_type}.256",
22+
"ret": "f(32-64)",
23+
"args": ["0", "0"]
24+
},
25+
{
26+
"intrinsic": "256_hsub_{0.data_type}",
27+
"width": [256],
28+
"llvm": "hsub.{0.data_type}.256",
29+
"ret": "f(32-64)",
30+
"args": ["0", "0"]
31+
},
32+
{
33+
"intrinsic": "256_max_{0.data_type}",
34+
"width": [256],
35+
"llvm": "max.{0.data_type}.256",
36+
"ret": "f(32-64)",
37+
"args": ["0", "0"]
38+
},
39+
{
40+
"intrinsic": "256_min_{0.data_type}",
41+
"width": [256],
42+
"llvm": "min.{0.data_type}.256",
43+
"ret": "f(32-64)",
44+
"args": ["0", "0"]
45+
},
46+
{
47+
"intrinsic": "256_movemask_ps",
48+
"width": [256],
49+
"llvm": "movmsk.ps.256",
50+
"ret": "S32",
51+
"args": ["f32"]
52+
},
53+
{
54+
"intrinsic": "256_movemask_pd",
55+
"width": [256],
56+
"llvm": "movmsk.pd.256",
57+
"ret": "S32",
58+
"args": ["f64"]
59+
},
60+
{
61+
"intrinsic": "{0.width_mm}_permutevar_{0.data_type}",
62+
"width": [128, 256],
63+
"llvm": "vpermilvar.{0.data_type}{0.width_suffix}",
64+
"ret": "f(32-64)",
65+
"args": ["0", "0s"]
66+
},
67+
{
68+
"intrinsic": "256_rcp_ps",
69+
"width": [256],
70+
"llvm": "rcp.ps.256",
71+
"ret": "f32",
72+
"args": ["f32"]
73+
},
74+
{
75+
"intrinsic": "256_rsqrt_ps",
76+
"width": [256],
77+
"llvm": "rsqrt.ps.256",
78+
"ret": "f32",
79+
"args": ["f32"]
80+
},
81+
{
82+
"intrinsic": "256_sqrt_{0.data_type}",
83+
"width": [256],
84+
"llvm": "!llvm.sqrt.{0.llvm_name}",
85+
"ret": "f(32-64)",
86+
"args": ["0"]
87+
},
88+
{
89+
"intrinsic": "{1.width_mm}_testc_ps",
90+
"width": [128, 256],
91+
"llvm": "vtestc.ps{1.width_suffix}",
92+
"ret": "S32",
93+
"args": ["f32", "f32"]
94+
},
95+
{
96+
"intrinsic": "{1.width_mm}_testc_pd",
97+
"width": [128, 256],
98+
"llvm": "vtestc.pd{1.width_suffix}",
99+
"ret": "S32",
100+
"args": ["f64", "f64"]
101+
},
102+
{
103+
"intrinsic": "256_testc_si256",
104+
"width": [256],
105+
"llvm": "ptestc.256",
106+
"ret": "S32",
107+
"args": ["u64", "u64"]
108+
},
109+
{
110+
"intrinsic": "{1.width_mm}_testnzc_ps",
111+
"width": [128, 256],
112+
"llvm": "vtestnzc.ps{1.width_suffix}",
113+
"ret": "S32",
114+
"args": ["f32", "f32"]
115+
},
116+
{
117+
"intrinsic": "{1.width_mm}_testnzc_pd",
118+
"width": [128, 256],
119+
"llvm": "vtestnzc.pd{1.width_suffix}",
120+
"ret": "S32",
121+
"args": ["f64", "f64"]
122+
},
123+
{
124+
"intrinsic": "256_testnzc_si256",
125+
"width": [256],
126+
"llvm": "ptestnzc.256",
127+
"ret": "S32",
128+
"args": ["u64", "u64"]
129+
},
130+
{
131+
"intrinsic": "{1.width_mm}_testz_ps",
132+
"width": [128, 256],
133+
"llvm": "vtestz.ps{1.width_suffix}",
134+
"ret": "S32",
135+
"args": ["f32", "f32"]
136+
},
137+
{
138+
"intrinsic": "{1.width_mm}_testz_pd",
139+
"width": [128, 256],
140+
"llvm": "vtestz.pd{1.width_suffix}",
141+
"ret": "S32",
142+
"args": ["f64", "f64"]
143+
},
144+
{
145+
"intrinsic": "256_testz_si256",
146+
"width": [256],
147+
"llvm": "ptestz.256",
148+
"ret": "S32",
149+
"args": ["u64", "u64"]
150+
}
151+
]
152+
}
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
{
2+
"llvm_prefix": "llvm.x86.avx2.",
3+
"intrinsics": [
4+
{
5+
"intrinsic": "256_abs_{0.data_type}",
6+
"width": [256],
7+
"llvm": "avx2.pabs.{0.data_type_short}",
8+
"ret": "s(8-32)",
9+
"args": ["0"]
10+
},
11+
{
12+
"intrinsic": "256_adds_{0.data_type}",
13+
"width": [256],
14+
"llvm": "avx2.padd{0.kind_short}s.{0.data_type_short}",
15+
"ret": "i(8-16)",
16+
"args": ["0", "0"]
17+
},
18+
{
19+
"intrinsic": "256_avg_{0.data_type}",
20+
"width": [256],
21+
"llvm": "avx2.pavg.{0.data_type_short}",
22+
"ret": "u(8-16)",
23+
"args": ["0", "0"]
24+
},
25+
{
26+
"intrinsic": "256_hadd_{0.data_type}",
27+
"width": [256],
28+
"llvm": "phadd.{0.data_type_short}",
29+
"ret": "s(16-32)",
30+
"args": ["0", "0"]
31+
},
32+
{
33+
"intrinsic": "256_hadds_epi16",
34+
"width": [256],
35+
"llvm": "phadd.sw",
36+
"ret": "s16",
37+
"args": ["0", "0"]
38+
},
39+
{
40+
"intrinsic": "256_hsub_{0.data_type}",
41+
"width": [256],
42+
"llvm": "phsub.{0.data_type_short}",
43+
"ret": "s(16-32)",
44+
"args": ["0", "0"]
45+
},
46+
{
47+
"intrinsic": "256_hsubs_epi16",
48+
"width": [256],
49+
"llvm": "phsub.sw",
50+
"ret": "s16",
51+
"args": ["0", "0"]
52+
},
53+
{
54+
"intrinsic": "256_madd_epi16",
55+
"width": [256],
56+
"llvm": "pmadd.wd",
57+
"ret": "s32",
58+
"args": ["s16", "s16"]
59+
},
60+
{
61+
"intrinsic": "256_maddubs_epi16",
62+
"width": [256],
63+
"llvm": "pmadd.ub.sw",
64+
"ret": "s16",
65+
"args": ["s8", "s8"]
66+
},
67+
{
68+
"intrinsic": "256_max_{0.data_type}",
69+
"width": [256],
70+
"llvm": "pmax{0.kind}.{0.data_type_short}",
71+
"ret": "i(8-32)",
72+
"args": ["0", "0"]
73+
},
74+
{
75+
"intrinsic": "256_min_{0.data_type}",
76+
"width": [256],
77+
"llvm": "pmin{0.kind}.{0.data_type_short}",
78+
"ret": "i(8-32)",
79+
"args": ["0", "0"]
80+
},
81+
{
82+
"intrinsic": "256_mul_{0.data_type}",
83+
"width": [256],
84+
"llvm": "pmul{0.data_type_short}.dq",
85+
"ret": "i64",
86+
"args": ["0dn", "0dn"]
87+
},
88+
{
89+
"intrinsic": "256_mulhi_{0.data_type}",
90+
"width": [256],
91+
"llvm": "pmulh{0.data_type_short}.w",
92+
"ret": "i16",
93+
"args": ["0", "0"]
94+
},
95+
{
96+
"intrinsic": "256_mulhrs_epi16",
97+
"width": [256],
98+
"llvm": "pmul.hr.sw",
99+
"ret": "s16",
100+
"args": ["0", "0"]
101+
},
102+
{
103+
"intrinsic": "256_pack{0.kind_short}s_{1.data_type}",
104+
"width": [256],
105+
"llvm": "pack{0.kind}s{1.data_type_short}{0.data_type_short}",
106+
"ret": "i(8-16)",
107+
"args": ["0hws", "0hws"]
108+
},
109+
{
110+
"intrinsic": "256_permutevar8x32_{0.data_type}",
111+
"width": [256],
112+
"llvm": "perm{0.data_type_short}",
113+
"ret": ["s32", "f32"],
114+
"args": ["0", "0s"]
115+
},
116+
{
117+
"intrinsic": "256_sad_epu8",
118+
"width": [256],
119+
"llvm": "psad.bw",
120+
"ret": "u8",
121+
"args": ["0", "0"]
122+
},
123+
{
124+
"intrinsic": "256_shuffle_epi8",
125+
"width": [256],
126+
"llvm": "pshuf.b",
127+
"ret": "s8",
128+
"args": ["0", "0"]
129+
},
130+
{
131+
"intrinsic": "256_sign_{0.data_type}",
132+
"width": [256],
133+
"llvm": "psign.{0.data_type_short}",
134+
"ret": "s(8-32)",
135+
"args": ["0", "0"]
136+
},
137+
{
138+
"intrinsic": "256_subs_{0.data_type}",
139+
"width": [256],
140+
"llvm": "psub{0.kind_short}s.{0.data_type_short}",
141+
"ret": "i(8-16)",
142+
"args": ["0", "0"]
143+
}
144+
]
145+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"platform": "x86",
3+
"intrinsic_prefix": "x86_mm",
4+
"number_info": {
5+
"signed": {
6+
"kind": "s",
7+
"kind_short": "",
8+
"data_type": { "pattern": "epi{bitwidth}" },
9+
"data_type_short": { "8": "b", "16": "w", "32": "d", "64": "q" }
10+
},
11+
"unsigned": {
12+
"kind": "u",
13+
"kind_short": "u",
14+
"data_type": { "pattern": "epu{bitwidth}" },
15+
"data_type_short": { "8": "b", "16": "w", "32": "d", "64": "q" }
16+
},
17+
"float": {
18+
"kind": "f",
19+
"data_type": { "32": "ps", "64": "pd" },
20+
"data_type_short": { "32": "ps", "64": "pd" }
21+
}
22+
},
23+
"width_info": {
24+
"128": { "width_mm": "", "width_suffix": "" },
25+
"256": { "width_mm": "256", "width_suffix": ".256" },
26+
"512": { "width_mm": "512", "width_suffix": ".512" }
27+
}
28+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"llvm_prefix": "llvm.x86.sse.",
3+
"intrinsics": [
4+
{
5+
"intrinsic": "_movemask_ps",
6+
"width": [128],
7+
"llvm": "movmsk.ps",
8+
"ret": "S32",
9+
"args": ["f32"]
10+
},
11+
{
12+
"intrinsic": "_max_ps",
13+
"width": [128],
14+
"llvm": "max.ps",
15+
"ret": "f32",
16+
"args": ["0", "0"]
17+
},
18+
{
19+
"intrinsic": "_min_ps",
20+
"width": [128],
21+
"llvm": "min.ps",
22+
"ret": "f32",
23+
"args": ["0", "0"]
24+
},
25+
{
26+
"intrinsic": "_rsqrt_ps",
27+
"width": [128],
28+
"llvm": "rsqrt.ps",
29+
"ret": "f32",
30+
"args": ["0"]
31+
},
32+
{
33+
"intrinsic": "_rcp_ps",
34+
"width": [128],
35+
"llvm": "rcp.ps",
36+
"ret": "f32",
37+
"args": ["0"]
38+
}
39+
]
40+
}

0 commit comments

Comments
 (0)