Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / MC / X86 / x86_64-encoding.s
blobff541c2d6568dc2d36980be33d5a02e2621fb02b
1 // RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s
3 // rdar://8127102
4 // CHECK: movq %gs:(%rdi), %rax
5 // CHECK: encoding: [0x65,0x48,0x8b,0x07]
6 movq %gs:(%rdi), %rax
8 // CHECK: crc32b %bl, %eax
9 // CHECK: encoding: [0xf2,0x0f,0x38,0xf0,0xc3]
10 crc32b %bl, %eax
12 // CHECK: crc32b 4(%rbx), %eax
13 // CHECK: encoding: [0xf2,0x0f,0x38,0xf0,0x43,0x04]
14 crc32b 4(%rbx), %eax
16 // CHECK: crc32w %bx, %eax
17 // CHECK: encoding: [0x66,0xf2,0x0f,0x38,0xf1,0xc3]
18 crc32w %bx, %eax
20 // CHECK: crc32w 4(%rbx), %eax
21 // CHECK: encoding: [0x66,0xf2,0x0f,0x38,0xf1,0x43,0x04]
22 crc32w 4(%rbx), %eax
24 // CHECK: crc32l %ebx, %eax
25 // CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0xc3]
26 crc32l %ebx, %eax
28 // CHECK: crc32l 4(%rbx), %eax
29 // CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x43,0x04]
30 crc32l 4(%rbx), %eax
32 // CHECK: crc32l 3735928559(%rbx,%rcx,8), %ecx
33 // CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x8c,0xcb,0xef,0xbe,0xad,0xde]
34 crc32l 0xdeadbeef(%rbx,%rcx,8),%ecx
36 // CHECK: crc32l 69, %ecx
37 // CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x0c,0x25,0x45,0x00,0x00,0x00]
38 crc32l 0x45,%ecx
40 // CHECK: crc32l 32493, %ecx
41 // CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x0c,0x25,0xed,0x7e,0x00,0x00]
42 crc32l 0x7eed,%ecx
44 // CHECK: crc32l 3133065982, %ecx
45 // CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x0c,0x25,0xfe,0xca,0xbe,0xba]
46 crc32l 0xbabecafe,%ecx
48 // CHECK: crc32l %ecx, %ecx
49 // CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0xc9]
50 crc32l %ecx,%ecx
52 // CHECK: crc32b %r11b, %eax
53 // CHECK: encoding: [0xf2,0x41,0x0f,0x38,0xf0,0xc3]
54 crc32b %r11b, %eax
56 // CHECK: crc32b 4(%rbx), %eax
57 // CHECK: encoding: [0xf2,0x0f,0x38,0xf0,0x43,0x04]
58 crc32b 4(%rbx), %eax
60 // CHECK: crc32b %dil, %rax
61 // CHECK: encoding: [0xf2,0x48,0x0f,0x38,0xf0,0xc7]
62 crc32b %dil,%rax
64 // CHECK: crc32b %r11b, %rax
65 // CHECK: encoding: [0xf2,0x49,0x0f,0x38,0xf0,0xc3]
66 crc32b %r11b,%rax
68 // CHECK: crc32b 4(%rbx), %rax
69 // CHECK: encoding: [0xf2,0x48,0x0f,0x38,0xf0,0x43,0x04]
70 crc32b 4(%rbx), %rax
72 // CHECK: crc32q %rbx, %rax
73 // CHECK: encoding: [0xf2,0x48,0x0f,0x38,0xf1,0xc3]
74 crc32q %rbx, %rax
76 // CHECK: crc32q 4(%rbx), %rax
77 // CHECK: encoding: [0xf2,0x48,0x0f,0x38,0xf1,0x43,0x04]
78 crc32q 4(%rbx), %rax
80 // CHECK: movq %r8, %mm1
81 // CHECK: encoding: [0x49,0x0f,0x6e,0xc8]
82 movd %r8, %mm1
84 // CHECK: movd %r8d, %mm1
85 // CHECK: encoding: [0x41,0x0f,0x6e,0xc8]
86 movd %r8d, %mm1
88 // CHECK: movq %rdx, %mm1
89 // CHECK: encoding: [0x48,0x0f,0x6e,0xca]
90 movd %rdx, %mm1
92 // CHECK: movd %edx, %mm1
93 // CHECK: encoding: [0x0f,0x6e,0xca]
94 movd %edx, %mm1
96 // CHECK: movq %mm1, %r8
97 // CHECK: encoding: [0x49,0x0f,0x7e,0xc8]
98 movd %mm1, %r8
100 // CHECK: movd %mm1, %r8d
101 // CHECK: encoding: [0x41,0x0f,0x7e,0xc8]
102 movd %mm1, %r8d
104 // CHECK: movq %mm1, %rdx
105 // CHECK: encoding: [0x48,0x0f,0x7e,0xca]
106 movd %mm1, %rdx
108 // CHECK: movd %mm1, %edx
109 // CHECK: encoding: [0x0f,0x7e,0xca]
110 movd %mm1, %edx
112 // CHECK: movd %mm1, (%rax)
113 // CHECK: encoding: [0x0f,0x7e,0x08]
114 movd %mm1, (%rax)
116 // CHECK: movd (%rax), %mm1
117 // CHECK: encoding: [0x0f,0x6e,0x08]
118 movd (%rax), %mm1
120 // CHECK: movq %r8, %mm1
121 // CHECK: encoding: [0x49,0x0f,0x6e,0xc8]
122 movq %r8, %mm1
124 // CHECK: movq %rdx, %mm1
125 // CHECK: encoding: [0x48,0x0f,0x6e,0xca]
126 movq %rdx, %mm1
128 // CHECK: movq %mm1, %r8
129 // CHECK: encoding: [0x49,0x0f,0x7e,0xc8]
130 movq %mm1, %r8
132 // CHECK: movq %mm1, %rdx
133 // CHECK: encoding: [0x48,0x0f,0x7e,0xca]
134 movq %mm1, %rdx
136 // rdar://7840289
137 // CHECK: pshufb CPI1_0(%rip), %xmm1
138 // CHECK: encoding: [0x66,0x0f,0x38,0x00,0x0d,A,A,A,A]
139 // CHECK: fixup A - offset: 5, value: CPI1_0-4
140 pshufb CPI1_0(%rip), %xmm1
142 // CHECK: sha1rnds4 $1, %xmm1, %xmm2
143 // CHECK: encoding: [0x0f,0x3a,0xcc,0xd1,0x01]
144 sha1rnds4 $1, %xmm1, %xmm2
146 // CHECK: sha1rnds4 $1, (%rax), %xmm2
147 // CHECK: encoding: [0x0f,0x3a,0xcc,0x10,0x01]
148 sha1rnds4 $1, (%rax), %xmm2
150 // CHECK: sha1nexte %xmm1, %xmm2
151 // CHECK: encoding: [0x0f,0x38,0xc8,0xd1]
152 sha1nexte %xmm1, %xmm2
154 // CHECK: sha1msg1 %xmm1, %xmm2
155 // CHECK: encoding: [0x0f,0x38,0xc9,0xd1]
156 sha1msg1 %xmm1, %xmm2
158 // CHECK: sha1msg1 (%rax), %xmm2
159 // CHECK: encoding: [0x0f,0x38,0xc9,0x10]
160 sha1msg1 (%rax), %xmm2
162 // CHECK: sha1msg2 %xmm1, %xmm2
163 // CHECK: encoding: [0x0f,0x38,0xca,0xd1]
164 sha1msg2 %xmm1, %xmm2
166 // CHECK: sha1msg2 (%rax), %xmm2
167 // CHECK: encoding: [0x0f,0x38,0xca,0x10]
168 sha1msg2 (%rax), %xmm2
170 // CHECK: sha256rnds2 %xmm0, (%rax), %xmm2
171 // CHECK: encoding: [0x0f,0x38,0xcb,0x10]
172 sha256rnds2 (%rax), %xmm2
174 // CHECK: sha256rnds2 %xmm0, %xmm1, %xmm2
175 // CHECK: encoding: [0x0f,0x38,0xcb,0xd1]
176 sha256rnds2 %xmm1, %xmm2
178 // CHECK: sha256rnds2 %xmm0, (%rax), %xmm2
179 // CHECK: encoding: [0x0f,0x38,0xcb,0x10]
180 sha256rnds2 %xmm0, (%rax), %xmm2
182 // CHECK: sha256rnds2 %xmm0, %xmm1, %xmm2
183 // CHECK: encoding: [0x0f,0x38,0xcb,0xd1]
184 sha256rnds2 %xmm0, %xmm1, %xmm2
186 // CHECK: sha256msg1 %xmm1, %xmm2
187 // CHECK: encoding: [0x0f,0x38,0xcc,0xd1]
188 sha256msg1 %xmm1, %xmm2
190 // CHECK: sha256msg1 (%rax), %xmm2
191 // CHECK: encoding: [0x0f,0x38,0xcc,0x10]
192 sha256msg1 (%rax), %xmm2
194 // CHECK: sha256msg2 %xmm1, %xmm2
195 // CHECK: encoding: [0x0f,0x38,0xcd,0xd1]
196 sha256msg2 %xmm1, %xmm2
198 // CHECK: sha256msg2 (%rax), %xmm2
199 // CHECK: encoding: [0x0f,0x38,0xcd,0x10]
200 sha256msg2 (%rax), %xmm2
202 // CHECK: movq 57005(,%riz), %rbx
203 // CHECK: encoding: [0x48,0x8b,0x1c,0x25,0xad,0xde,0x00,0x00]
204 movq 57005(,%riz), %rbx
206 // CHECK: movq 48879(,%riz), %rax
207 // CHECK: encoding: [0x48,0x8b,0x04,0x25,0xef,0xbe,0x00,0x00]
208 movq 48879(,%riz), %rax
210 // CHECK: movq -4(,%riz,8), %rax
211 // CHECK: encoding: [0x48,0x8b,0x04,0xe5,0xfc,0xff,0xff,0xff]
212 movq -4(,%riz,8), %rax
214 // CHECK: movq (%rcx,%riz), %rax
215 // CHECK: encoding: [0x48,0x8b,0x04,0x21]
216 movq (%rcx,%riz), %rax
218 // CHECK: movq (%rcx,%riz,8), %rax
219 // CHECK: encoding: [0x48,0x8b,0x04,0xe1]
220 movq (%rcx,%riz,8), %rax
222 // CHECK: fxsave64 (%rax)
223 // CHECK: encoding: [0x48,0x0f,0xae,0x00]
224 fxsaveq (%rax)
226 // CHECK: fxsave64 (%rax)
227 // CHECK: encoding: [0x48,0x0f,0xae,0x00]
228 fxsave64 (%rax)
230 // CHECK: fxrstor64 (%rax)
231 // CHECK: encoding: [0x48,0x0f,0xae,0x08]
232 fxrstorq (%rax)
234 // CHECK: fxrstor64 (%rax)
235 // CHECK: encoding: [0x48,0x0f,0xae,0x08]
236 fxrstor64 (%rax)
238 // CHECK: leave
239 // CHECK: encoding: [0xc9]
240 leave
242 // CHECK: leave
243 // CHECK: encoding: [0xc9]
244 leaveq
246 // CHECK: flds (%edi)
247 // CHECK: encoding: [0x67,0xd9,0x07]
248 flds (%edi)
250 // CHECK: filds (%edi)
251 // CHECK: encoding: [0x67,0xdf,0x07]
252 filds (%edi)
254 // CHECK: flds (%rdi)
255 // CHECK: encoding: [0xd9,0x07]
256 flds (%rdi)
258 // CHECK: filds (%rdi)
259 // CHECK: encoding: [0xdf,0x07]
260 filds (%rdi)
262 // CHECK: pmovmskb %xmm5, %ecx
263 // CHECK: encoding: [0x66,0x0f,0xd7,0xcd]
264 pmovmskb %xmm5,%rcx
266 // CHECK: pinsrw $3, %ecx, %xmm5
267 // CHECK: encoding: [0x66,0x0f,0xc4,0xe9,0x03]
268 pinsrw $3, %ecx, %xmm5
270 // CHECK: pinsrw $3, %ecx, %xmm5
271 // CHECK: encoding: [0x66,0x0f,0xc4,0xe9,0x03]
272 pinsrw $3, %rcx, %xmm5
274 //CHECK: movq 12(%rdi), %rsi
275 //CHECK: encoding: [0x48,0x8b,0x77,0x0c]
276 movq 16+0-4(%rdi),%rsi
278 //CHECK: movq 12(%rdi), %rsi
279 //CHECK: encoding: [0x48,0x8b,0x77,0x0c]
280 movq (16+(0-4))(%rdi),%rsi
282 //CHECK: movq 12(%rdi), %rsi
283 //CHECK: encoding: [0x48,0x8b,0x77,0x0c]
284 movq (16+0)-1+1-2+2-3+3-4+4-5+5-6+6-(4)(%rdi),%rsi
286 //CHECK: movq (,%eiz), %rax
287 //CHECK: encoding: [0x67,0x48,0x8b,0x04,0x25,0x00,0x00,0x00,0x00]
288 movq (,%eiz), %rax