summaryrefslogtreecommitdiff
path: root/test/MC/X86
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2014-01-08 12:57:40 +0000
committerDavid Woodhouse <dwmw2@infradead.org>2014-01-08 12:57:40 +0000
commita493812047cace1d21c7c188ce226558faa62fa8 (patch)
treeb9a602e8bc4eea2df8370e4ebb530326bb50da54 /test/MC/X86
parent5de64fcb5e870fd12938854c058e40273a89dcd0 (diff)
[x86] Add OpSize16 to instructions that need it
This fixes the bulk of 16-bit output, and the corresponding test case x86-16.s now looks mostly like the x86-32.s test case that it was originally based on. A few irrelevant instructions have been dropped, and there are still some corner cases to be fixed in subsequent patches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198752 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/X86')
-rw-r--r--test/MC/X86/x86-16.s277
1 files changed, 277 insertions, 0 deletions
diff --git a/test/MC/X86/x86-16.s b/test/MC/X86/x86-16.s
index 115132dcee6..d160d46920a 100644
--- a/test/MC/X86/x86-16.s
+++ b/test/MC/X86/x86-16.s
@@ -2,6 +2,9 @@
.code16
+ movl $0x12345678, %ebx
+// CHECK: movl
+// CHECK: encoding: [0x66,0xbb,0x78,0x56,0x34,0x12]
pause
// CHECK: pause
// CHECK: encoding: [0xf3,0x90]
@@ -24,12 +27,28 @@
// CHECK: encoding: [0x0f,0x01,0xf9]
+// CHECK: movl %eax, 16(%ebp) # encoding: [0x67,0x66,0x89,0x45,0x10]
+ movl %eax, 16(%ebp)
+// CHECK: movl %eax, -16(%ebp) # encoding: [0x67,0x66,0x89,0x45,0xf0]
+ movl %eax, -16(%ebp)
+
// CHECK: testb %bl, %cl # encoding: [0x84,0xcb]
testb %bl, %cl
+// CHECK: cmpl %eax, %ebx # encoding: [0x66,0x39,0xc3]
+ cmpl %eax, %ebx
+
// CHECK: addw %ax, %ax # encoding: [0x01,0xc0]
addw %ax, %ax
+// CHECK: shrl %eax # encoding: [0x66,0xd1,0xe8]
+ shrl $1, %eax
+
+// CHECK: shll %eax # encoding: [0x66,0xd1,0xe0]
+ sall $1, %eax
+// CHECK: shll %eax # encoding: [0x66,0xd1,0xe0]
+ sal $1, %eax
+
into
// CHECK: into
// CHECK: encoding: [0xce]
@@ -43,10 +62,143 @@ int $255
// CHECK: int $255
// CHECK: encoding: [0xcd,0xff]
+// CHECK: pushfl # encoding: [0x66,0x9c]
+ pushfl
+// CHECK: popfl # encoding: [0x66,0x9d]
+ popfl
+
+// CHECK: cmoval %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x47,0xd0]
+ cmoval %eax,%edx
+
+// CHECK: cmovael %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x43,0xd0]
+ cmovael %eax,%edx
+
+// CHECK: cmovbel %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x46,0xd0]
+ cmovbel %eax,%edx
+
+// CHECK: cmovbl %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x42,0xd0]
+ cmovbl %eax,%edx
+
// CHECK: cmovbw %bx, %bx
cmovnae %bx,%bx
+// CHECK: cmovbel %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x46,0xd0]
+ cmovbel %eax,%edx
+
+// CHECK: cmovbl %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x42,0xd0]
+ cmovcl %eax,%edx
+
+// CHECK: cmovel %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x44,0xd0]
+ cmovel %eax,%edx
+
+// CHECK: cmovgl %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x4f,0xd0]
+ cmovgl %eax,%edx
+
+// CHECK: cmovgel %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x4d,0xd0]
+ cmovgel %eax,%edx
+
+// CHECK: cmovll %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x4c,0xd0]
+ cmovll %eax,%edx
+
+// CHECK: cmovlel %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x4e,0xd0]
+ cmovlel %eax,%edx
+
+// CHECK: cmovbel %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x46,0xd0]
+ cmovnal %eax,%edx
+
+// CHECK: cmovnel %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x45,0xd0]
+ cmovnel %eax,%edx
+
+// CHECK: cmovael %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x43,0xd0]
+ cmovnbl %eax,%edx
+
+// CHECK: cmoval %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x47,0xd0]
+ cmovnbel %eax,%edx
+
+// CHECK: cmovael %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x43,0xd0]
+ cmovncl %eax,%edx
+
+// CHECK: cmovnel %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x45,0xd0]
+ cmovnel %eax,%edx
+
+// CHECK: cmovlel %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x4e,0xd0]
+ cmovngl %eax,%edx
+
+// CHECK: cmovgel %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x4d,0xd0]
+ cmovnl %eax,%edx
+
+// CHECK: cmovnel %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x45,0xd0]
+ cmovnel %eax,%edx
+
+// CHECK: cmovlel %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x4e,0xd0]
+ cmovngl %eax,%edx
+
+// CHECK: cmovll %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x4c,0xd0]
+ cmovngel %eax,%edx
+
+// CHECK: cmovgel %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x4d,0xd0]
+ cmovnll %eax,%edx
+
+// CHECK: cmovgl %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x4f,0xd0]
+ cmovnlel %eax,%edx
+
+// CHECK: cmovnol %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x41,0xd0]
+ cmovnol %eax,%edx
+
+// CHECK: cmovnpl %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x4b,0xd0]
+ cmovnpl %eax,%edx
+
+// CHECK: cmovnsl %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x49,0xd0]
+ cmovnsl %eax,%edx
+
+// CHECK: cmovnel %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x45,0xd0]
+ cmovnzl %eax,%edx
+
+// CHECK: cmovol %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x40,0xd0]
+ cmovol %eax,%edx
+
+// CHECK: cmovpl %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x4a,0xd0]
+ cmovpl %eax,%edx
+
+// CHECK: cmovsl %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x48,0xd0]
+ cmovsl %eax,%edx
+
+// CHECK: cmovel %eax, %edx
+// CHECK: encoding: [0x66,0x0f,0x44,0xd0]
+ cmovzl %eax,%edx
+
// CHECK: fmul %st(0)
// CHECK: encoding: [0xd8,0xc8]
fmul %st(0), %st
@@ -71,14 +223,30 @@ cmovnae %bx,%bx
// CHECK: encoding: [0xd8,0xf0]
fdiv %st(0), %st
+// CHECK: movl %cs, %eax
+// CHECK: encoding: [0x66,0x8c,0xc8]
+ movl %cs, %eax
+
// CHECK: movw %cs, %ax
// CHECK: encoding: [0x8c,0xc8]
movw %cs, %ax
+// CHECK: movl %cs, (%eax)
+// CHECK: encoding: [0x67,0x66,0x8c,0x08]
+ movl %cs, (%eax)
+
// CHECK: movw %cs, (%eax)
// CHECK: encoding: [0x67,0x8c,0x08]
movw %cs, (%eax)
+// CHECK: movl %eax, %cs
+// CHECK: encoding: [0x66,0x8e,0xc8]
+ movl %eax, %cs
+
+// CHECK: movl (%eax), %cs
+// CHECK: encoding: [0x67,0x66,0x8e,0x08]
+ movl (%eax), %cs
+
// CHECK: movw (%eax), %cs
// CHECK: encoding: [0x67,0x8e,0x08]
movw (%eax), %cs
@@ -143,6 +311,23 @@ cmovnae %bx,%bx
// CHECK: encoding: [0x9b]
fwait
+// CHECK: pushal
+// CHECK: encoding: [0x66,0x60]
+ pushal
+
+// CHECK: popal
+// CHECK: encoding: [0x66,0x61]
+ popal
+
+// CHECK: jmpl *8(%eax)
+// CHECK: encoding: [0x67,0x66,0xff,0x60,0x08]
+ jmpl *8(%eax)
+
+// CHECK: lcalll $2, $4660
+// CHECK: encoding: [0x66,0x9a,0x34,0x12,0x00,0x00,0x02,0x00]
+lcalll $0x2, $0x1234
+
+
sysret
// CHECK: sysretl
// CHECK: encoding: [0x0f,0x07]
@@ -175,6 +360,35 @@ pushw %gs
// CHECK: pushw %gs
// CHECK: encoding: [0x0f,0xa8]
+pushl %cs
+// CHECK: pushl %cs
+// CHECK: encoding: [0x66,0x0e]
+pushl %ds
+// CHECK: pushl %ds
+// CHECK: encoding: [0x66,0x1e]
+pushl %ss
+// CHECK: pushl %ss
+// CHECK: encoding: [0x66,0x16]
+pushl %es
+// CHECK: pushl %es
+// CHECK: encoding: [0x66,0x06]
+pushl %fs
+// CHECK: pushl %fs
+// CHECK: encoding: [0x66,0x0f,0xa0]
+pushl %gs
+// CHECK: pushl %gs
+// CHECK: encoding: [0x66,0x0f,0xa8]
+
+popl %ss
+// CHECK: popl %ss
+// CHECK: encoding: [0x66,0x17]
+popl %ds
+// CHECK: popl %ds
+// CHECK: encoding: [0x66,0x1f]
+popl %es
+// CHECK: popl %es
+// CHECK: encoding: [0x66,0x07]
+
pushfd
// CHECK: pushfl
popfd
@@ -222,12 +436,18 @@ ljmpl $0x7ace,$0x7ace
// CHECK: incw %ax # encoding: [0x40]
incw %ax
+// CHECK: incl %eax # encoding: [0x66,0x40]
+ incl %eax
+
// CHECK: decb %al # encoding: [0xfe,0xc8]
decb %al
// CHECK: decw %ax # encoding: [0x48]
decw %ax
+// CHECK: decl %eax # encoding: [0x66,0x48]
+ decl %eax
+
// CHECK: pshufw $14, %mm4, %mm0 # encoding: [0x0f,0x70,0xc4,0x0e]
pshufw $14, %mm4, %mm0
@@ -278,6 +498,10 @@ pshufw $90, %mm4, %mm0
// CHECK: encoding: [0x67,0x62,0x58,0x02]
bound 2(%eax),%bx
+// CHECK: bound 4(%ebx), %ecx
+// CHECK: encoding: [0x67,0x66,0x62,0x4b,0x04]
+ bound 4(%ebx),%ecx
+
// CHECK: arpl %bx, %bx
// CHECK: encoding: [0x63,0xdb]
arpl %bx,%bx
@@ -352,6 +576,12 @@ pshufw $90, %mm4, %mm0
outsw %ds:(%si), %dx
outsw (%si), %dx
+// CHECK: outsl # encoding: [0x66,0x6f]
+// CHECK: outsl
+ outsl
+ outsl %ds:(%si), %dx
+ outsl (%si), %dx
+
// CHECK: insb # encoding: [0x6c]
// CHECK: insb
insb
@@ -362,6 +592,11 @@ pshufw $90, %mm4, %mm0
insw
insw %dx, %es:(%di)
+// CHECK: insl # encoding: [0x66,0x6d]
+// CHECK: insl
+ insl
+ insl %dx, %es:(%di)
+
// CHECK: movsb # encoding: [0xa4]
// CHECK: movsb
// CHECK: movsb
@@ -376,6 +611,13 @@ pshufw $90, %mm4, %mm0
movsw %ds:(%si), %es:(%di)
movsw (%si), %es:(%di)
+// CHECK: movsl # encoding: [0x66,0xa5]
+// CHECK: movsl
+// CHECK: movsl
+ movsl
+ movsl %ds:(%si), %es:(%di)
+ movsl (%si), %es:(%di)
+
// CHECK: lodsb # encoding: [0xac]
// CHECK: lodsb
// CHECK: lodsb
@@ -398,6 +640,17 @@ pshufw $90, %mm4, %mm0
lods %ds:(%si), %ax
lods (%si), %ax
+// CHECK: lodsl # encoding: [0x66,0xad]
+// CHECK: lodsl
+// CHECK: lodsl
+// CHECK: lodsl
+// CHECK: lodsl
+ lodsl
+ lodsl %ds:(%si), %eax
+ lodsl (%si), %eax
+ lods %ds:(%si), %eax
+ lods (%si), %eax
+
// CHECK: stosb # encoding: [0xaa]
// CHECK: stosb
// CHECK: stosb
@@ -412,10 +665,22 @@ pshufw $90, %mm4, %mm0
stosw %ax, %es:(%di)
stos %ax, %es:(%di)
+// CHECK: stosl # encoding: [0x66,0xab]
+// CHECK: stosl
+// CHECK: stosl
+ stosl
+ stosl %eax, %es:(%di)
+ stos %eax, %es:(%di)
+
// CHECK: strw
// CHECK: encoding: [0x0f,0x00,0xc8]
str %ax
+// CHECK: strl
+// CHECK: encoding: [0x66,0x0f,0x00,0xc8]
+ str %eax
+
+
// CHECK: fsubp
// CHECK: encoding: [0xde,0xe1]
fsubp %st,%st(1)
@@ -424,6 +689,18 @@ fsubp %st,%st(1)
// CHECK: encoding: [0xde,0xe2]
fsubp %st, %st(2)
+// CHECK: xchgl %eax, %eax
+// CHECK: encoding: [0x66,0x90]
+xchgl %eax, %eax
+
// CHECK: xchgw %ax, %ax
// CHECK: encoding: [0x90]
xchgw %ax, %ax
+
+// CHECK: xchgl %ecx, %eax
+// CHECK: encoding: [0x66,0x91]
+xchgl %ecx, %eax
+
+// CHECK: xchgl %ecx, %eax
+// CHECK: encoding: [0x66,0x91]
+xchgl %eax, %ecx