[obj2yaml] - Fix a comment. NFC.
[llvm-complete.git] / test / MC / X86 / x86_64-encoding.s
blobbfa7304ca9502491c3e56d5b85aa9e0ef31bbb2b
1 // RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s
3 // PR7195
4 // CHECK: callw 42
5 // CHECK: encoding: [0x66,0xe8,A,A]
6 callw 42
8 // rdar://8127102
9 // CHECK: movq %gs:(%rdi), %rax
10 // CHECK: encoding: [0x65,0x48,0x8b,0x07]
11 movq %gs:(%rdi), %rax
13 // CHECK: crc32b %bl, %eax
14 // CHECK: encoding: [0xf2,0x0f,0x38,0xf0,0xc3]
15 crc32b %bl, %eax
17 // CHECK: crc32b 4(%rbx), %eax
18 // CHECK: encoding: [0xf2,0x0f,0x38,0xf0,0x43,0x04]
19 crc32b 4(%rbx), %eax
21 // CHECK: crc32w %bx, %eax
22 // CHECK: encoding: [0x66,0xf2,0x0f,0x38,0xf1,0xc3]
23 crc32w %bx, %eax
25 // CHECK: crc32w 4(%rbx), %eax
26 // CHECK: encoding: [0x66,0xf2,0x0f,0x38,0xf1,0x43,0x04]
27 crc32w 4(%rbx), %eax
29 // CHECK: crc32l %ebx, %eax
30 // CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0xc3]
31 crc32l %ebx, %eax
33 // CHECK: crc32l 4(%rbx), %eax
34 // CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x43,0x04]
35 crc32l 4(%rbx), %eax
37 // CHECK: crc32l 3735928559(%rbx,%rcx,8), %ecx
38 // CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x8c,0xcb,0xef,0xbe,0xad,0xde]
39 crc32l 0xdeadbeef(%rbx,%rcx,8),%ecx
41 // CHECK: crc32l 69, %ecx
42 // CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x0c,0x25,0x45,0x00,0x00,0x00]
43 crc32l 0x45,%ecx
45 // CHECK: crc32l 32493, %ecx
46 // CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x0c,0x25,0xed,0x7e,0x00,0x00]
47 crc32l 0x7eed,%ecx
49 // CHECK: crc32l 3133065982, %ecx
50 // CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x0c,0x25,0xfe,0xca,0xbe,0xba]
51 crc32l 0xbabecafe,%ecx
53 // CHECK: crc32l %ecx, %ecx
54 // CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0xc9]
55 crc32l %ecx,%ecx
57 // CHECK: crc32b %r11b, %eax
58 // CHECK: encoding: [0xf2,0x41,0x0f,0x38,0xf0,0xc3]
59 crc32b %r11b, %eax
61 // CHECK: crc32b 4(%rbx), %eax
62 // CHECK: encoding: [0xf2,0x0f,0x38,0xf0,0x43,0x04]
63 crc32b 4(%rbx), %eax
65 // CHECK: crc32b %dil, %rax
66 // CHECK: encoding: [0xf2,0x48,0x0f,0x38,0xf0,0xc7]
67 crc32b %dil,%rax
69 // CHECK: crc32b %r11b, %rax
70 // CHECK: encoding: [0xf2,0x49,0x0f,0x38,0xf0,0xc3]
71 crc32b %r11b,%rax
73 // CHECK: crc32b 4(%rbx), %rax
74 // CHECK: encoding: [0xf2,0x48,0x0f,0x38,0xf0,0x43,0x04]
75 crc32b 4(%rbx), %rax
77 // CHECK: crc32q %rbx, %rax
78 // CHECK: encoding: [0xf2,0x48,0x0f,0x38,0xf1,0xc3]
79 crc32q %rbx, %rax
81 // CHECK: crc32q 4(%rbx), %rax
82 // CHECK: encoding: [0xf2,0x48,0x0f,0x38,0xf1,0x43,0x04]
83 crc32q 4(%rbx), %rax
85 // CHECK: movq %r8, %mm1
86 // CHECK: encoding: [0x49,0x0f,0x6e,0xc8]
87 movd %r8, %mm1
89 // CHECK: movd %r8d, %mm1
90 // CHECK: encoding: [0x41,0x0f,0x6e,0xc8]
91 movd %r8d, %mm1
93 // CHECK: movq %rdx, %mm1
94 // CHECK: encoding: [0x48,0x0f,0x6e,0xca]
95 movd %rdx, %mm1
97 // CHECK: movd %edx, %mm1
98 // CHECK: encoding: [0x0f,0x6e,0xca]
99 movd %edx, %mm1
101 // CHECK: movq %mm1, %r8
102 // CHECK: encoding: [0x49,0x0f,0x7e,0xc8]
103 movd %mm1, %r8
105 // CHECK: movd %mm1, %r8d
106 // CHECK: encoding: [0x41,0x0f,0x7e,0xc8]
107 movd %mm1, %r8d
109 // CHECK: movq %mm1, %rdx
110 // CHECK: encoding: [0x48,0x0f,0x7e,0xca]
111 movd %mm1, %rdx
113 // CHECK: movd %mm1, %edx
114 // CHECK: encoding: [0x0f,0x7e,0xca]
115 movd %mm1, %edx
117 // CHECK: movd %mm1, (%rax)
118 // CHECK: encoding: [0x0f,0x7e,0x08]
119 movd %mm1, (%rax)
121 // CHECK: movd (%rax), %mm1
122 // CHECK: encoding: [0x0f,0x6e,0x08]
123 movd (%rax), %mm1
125 // CHECK: movq %r8, %mm1
126 // CHECK: encoding: [0x49,0x0f,0x6e,0xc8]
127 movq %r8, %mm1
129 // CHECK: movq %rdx, %mm1
130 // CHECK: encoding: [0x48,0x0f,0x6e,0xca]
131 movq %rdx, %mm1
133 // CHECK: movq %mm1, %r8
134 // CHECK: encoding: [0x49,0x0f,0x7e,0xc8]
135 movq %mm1, %r8
137 // CHECK: movq %mm1, %rdx
138 // CHECK: encoding: [0x48,0x0f,0x7e,0xca]
139 movq %mm1, %rdx
141 // rdar://7840289
142 // CHECK: pshufb CPI1_0(%rip), %xmm1
143 // CHECK: encoding: [0x66,0x0f,0x38,0x00,0x0d,A,A,A,A]
144 // CHECK: fixup A - offset: 5, value: CPI1_0-4
145 pshufb CPI1_0(%rip), %xmm1
147 // CHECK: sha1rnds4 $1, %xmm1, %xmm2
148 // CHECK: encoding: [0x0f,0x3a,0xcc,0xd1,0x01]
149 sha1rnds4 $1, %xmm1, %xmm2
151 // CHECK: sha1rnds4 $1, (%rax), %xmm2
152 // CHECK: encoding: [0x0f,0x3a,0xcc,0x10,0x01]
153 sha1rnds4 $1, (%rax), %xmm2
155 // CHECK: sha1nexte %xmm1, %xmm2
156 // CHECK: encoding: [0x0f,0x38,0xc8,0xd1]
157 sha1nexte %xmm1, %xmm2
159 // CHECK: sha1msg1 %xmm1, %xmm2
160 // CHECK: encoding: [0x0f,0x38,0xc9,0xd1]
161 sha1msg1 %xmm1, %xmm2
163 // CHECK: sha1msg1 (%rax), %xmm2
164 // CHECK: encoding: [0x0f,0x38,0xc9,0x10]
165 sha1msg1 (%rax), %xmm2
167 // CHECK: sha1msg2 %xmm1, %xmm2
168 // CHECK: encoding: [0x0f,0x38,0xca,0xd1]
169 sha1msg2 %xmm1, %xmm2
171 // CHECK: sha1msg2 (%rax), %xmm2
172 // CHECK: encoding: [0x0f,0x38,0xca,0x10]
173 sha1msg2 (%rax), %xmm2
175 // CHECK: sha256rnds2 %xmm0, (%rax), %xmm2
176 // CHECK: encoding: [0x0f,0x38,0xcb,0x10]
177 sha256rnds2 (%rax), %xmm2
179 // CHECK: sha256rnds2 %xmm0, %xmm1, %xmm2
180 // CHECK: encoding: [0x0f,0x38,0xcb,0xd1]
181 sha256rnds2 %xmm1, %xmm2
183 // CHECK: sha256rnds2 %xmm0, (%rax), %xmm2
184 // CHECK: encoding: [0x0f,0x38,0xcb,0x10]
185 sha256rnds2 %xmm0, (%rax), %xmm2
187 // CHECK: sha256rnds2 %xmm0, %xmm1, %xmm2
188 // CHECK: encoding: [0x0f,0x38,0xcb,0xd1]
189 sha256rnds2 %xmm0, %xmm1, %xmm2
191 // CHECK: sha256msg1 %xmm1, %xmm2
192 // CHECK: encoding: [0x0f,0x38,0xcc,0xd1]
193 sha256msg1 %xmm1, %xmm2
195 // CHECK: sha256msg1 (%rax), %xmm2
196 // CHECK: encoding: [0x0f,0x38,0xcc,0x10]
197 sha256msg1 (%rax), %xmm2
199 // CHECK: sha256msg2 %xmm1, %xmm2
200 // CHECK: encoding: [0x0f,0x38,0xcd,0xd1]
201 sha256msg2 %xmm1, %xmm2
203 // CHECK: sha256msg2 (%rax), %xmm2
204 // CHECK: encoding: [0x0f,0x38,0xcd,0x10]
205 sha256msg2 (%rax), %xmm2
207 // CHECK: movq 57005(,%riz), %rbx
208 // CHECK: encoding: [0x48,0x8b,0x1c,0x25,0xad,0xde,0x00,0x00]
209 movq 57005(,%riz), %rbx
211 // CHECK: movq 48879(,%riz), %rax
212 // CHECK: encoding: [0x48,0x8b,0x04,0x25,0xef,0xbe,0x00,0x00]
213 movq 48879(,%riz), %rax
215 // CHECK: movq -4(,%riz,8), %rax
216 // CHECK: encoding: [0x48,0x8b,0x04,0xe5,0xfc,0xff,0xff,0xff]
217 movq -4(,%riz,8), %rax
219 // CHECK: movq (%rcx,%riz), %rax
220 // CHECK: encoding: [0x48,0x8b,0x04,0x21]
221 movq (%rcx,%riz), %rax
223 // CHECK: movq (%rcx,%riz,8), %rax
224 // CHECK: encoding: [0x48,0x8b,0x04,0xe1]
225 movq (%rcx,%riz,8), %rax
227 // CHECK: fxsave64 (%rax)
228 // CHECK: encoding: [0x48,0x0f,0xae,0x00]
229 fxsaveq (%rax)
231 // CHECK: fxsave64 (%rax)
232 // CHECK: encoding: [0x48,0x0f,0xae,0x00]
233 fxsave64 (%rax)
235 // CHECK: fxrstor64 (%rax)
236 // CHECK: encoding: [0x48,0x0f,0xae,0x08]
237 fxrstorq (%rax)
239 // CHECK: fxrstor64 (%rax)
240 // CHECK: encoding: [0x48,0x0f,0xae,0x08]
241 fxrstor64 (%rax)
243 // CHECK: leave
244 // CHECK: encoding: [0xc9]
245 leave
247 // CHECK: leave
248 // CHECK: encoding: [0xc9]
249 leaveq
251 // CHECK: flds (%edi)
252 // CHECK: encoding: [0x67,0xd9,0x07]
253 flds (%edi)
255 // CHECK: filds (%edi)
256 // CHECK: encoding: [0x67,0xdf,0x07]
257 filds (%edi)
259 // CHECK: flds (%rdi)
260 // CHECK: encoding: [0xd9,0x07]
261 flds (%rdi)
263 // CHECK: filds (%rdi)
264 // CHECK: encoding: [0xdf,0x07]
265 filds (%rdi)
267 // CHECK: pmovmskb %xmm5, %ecx
268 // CHECK: encoding: [0x66,0x0f,0xd7,0xcd]
269 pmovmskb %xmm5,%rcx
271 // CHECK: pinsrw $3, %ecx, %xmm5
272 // CHECK: encoding: [0x66,0x0f,0xc4,0xe9,0x03]
273 pinsrw $3, %ecx, %xmm5
275 // CHECK: pinsrw $3, %ecx, %xmm5
276 // CHECK: encoding: [0x66,0x0f,0xc4,0xe9,0x03]
277 pinsrw $3, %rcx, %xmm5
279 //CHECK: movq 12(%rdi), %rsi
280 //CHECK: encoding: [0x48,0x8b,0x77,0x0c]
281 movq 16+0-4(%rdi),%rsi
283 //CHECK: movq 12(%rdi), %rsi
284 //CHECK: encoding: [0x48,0x8b,0x77,0x0c]
285 movq (16+(0-4))(%rdi),%rsi
287 //CHECK: movq 12(%rdi), %rsi
288 //CHECK: encoding: [0x48,0x8b,0x77,0x0c]
289 movq (16+0)-1+1-2+2-3+3-4+4-5+5-6+6-(4)(%rdi),%rsi
291 //CHECK: movq (,%eiz), %rax
292 //CHECK: encoding: [0x67,0x48,0x8b,0x04,0x25,0x00,0x00,0x00,0x00]
293 movq (,%eiz), %rax