AVX512: vsqrtss/sd encoding and intrinsics implementation.
[oota-llvm.git] / test / MC / X86 / intel-syntax-avx512.s
1 // RUN: llvm-mc -triple x86_64-unknown-unknown -x86-asm-syntax=intel -output-asm-variant=1 -mcpu=knl --show-encoding %s | FileCheck %s
2
3 // CHECK: vaddps  zmm1 , zmm1, zmmword ptr [rax]
4 // CHECK: encoding: [0x62,0xf1,0x74,0x48,0x58,0x08]
5 vaddps zmm1, zmm1, zmmword ptr [rax]
6
7 // CHECK: vaddpd  zmm1 , zmm1, zmm2
8 // CHECK:  encoding: [0x62,0xf1,0xf5,0x48,0x58,0xca]
9 vaddpd zmm1,zmm1,zmm2
10
11 // CHECK: vaddpd  zmm1 {k5}, zmm1, zmm2
12 // CHECK:  encoding: [0x62,0xf1,0xf5,0x4d,0x58,0xca]
13 vaddpd zmm1{k5},zmm1,zmm2
14
15 // CHECK: vaddpd zmm1 {k5} {z}, zmm1, zmm2
16 // CHECK:  encoding: [0x62,0xf1,0xf5,0xcd,0x58,0xca]
17 vaddpd zmm1{k5} {z},zmm1,zmm2
18
19 // CHECK: vaddpd zmm1 , zmm1, zmm2, {rn-sae}
20 // CHECK:  encoding: [0x62,0xf1,0xf5,0x18,0x58,0xca]
21 vaddpd zmm1,zmm1,zmm2,{rn-sae}
22
23 // CHECK: vaddpd zmm1 , zmm1, zmm2, {ru-sae}
24 // CHECK:  encoding: [0x62,0xf1,0xf5,0x58,0x58,0xca]
25 vaddpd zmm1,zmm1,zmm2,{ru-sae}
26
27 // CHECK:  vaddpd zmm1 , zmm1, zmm2, {rd-sae}
28 // CHECK:  encoding: [0x62,0xf1,0xf5,0x38,0x58,0xca]
29 vaddpd zmm1,zmm1,zmm2,{rd-sae}
30
31 // CHECK: vaddpd zmm1 , zmm1, zmm2, {rz-sae}
32 // CHECK:  encoding: [0x62,0xf1,0xf5,0x78,0x58,0xca]
33 vaddpd zmm1,zmm1,zmm2,{rz-sae}
34
35 // CHECK: vcmppd k2 , zmm12, zmm26, 171
36 // CHECK:  encoding: [0x62,0x91,0x9d,0x48,0xc2,0xd2,0xab]
37           vcmppd k2,zmm12,zmm26,0xab
38
39 // CHECK: vcmppd k2 {k3}, zmm12, zmm26, 171
40 // CHECK:  encoding: [0x62,0x91,0x9d,0x4b,0xc2,0xd2,0xab]
41           vcmppd k2{k3},zmm12,zmm26,0xab
42
43 // CHECK: vcmppd k2 , zmm12, zmm26,{sae}, 171
44 // CHECK:  encoding: [0x62,0x91,0x9d,0x18,0xc2,0xd2,0xab]
45           vcmppd k2,zmm12,zmm26,{sae},0xab
46
47 // CHECK: vcmppd k2 , zmm12, zmm26, 123
48 // CHECK:  encoding: [0x62,0x91,0x9d,0x48,0xc2,0xd2,0x7b]
49           vcmppd k2 ,zmm12,zmm26,0x7b
50
51 // CHECK: vcmppd k2 , zmm12, zmm26,{sae}, 123
52 // CHECK:  encoding: [0x62,0x91,0x9d,0x18,0xc2,0xd2,0x7b]
53           vcmppd k2,zmm12,zmm26,{sae},0x7b
54
55 // CHECK: vcmppd k2 , zmm12, zmmword ptr [rcx], 123
56 // CHECK:  encoding: [0x62,0xf1,0x9d,0x48,0xc2,0x11,0x7b]
57           vcmppd k2,zmm12,zmmword PTR [rcx],0x7b
58
59 // CHECK: vcmppd  k2 , zmm12, zmmword ptr [rax + 8*r14 + 291], 123
60 // CHECK:  encoding: [0x62,0xb1,0x9d,0x48,0xc2,0x94,0xf0,0x23,0x01,0x00,0x00,0x7b]
61           vcmppd k2 ,zmm12,zmmword PTR [rax+r14*8+0x123],0x7b
62
63 // CHECK: vcmppd  k2 , zmm12, qword ptr [rcx]{1to8}, 123
64 // CHECK:  encoding: [0x62,0xf1,0x9d,0x58,0xc2,0x11,0x7b]
65           vcmppd k2,zmm12,QWORD PTR [rcx]{1to8},0x7b
66
67 // CHECK: vcmppd  k2 , zmm12, zmmword ptr [rdx + 8128], 123
68 // CHECK:  encoding: [0x62,0xf1,0x9d,0x48,0xc2,0x52,0x7f,0x7b]
69           vcmppd k2,zmm12,zmmword PTR [rdx+0x1fc0],0x7b
70
71 // CHECK: vcmppd  k2 , zmm12, zmmword ptr [rdx + 8192], 123
72 // CHECK:  encoding: [0x62,0xf1,0x9d,0x48,0xc2,0x92,0x00,0x20,0x00,0x00,0x7b]
73           vcmppd k2,zmm12,zmmword PTR [rdx+0x2000],0x7b
74
75 // CHECK: vcmppd  k2 , zmm12, zmmword ptr [rdx - 8192], 123
76 // CHECK:  encoding: [0x62,0xf1,0x9d,0x48,0xc2,0x52,0x80,0x7b]
77           vcmppd k2,zmm12,zmmword PTR [rdx-0x2000],0x7b
78
79 // CHECK: vcmppd  k2 , zmm12, zmmword ptr [rdx - 8256], 123
80 // CHECK:  encoding: [0x62,0xf1,0x9d,0x48,0xc2,0x92,0xc0,0xdf,0xff,0xff,0x7b]
81           vcmppd k2,zmm12,zmmword PTR [rdx-0x2040],0x7b
82
83 // CHECK: vcmppd  k2 , zmm12, qword ptr [rdx + 1016]{1to8}, 123
84 // CHECK:  encoding: [0x62,0xf1,0x9d,0x58,0xc2,0x52,0x7f,0x7b]
85           vcmppd k2,zmm12,QWORD PTR [rdx+0x3f8]{1to8},0x7b
86
87 // CHECK: vcmppd  k2 , zmm12, qword ptr [rdx + 1024]{1to8}, 123
88 // CHECK:  encoding: [0x62,0xf1,0x9d,0x58,0xc2,0x92,0x00,0x04,0x00,0x00,0x7b]
89           vcmppd k2,zmm12,QWORD PTR [rdx+0x400]{1to8},0x7b
90
91 // CHECK: vcmppd  k2 , zmm12, qword ptr [rdx - 1024]{1to8}, 123
92 // CHECK:  encoding: [0x62,0xf1,0x9d,0x58,0xc2,0x52,0x80,0x7b]
93           vcmppd k2,zmm12,QWORD PTR [rdx-0x400]{1to8},0x7b
94
95 // CHECK: vcmppd  k2 , zmm12, qword ptr [rdx - 1032]{1to8}, 123
96 // CHECK:  encoding: [0x62,0xf1,0x9d,0x58,0xc2,0x92,0xf8,0xfb,0xff,0xff,0x7b]
97           vcmppd k2,zmm12,QWORD PTR [rdx-0x408]{1to8},0x7b
98
99 // CHECK: vcmpps  k2 , zmm17, zmm22, 171
100 // CHECK:  encoding: [0x62,0xb1,0x74,0x40,0xc2,0xd6,0xab]
101           vcmpps k2,zmm17,zmm22,0xab
102
103 // CHECK: vcmpps  k2 {k3}, zmm17, zmm22, 171
104 // CHECK:  encoding: [0x62,0xb1,0x74,0x43,0xc2,0xd6,0xab]
105           vcmpps k2{k3},zmm17,zmm22,0xab
106
107 // CHECK: vcmpps  k2 , zmm17, zmm22,{sae}, 171
108 // CHECK:  encoding: [0x62,0xb1,0x74,0x10,0xc2,0xd6,0xab]
109           vcmpps k2,zmm17,zmm22,{sae},0xab
110
111 // CHECK: vcmpps  k2 , zmm17, zmm22, 123
112 // CHECK:  encoding: [0x62,0xb1,0x74,0x40,0xc2,0xd6,0x7b]
113           vcmpps k2,zmm17,zmm22,0x7b
114
115 // CHECK: vcmpps  k2 , zmm17, zmm22,{sae}, 123
116 // CHECK:  encoding: [0x62,0xb1,0x74,0x10,0xc2,0xd6,0x7b]
117           vcmpps k2,zmm17,zmm22,{sae},0x7b
118
119 // CHECK: vcmpps  k2 , zmm17, zmmword ptr [rcx], 123
120 // CHECK:  encoding: [0x62,0xf1,0x74,0x40,0xc2,0x11,0x7b]
121           vcmpps k2,zmm17,zmmword PTR [rcx],0x7b
122
123 // CHECK: vcmpps  k2 , zmm17, zmmword ptr [rax + 8*r14 + 291], 123
124 // CHECK:  encoding: [0x62,0xb1,0x74,0x40,0xc2,0x94,0xf0,0x23,0x01,0x00,0x00,0x7b]
125           vcmpps k2,zmm17,zmmword PTR [rax+r14*8+0x123],0x7b
126
127 // CHECK: vcmpps  k2 , zmm17, dword ptr [rcx]{1to16}, 123
128 // CHECK:  encoding: [0x62,0xf1,0x74,0x50,0xc2,0x11,0x7b]
129           vcmpps k2,zmm17,DWORD PTR [rcx]{1to16},0x7b
130
131 // CHECK: vcmpps  k2 , zmm17, zmmword ptr [rdx + 8128], 123
132 // CHECK:  encoding: [0x62,0xf1,0x74,0x40,0xc2,0x52,0x7f,0x7b]
133           vcmpps k2,zmm17,zmmword PTR [rdx+0x1fc0],0x7b
134
135 // CHECK: vcmpps  k2 , zmm17, zmmword ptr [rdx + 8192], 123
136 // CHECK:  encoding: [0x62,0xf1,0x74,0x40,0xc2,0x92,0x00,0x20,0x00,0x00,0x7b]
137           vcmpps k2,zmm17,zmmword PTR [rdx+0x2000],0x7b
138
139 // CHECK: vcmpps  k2 , zmm17, zmmword ptr [rdx - 8192], 123
140 // CHECK:  encoding: [0x62,0xf1,0x74,0x40,0xc2,0x52,0x80,0x7b]
141           vcmpps k2,zmm17,zmmword PTR [rdx-0x2000],0x7b
142
143 // CHECK: vcmpps  k2 , zmm17, zmmword ptr [rdx - 8256], 123
144 // CHECK:  encoding: [0x62,0xf1,0x74,0x40,0xc2,0x92,0xc0,0xdf,0xff,0xff,0x7b]
145           vcmpps k2,zmm17,zmmword PTR [rdx-0x2040],0x7b
146
147 // CHECK: vcmpps  k2 , zmm17, dword ptr [rdx + 508]{1to16}, 123
148 // CHECK:  encoding: [0x62,0xf1,0x74,0x50,0xc2,0x52,0x7f,0x7b]
149           vcmpps k2,zmm17,DWORD PTR [rdx+0x1fc]{1to16},0x7b
150
151 // CHECK: vcmpps  k2 , zmm17, dword ptr [rdx + 512]{1to16}, 123
152 // CHECK:  encoding: [0x62,0xf1,0x74,0x50,0xc2,0x92,0x00,0x02,0x00,0x00,0x7b]
153           vcmpps k2,zmm17,DWORD PTR [rdx+0x200]{1to16},0x7b
154
155 // CHECK: vcmpps  k2 , zmm17, dword ptr [rdx - 512]{1to16}, 123
156 // CHECK:  encoding: [0x62,0xf1,0x74,0x50,0xc2,0x52,0x80,0x7b]
157           vcmpps k2,zmm17,DWORD PTR [rdx-0x200]{1to16},0x7b
158
159 // CHECK: vcmpps  k2 , zmm17, dword ptr [rdx - 516]{1to16}, 123
160 // CHECK:  encoding: [0x62,0xf1,0x74,0x50,0xc2,0x92,0xfc,0xfd,0xff,0xff,0x7b]
161           vcmpps k2,zmm17,DWORD PTR [rdx-0x204]{1to16},0x7b
162
163
164 // CHECK:  vfixupimmss  xmm15 , xmm18, xmm28, 171
165 // CHECK:  encoding: [0x62,0x13,0x6d,0x00,0x55,0xfc,0xab]
166           vfixupimmss xmm15,xmm18,xmm28,0xab
167
168 // CHECK:  vfixupimmss  xmm15 {k5}, xmm18, xmm28, 171
169 // CHECK:  encoding: [0x62,0x13,0x6d,0x05,0x55,0xfc,0xab]
170           vfixupimmss xmm15{k5},xmm18,xmm28,0xab
171
172 // CHECK:  vfixupimmss  xmm15 {k5} {z}, xmm18, xmm28, 171
173 // CHECK:  encoding: [0x62,0x13,0x6d,0x85,0x55,0xfc,0xab]
174           vfixupimmss xmm15{k5} {z},xmm18,xmm28,0xab
175
176 // CHECK:  vfixupimmss  xmm15 , xmm18, xmm28,{sae}, 171
177 // CHECK:  encoding: [0x62,0x13,0x6d,0x10,0x55,0xfc,0xab]
178           vfixupimmss xmm15,xmm18,xmm28,{sae},0xab
179
180 // CHECK:  vfixupimmss  xmm15 , xmm18, xmm28, 123
181 // CHECK:  encoding: [0x62,0x13,0x6d,0x00,0x55,0xfc,0x7b]
182           vfixupimmss xmm15,xmm18,xmm28,0x7b
183
184 // CHECK:  vfixupimmss  xmm15 , xmm18, xmm28,{sae}, 123
185 // CHECK:  encoding: [0x62,0x13,0x6d,0x10,0x55,0xfc,0x7b]
186           vfixupimmss xmm15,xmm18,xmm28,{sae},0x7b
187
188 // CHECK:  vfixupimmss  xmm15 , xmm18, dword ptr [rcx], 123
189 // CHECK:  encoding: [0x62,0x73,0x6d,0x00,0x55,0x39,0x7b]
190           vfixupimmss xmm15,xmm18,DWORD PTR [rcx],0x7b
191
192 // CHECK:  vfixupimmss  xmm15 , xmm18, dword ptr [rax + 8*r14 + 291], 123
193 // CHECK:  encoding: [0x62,0x33,0x6d,0x00,0x55,0xbc,0xf0,0x23,0x01,0x00,0x00,0x7b]
194           vfixupimmss xmm15,xmm18,DWORD PTR [rax+r14*8+0x123],0x7b
195
196 // CHECK:  vfixupimmss  xmm15 , xmm18, dword ptr [rdx + 508], 123
197 // CHECK:  encoding: [0x62,0x73,0x6d,0x00,0x55,0x7a,0x7f,0x7b]
198           vfixupimmss xmm15,xmm18,DWORD PTR [rdx+0x1fc],0x7b
199
200 // CHECK:  vfixupimmss  xmm15 , xmm18, dword ptr [rdx + 512], 123
201 // CHECK:  encoding: [0x62,0x73,0x6d,0x00,0x55,0xba,0x00,0x02,0x00,0x00,0x7b]
202           vfixupimmss xmm15,xmm18,DWORD PTR [rdx+0x200],0x7b
203
204 // CHECK:  vfixupimmss  xmm15 , xmm18, dword ptr [rdx - 512], 123
205 // CHECK:  encoding: [0x62,0x73,0x6d,0x00,0x55,0x7a,0x80,0x7b]
206           vfixupimmss xmm15,xmm18,DWORD PTR [rdx-0x200],0x7b
207
208 // CHECK:  vfixupimmss  xmm15 , xmm18, dword ptr [rdx - 516], 123
209 // CHECK:  encoding: [0x62,0x73,0x6d,0x00,0x55,0xba,0xfc,0xfd,0xff,0xff,0x7b]
210           vfixupimmss xmm15,xmm18,DWORD PTR [rdx-0x204],0x7b
211
212 // CHECK:  vfixupimmsd  xmm13 , xmm26, xmm5, 171
213 // CHECK:  encoding: [0x62,0x73,0xad,0x00,0x55,0xed,0xab]
214           vfixupimmsd xmm13,xmm26,xmm5,0xab
215
216 // CHECK:  vfixupimmsd  xmm13 {k6}, xmm26, xmm5, 171
217 // CHECK:  encoding: [0x62,0x73,0xad,0x06,0x55,0xed,0xab]
218           vfixupimmsd xmm13{k6},xmm26,xmm5,0xab
219
220 // CHECK:  vfixupimmsd  xmm13 {k6} {z}, xmm26, xmm5, 171
221 // CHECK:  encoding: [0x62,0x73,0xad,0x86,0x55,0xed,0xab]
222           vfixupimmsd xmm13{k6} {z},xmm26,xmm5,0xab
223
224 // CHECK:  vfixupimmsd  xmm13 , xmm26, xmm5,{sae}, 171
225 // CHECK:  encoding: [0x62,0x73,0xad,0x10,0x55,0xed,0xab]
226           vfixupimmsd xmm13,xmm26,xmm5,{sae},0xab
227
228 // CHECK:  vfixupimmsd  xmm13 , xmm26, xmm5, 123
229 // CHECK:  encoding: [0x62,0x73,0xad,0x00,0x55,0xed,0x7b]
230           vfixupimmsd xmm13,xmm26,xmm5,0x7b
231
232 // CHECK:  vfixupimmsd  xmm13 , xmm26, xmm5,{sae}, 123
233 // CHECK:  encoding: [0x62,0x73,0xad,0x10,0x55,0xed,0x7b]
234           vfixupimmsd xmm13,xmm26,xmm5,{sae},0x7b
235
236 // CHECK:  vfixupimmsd  xmm13 , xmm26, qword ptr [rcx], 123
237 // CHECK:  encoding: [0x62,0x73,0xad,0x00,0x55,0x29,0x7b]
238           vfixupimmsd xmm13,xmm26,QWORD PTR [rcx],0x7b
239
240 // CHECK:  vfixupimmsd  xmm13 , xmm26, qword ptr [rax + 8*r14 + 291], 123
241 // CHECK:  encoding: [0x62,0x33,0xad,0x00,0x55,0xac,0xf0,0x23,0x01,0x00,0x00,0x7b]
242           vfixupimmsd xmm13,xmm26,QWORD PTR [rax+r14*8+0x123],0x7b
243
244 // CHECK:  vfixupimmsd  xmm13 , xmm26, qword ptr [rdx + 1016], 123
245 // CHECK:  encoding: [0x62,0x73,0xad,0x00,0x55,0x6a,0x7f,0x7b]
246           vfixupimmsd xmm13,xmm26,QWORD PTR [rdx+0x3f8],0x7b
247
248 // CHECK:  vfixupimmsd  xmm13 , xmm26, qword ptr [rdx + 1024], 123
249 // CHECK:  encoding: [0x62,0x73,0xad,0x00,0x55,0xaa,0x00,0x04,0x00,0x00,0x7b]
250           vfixupimmsd xmm13,xmm26,QWORD PTR [rdx+0x400],0x7b
251
252 // CHECK:  vfixupimmsd  xmm13 , xmm26, qword ptr [rdx - 1024], 123
253 // CHECK:  encoding: [0x62,0x73,0xad,0x00,0x55,0x6a,0x80,0x7b]
254           vfixupimmsd xmm13,xmm26,QWORD PTR [rdx-0x400],0x7b
255
256 // CHECK:  vfixupimmsd  xmm13 , xmm26, qword ptr [rdx - 1032], 123
257 // CHECK:  encoding: [0x62,0x73,0xad,0x00,0x55,0xaa,0xf8,0xfb,0xff,0xff,0x7b]
258           vfixupimmsd xmm13,xmm26,QWORD PTR [rdx-0x408],0x7b
259
260 // CHECK:  vcomisd xmm23, qword ptr [rcx]
261 // CHECK:  encoding: [0x62,0xe1,0xfd,0x08,0x2f,0x39]
262           vcomisd xmm23, QWORD PTR [rcx]
263
264 // CHECK:  vcomiss xmm16, dword ptr [rcx]
265 // CHECK:  encoding: [0x62,0xe1,0x7c,0x08,0x2f,0x01]
266           vcomiss xmm16, DWORD PTR [rcx]