1 // RUN: llvm-mc -triple i386-unknown-unknown-code16 --show-encoding %s | FileCheck %s
5 // CHECK: encoding: [0x66,0xbb,0x78,0x56,0x34,0x12]
8 // CHECK: encoding: [0xf3,0x90]
11 // CHECK: encoding: [0x0f,0xae,0xf8]
14 // CHECK: encoding: [0x0f,0xae,0xe8]
18 // CHECK: encoding: [0x0f,0x01,0xdc]
21 // CHECK: encoding: [0x0f,0x01,0xdd]
25 // CHECK: encoding: [0x0f,0x01,0xf9]
28 // CHECK: movl %eax, 16(%ebp) # encoding: [0x67,0x66,0x89,0x45,0x10]
30 // CHECK: movl %eax, -16(%ebp) # encoding: [0x67,0x66,0x89,0x45,0xf0]
33 // CHECK: testb %bl, %cl # encoding: [0x84,0xd9]
36 // CHECK: cmpl %eax, %ebx # encoding: [0x66,0x39,0xc3]
39 // CHECK: addw %ax, %ax # encoding: [0x01,0xc0]
42 // CHECK: shrl %eax # encoding: [0x66,0xd1,0xe8]
45 // CHECK: shll %eax # encoding: [0x66,0xd1,0xe0]
47 // CHECK: shll %eax # encoding: [0x66,0xd1,0xe0]
50 // moffset forms of moves
52 // CHECK: movb 0, %al # encoding: [0xa0,0x00,0x00]
55 // CHECK: movw 0, %ax # encoding: [0xa1,0x00,0x00]
58 // CHECK: movl 0, %eax # encoding: [0x66,0xa1,0x00,0x00]
63 // CHECK: encoding: [0xce]
66 // CHECK: encoding: [0xcc]
69 // CHECK: encoding: [0xcd,0x04]
72 // CHECK: encoding: [0xcd,0xff]
74 // CHECK: pushfw # encoding: [0x9c]
76 // CHECK: pushfl # encoding: [0x66,0x9c]
78 // CHECK: popfw # encoding: [0x9d]
80 // CHECK: popfl # encoding: [0x66,0x9d]
85 // CHECK: encoding: [0x66,0xc3]
87 // CHECK: cmoval %eax, %edx
88 // CHECK: encoding: [0x66,0x0f,0x47,0xd0]
91 // CHECK: cmovael %eax, %edx
92 // CHECK: encoding: [0x66,0x0f,0x43,0xd0]
95 // CHECK: cmovbel %eax, %edx
96 // CHECK: encoding: [0x66,0x0f,0x46,0xd0]
99 // CHECK: cmovbl %eax, %edx
100 // CHECK: encoding: [0x66,0x0f,0x42,0xd0]
103 // CHECK: cmovbw %bx, %bx
107 // CHECK: cmovbel %eax, %edx
108 // CHECK: encoding: [0x66,0x0f,0x46,0xd0]
111 // CHECK: cmovbl %eax, %edx
112 // CHECK: encoding: [0x66,0x0f,0x42,0xd0]
115 // CHECK: cmovel %eax, %edx
116 // CHECK: encoding: [0x66,0x0f,0x44,0xd0]
119 // CHECK: cmovgl %eax, %edx
120 // CHECK: encoding: [0x66,0x0f,0x4f,0xd0]
123 // CHECK: cmovgel %eax, %edx
124 // CHECK: encoding: [0x66,0x0f,0x4d,0xd0]
127 // CHECK: cmovll %eax, %edx
128 // CHECK: encoding: [0x66,0x0f,0x4c,0xd0]
131 // CHECK: cmovlel %eax, %edx
132 // CHECK: encoding: [0x66,0x0f,0x4e,0xd0]
135 // CHECK: cmovbel %eax, %edx
136 // CHECK: encoding: [0x66,0x0f,0x46,0xd0]
139 // CHECK: cmovnel %eax, %edx
140 // CHECK: encoding: [0x66,0x0f,0x45,0xd0]
143 // CHECK: cmovael %eax, %edx
144 // CHECK: encoding: [0x66,0x0f,0x43,0xd0]
147 // CHECK: cmoval %eax, %edx
148 // CHECK: encoding: [0x66,0x0f,0x47,0xd0]
151 // CHECK: cmovael %eax, %edx
152 // CHECK: encoding: [0x66,0x0f,0x43,0xd0]
155 // CHECK: cmovnel %eax, %edx
156 // CHECK: encoding: [0x66,0x0f,0x45,0xd0]
159 // CHECK: cmovlel %eax, %edx
160 // CHECK: encoding: [0x66,0x0f,0x4e,0xd0]
163 // CHECK: cmovgel %eax, %edx
164 // CHECK: encoding: [0x66,0x0f,0x4d,0xd0]
167 // CHECK: cmovnel %eax, %edx
168 // CHECK: encoding: [0x66,0x0f,0x45,0xd0]
171 // CHECK: cmovlel %eax, %edx
172 // CHECK: encoding: [0x66,0x0f,0x4e,0xd0]
175 // CHECK: cmovll %eax, %edx
176 // CHECK: encoding: [0x66,0x0f,0x4c,0xd0]
179 // CHECK: cmovgel %eax, %edx
180 // CHECK: encoding: [0x66,0x0f,0x4d,0xd0]
183 // CHECK: cmovgl %eax, %edx
184 // CHECK: encoding: [0x66,0x0f,0x4f,0xd0]
187 // CHECK: cmovnol %eax, %edx
188 // CHECK: encoding: [0x66,0x0f,0x41,0xd0]
191 // CHECK: cmovnpl %eax, %edx
192 // CHECK: encoding: [0x66,0x0f,0x4b,0xd0]
195 // CHECK: cmovnsl %eax, %edx
196 // CHECK: encoding: [0x66,0x0f,0x49,0xd0]
199 // CHECK: cmovnel %eax, %edx
200 // CHECK: encoding: [0x66,0x0f,0x45,0xd0]
203 // CHECK: cmovol %eax, %edx
204 // CHECK: encoding: [0x66,0x0f,0x40,0xd0]
207 // CHECK: cmovpl %eax, %edx
208 // CHECK: encoding: [0x66,0x0f,0x4a,0xd0]
211 // CHECK: cmovsl %eax, %edx
212 // CHECK: encoding: [0x66,0x0f,0x48,0xd0]
215 // CHECK: cmovel %eax, %edx
216 // CHECK: encoding: [0x66,0x0f,0x44,0xd0]
219 // CHECK: fmul %st(0)
220 // CHECK: encoding: [0xd8,0xc8]
223 // CHECK: fadd %st(0)
224 // CHECK: encoding: [0xd8,0xc0]
227 // CHECK: fsub %st(0)
228 // CHECK: encoding: [0xd8,0xe0]
231 // CHECK: fsubr %st(0)
232 // CHECK: encoding: [0xd8,0xe8]
235 // CHECK: fdivr %st(0)
236 // CHECK: encoding: [0xd8,0xf8]
239 // CHECK: fdiv %st(0)
240 // CHECK: encoding: [0xd8,0xf0]
243 // CHECK: movl %cs, %eax
244 // CHECK: encoding: [0x66,0x8c,0xc8]
247 // CHECK: movw %cs, %ax
248 // CHECK: encoding: [0x8c,0xc8]
251 // CHECK: movl %cs, (%eax)
252 // CHECK: encoding: [0x67,0x66,0x8c,0x08]
255 // CHECK: movw %cs, (%eax)
256 // CHECK: encoding: [0x67,0x8c,0x08]
259 // CHECK: movl %eax, %cs
260 // CHECK: encoding: [0x66,0x8e,0xc8]
263 // CHECK: movl (%eax), %cs
264 // CHECK: encoding: [0x67,0x66,0x8e,0x08]
267 // CHECK: movw (%eax), %cs
268 // CHECK: encoding: [0x67,0x8e,0x08]
271 // CHECK: movl %cr0, %eax
272 // CHECK: encoding: [0x0f,0x20,0xc0]
275 // CHECK: movl %cr1, %eax
276 // CHECK: encoding: [0x0f,0x20,0xc8]
279 // CHECK: movl %cr2, %eax
280 // CHECK: encoding: [0x0f,0x20,0xd0]
283 // CHECK: movl %cr3, %eax
284 // CHECK: encoding: [0x0f,0x20,0xd8]
287 // CHECK: movl %cr4, %eax
288 // CHECK: encoding: [0x0f,0x20,0xe0]
291 // CHECK: movl %dr0, %eax
292 // CHECK: encoding: [0x0f,0x21,0xc0]
295 // CHECK: movl %dr1, %eax
296 // CHECK: encoding: [0x0f,0x21,0xc8]
299 // CHECK: movl %dr1, %eax
300 // CHECK: encoding: [0x0f,0x21,0xc8]
303 // CHECK: movl %dr2, %eax
304 // CHECK: encoding: [0x0f,0x21,0xd0]
307 // CHECK: movl %dr3, %eax
308 // CHECK: encoding: [0x0f,0x21,0xd8]
311 // CHECK: movl %dr4, %eax
312 // CHECK: encoding: [0x0f,0x21,0xe0]
315 // CHECK: movl %dr5, %eax
316 // CHECK: encoding: [0x0f,0x21,0xe8]
319 // CHECK: movl %dr6, %eax
320 // CHECK: encoding: [0x0f,0x21,0xf0]
323 // CHECK: movl %dr7, %eax
324 // CHECK: encoding: [0x0f,0x21,0xf8]
328 // CHECK: encoding: [0x9b]
331 // CHECK: [0x66,0x65,0xa1,0x7c,0x00]
335 // CHECK: encoding: [0x60]
339 // CHECK: encoding: [0x61]
343 // CHECK: encoding: [0x60]
347 // CHECK: encoding: [0x61]
351 // CHECK: encoding: [0x66,0x60]
355 // CHECK: encoding: [0x66,0x61]
358 // CHECK: jmpw *8(%eax)
359 // CHECK: encoding: [0x67,0xff,0x60,0x08]
362 // CHECK: jmpl *8(%eax)
363 // CHECK: encoding: [0x67,0x66,0xff,0x60,0x08]
366 // CHECK: lcalll $2, $4660
367 // CHECK: encoding: [0x66,0x9a,0x34,0x12,0x00,0x00,0x02,0x00]
374 // CHECK: encoding: [0xe3,A]
377 // CHECK: encoding: [0x67,0xe3,A]
381 // CHECK: encoding: [0xcf]
384 // CHECK: encoding: [0xcf]
387 // CHECK: encoding: [0x66,0xcf]
391 // CHECK: encoding: [0x0f,0x07]
394 // CHECK: encoding: [0x0f,0x07]
396 testl %ecx, -24(%ebp)
397 // CHECK: testl -24(%ebp), %ecx
398 testl -24(%ebp), %ecx
399 // CHECK: testl -24(%ebp), %ecx
404 // CHECK: encoding: [0x0e]
407 // CHECK: encoding: [0x1e]
410 // CHECK: encoding: [0x16]
413 // CHECK: encoding: [0x06]
416 // CHECK: encoding: [0x0f,0xa0]
419 // CHECK: encoding: [0x0f,0xa8]
423 // CHECK: encoding: [0x0e]
426 // CHECK: encoding: [0x1e]
429 // CHECK: encoding: [0x16]
432 // CHECK: encoding: [0x06]
435 // CHECK: encoding: [0x0f,0xa0]
438 // CHECK: encoding: [0x0f,0xa8]
442 // CHECK: encoding: [0x66,0x0e]
445 // CHECK: encoding: [0x66,0x1e]
448 // CHECK: encoding: [0x66,0x16]
451 // CHECK: encoding: [0x66,0x06]
454 // CHECK: encoding: [0x66,0x0f,0xa0]
457 // CHECK: encoding: [0x66,0x0f,0xa8]
461 // CHECK: encoding: [0x17]
464 // CHECK: encoding: [0x1f]
467 // CHECK: encoding: [0x07]
471 // CHECK: encoding: [0x66,0x17]
474 // CHECK: encoding: [0x66,0x1f]
477 // CHECK: encoding: [0x66,0x07]
502 setneb %cl // CHECK: setne %cl
503 setcb %bl // CHECK: setb %bl
504 setnaeb %bl // CHECK: setb %bl
507 // CHECK: lcalll $31438, $31438
508 // CHECK: lcalll $31438, $31438
509 // CHECK: ljmpl $31438, $31438
510 // CHECK: ljmpl $31438, $31438
512 calll $0x7ace,$0x7ace
513 lcalll $0x7ace,$0x7ace
515 ljmpl $0x7ace,$0x7ace
517 // CHECK: lcallw $31438, $31438
518 // CHECK: lcallw $31438, $31438
519 // CHECK: ljmpw $31438, $31438
520 // CHECK: ljmpw $31438, $31438
522 callw $0x7ace,$0x7ace
523 lcallw $0x7ace,$0x7ace
525 ljmpw $0x7ace,$0x7ace
527 // CHECK: lcallw $31438, $31438
528 // CHECK: lcallw $31438, $31438
529 // CHECK: ljmpw $31438, $31438
530 // CHECK: ljmpw $31438, $31438
533 lcall $0x7ace,$0x7ace
540 // CHECK: incb %al # encoding: [0xfe,0xc0]
543 // CHECK: incw %ax # encoding: [0x40]
546 // CHECK: incl %eax # encoding: [0x66,0x40]
549 // CHECK: decb %al # encoding: [0xfe,0xc8]
552 // CHECK: decw %ax # encoding: [0x48]
555 // CHECK: decl %eax # encoding: [0x66,0x48]
558 // CHECK: pshufw $14, %mm4, %mm0 # encoding: [0x0f,0x70,0xc4,0x0e]
559 pshufw $14, %mm4, %mm0
561 // CHECK: pshufw $90, %mm4, %mm0 # encoding: [0x0f,0x70,0xc4,0x5a]
562 pshufw $90, %mm4, %mm0
565 // CHECK: encoding: [0x37]
569 // CHECK: encoding: [0xd5,0x01]
573 // CHECK: encoding: [0xd5,0x0a]
577 // CHECK: encoding: [0xd5,0x0a]
581 // CHECK: encoding: [0xd4,0x02]
585 // CHECK: encoding: [0xd4,0x0a]
589 // CHECK: encoding: [0xd4,0x0a]
593 // CHECK: encoding: [0x3f]
597 // CHECK: encoding: [0x27]
601 // CHECK: encoding: [0x2f]
604 // CHECK: retw $31438
605 // CHECK: encoding: [0xc2,0xce,0x7a]
608 // CHECK: lretw $31438
609 // CHECK: encoding: [0xca,0xce,0x7a]
612 // CHECK: retw $31438
613 // CHECK: encoding: [0xc2,0xce,0x7a]
616 // CHECK: lretw $31438
617 // CHECK: encoding: [0xca,0xce,0x7a]
620 // CHECK: retl $31438
621 // CHECK: encoding: [0x66,0xc2,0xce,0x7a]
624 // CHECK: lretl $31438
625 // CHECK: encoding: [0x66,0xca,0xce,0x7a]
628 // CHECK: bound 2(%eax), %bx
629 // CHECK: encoding: [0x67,0x62,0x58,0x02]
632 // CHECK: bound 4(%ebx), %ecx
633 // CHECK: encoding: [0x67,0x66,0x62,0x4b,0x04]
636 // CHECK: arpl %bx, %bx
637 // CHECK: encoding: [0x63,0xdb]
640 // CHECK: arpl %bx, 6(%ecx)
641 // CHECK: encoding: [0x67,0x63,0x59,0x06]
644 // CHECK: lgdtw 4(%eax)
645 // CHECK: encoding: [0x67,0x0f,0x01,0x50,0x04]
648 // CHECK: lgdtw 4(%eax)
649 // CHECK: encoding: [0x67,0x0f,0x01,0x50,0x04]
652 // CHECK: lgdtl 4(%eax)
653 // CHECK: encoding: [0x67,0x66,0x0f,0x01,0x50,0x04]
656 // CHECK: lidtw 4(%eax)
657 // CHECK: encoding: [0x67,0x0f,0x01,0x58,0x04]
660 // CHECK: lidtw 4(%eax)
661 // CHECK: encoding: [0x67,0x0f,0x01,0x58,0x04]
664 // CHECK: lidtl 4(%eax)
665 // CHECK: encoding: [0x67,0x66,0x0f,0x01,0x58,0x04]
668 // CHECK: sgdtw 4(%eax)
669 // CHECK: encoding: [0x67,0x0f,0x01,0x40,0x04]
672 // CHECK: sgdtw 4(%eax)
673 // CHECK: encoding: [0x67,0x0f,0x01,0x40,0x04]
676 // CHECK: sgdtl 4(%eax)
677 // CHECK: encoding: [0x67,0x66,0x0f,0x01,0x40,0x04]
680 // CHECK: sidtw 4(%eax)
681 // CHECK: encoding: [0x67,0x0f,0x01,0x48,0x04]
684 // CHECK: sidtw 4(%eax)
685 // CHECK: encoding: [0x67,0x0f,0x01,0x48,0x04]
688 // CHECK: sidtl 4(%eax)
689 // CHECK: encoding: [0x67,0x66,0x0f,0x01,0x48,0x04]
692 // CHECK: fcompi %st(2)
693 // CHECK: encoding: [0xdf,0xf2]
696 // CHECK: fcompi %st(2)
697 // CHECK: encoding: [0xdf,0xf2]
701 // CHECK: encoding: [0xdf,0xf1]
704 // CHECK: fucompi %st(2)
705 // CHECK: encoding: [0xdf,0xea]
708 // CHECK: fucompi %st(2)
709 // CHECK: encoding: [0xdf,0xea]
713 // CHECK: encoding: [0xdf,0xe9]
716 // CHECK: fldcw 32493
717 // CHECK: encoding: [0xd9,0x2e,0xed,0x7e]
720 // CHECK: fldcw 32493
721 // CHECK: encoding: [0xd9,0x2e,0xed,0x7e]
724 // CHECK: fnstcw 32493
725 // CHECK: encoding: [0xd9,0x3e,0xed,0x7e]
728 // CHECK: fnstcw 32493
729 // CHECK: encoding: [0xd9,0x3e,0xed,0x7e]
733 // CHECK: encoding: [0x9b]
737 // CHECK: encoding: [0x9b]
740 // CHECK: fnstsw 32493
741 // CHECK: encoding: [0xdd,0x3e,0xed,0x7e]
744 // CHECK: fnstsw 32493
745 // CHECK: encoding: [0xdd,0x3e,0xed,0x7e]
749 // CHECK: encoding: [0x9b]
753 // CHECK: encoding: [0x9b]
757 // CHECK: encoding: [0x0f,0x00,0x26,0xed,0x7e]
761 // CHECK: encoding: [0x0f,0x00,0x26,0xed,0x7e]
765 // CHECK: encoding: [0x9b]
769 // CHECK: encoding: [0xdb,0xe2]
773 // CHECK: encoding: [0x0f,0x0b]
777 // CHECK: encoding: [0x0f,0x0b]
781 // CHECK: encoding: [0x0f,0xb9]
785 // CHECK: encoding: [0xe1,A]
789 // CHECK: encoding: [0xe0,A]
792 // CHECK: outsb (%si), %dx # encoding: [0x6e]
799 // CHECK: outsw (%si), %dx # encoding: [0x6f]
806 // CHECK: outsl (%si), %dx # encoding: [0x66,0x6f]
812 // CHECK: insb %dx, %es:(%di) # encoding: [0x6c]
817 // CHECK: insw %dx, %es:(%di) # encoding: [0x6d]
822 // CHECK: insl %dx, %es:(%di) # encoding: [0x66,0x6d]
827 // CHECK: movsb (%si), %es:(%di) # encoding: [0xa4]
831 movsb %ds:(%si), %es:(%di)
832 movsb (%si), %es:(%di)
834 // CHECK: movsw (%si), %es:(%di) # encoding: [0xa5]
838 movsw %ds:(%si), %es:(%di)
839 movsw (%si), %es:(%di)
841 // CHECK: movsl (%si), %es:(%di) # encoding: [0x66,0xa5]
845 movsl %ds:(%si), %es:(%di)
846 movsl (%si), %es:(%di)
848 // CHECK: lodsb (%si), %al # encoding: [0xac]
859 // CHECK: lodsw (%si), %ax # encoding: [0xad]
870 // CHECK: lodsl (%si), %eax # encoding: [0x66,0xad]
876 lodsl %ds:(%si), %eax
881 // CHECK: stosb %al, %es:(%di) # encoding: [0xaa]
888 // CHECK: stosw %ax, %es:(%di) # encoding: [0xab]
895 // CHECK: stosl %eax, %es:(%di) # encoding: [0x66,0xab]
899 stosl %eax, %es:(%di)
903 // CHECK: encoding: [0x0f,0x00,0xc8]
907 // CHECK: encoding: [0x66,0x0f,0x00,0xc8]
912 // CHECK: encoding: [0xde,0xe1]
915 // CHECK: fsubp %st(2)
916 // CHECK: encoding: [0xde,0xe2]
919 // CHECK: xchgl %eax, %eax
920 // CHECK: encoding: [0x66,0x90]
923 // CHECK: xchgw %ax, %ax
924 // CHECK: encoding: [0x90]
927 // CHECK: xchgl %ecx, %eax
928 // CHECK: encoding: [0x66,0x91]
931 // CHECK: xchgl %ecx, %eax
932 // CHECK: encoding: [0x66,0x91]
936 // CHECK: encoding: [0xc3]
940 // CHECK: encoding: [0x66,0xc3]
944 // CHECK: encoding: [0xcb]
948 // CHECK: encoding: [0x66,0xcb]