1 // RUN
: not llvm-mc
-triple x86_64-unknown-unknown
--show-encoding
%s
2> %t.err | FileCheck
--check-prefix
=64 %s
2 // RUN
: FileCheck
--check-prefix
=ERR64
< %t.err
%s
3 // RUN
: not llvm-mc
-triple i386-unknown-unknown
--show-encoding
%s
2> %t.err | FileCheck
--check-prefix
=32 %s
4 // RUN
: FileCheck
--check-prefix
=ERR32
< %t.err
%s
5 // RUN
: not llvm-mc
-triple i386-unknown-unknown-code16
--show-encoding
%s
2> %t.err | FileCheck
--check-prefix
=16 %s
6 // RUN
: FileCheck
--check-prefix
=ERR16
< %t.err
%s
9 // 64: lodsb
(%rsi
), %al
# encoding: [0xac]
10 // 32: lodsb
(%esi
), %al
# encoding: [0xac]
11 // 16: lodsb
(%si
), %al
# encoding: [0xac]
14 // 64: lodsb
(%rsi
), %al
# encoding: [0xac]
19 // 64: lodsb
(%esi
), %al
# encoding: [0x67,0xac]
20 // 32: lodsb
(%esi
), %al
# encoding: [0xac]
21 // 16: lodsb
(%esi
), %al
# encoding: [0x67,0xac]
24 // ERR64
: invalid
16-bit base register
25 // 32: lodsb
(%si
), %al
# encoding: [0x67,0xac]
26 // 16: lodsb
(%si
), %al
# encoding: [0xac]
29 // 64: lodsl
%gs
:(%esi
), %eax
# encoding: [0x65,0x67,0xad]
30 // 32: lodsl
%gs
:(%esi
), %eax
# encoding: [0x65,0xad]
31 // 16: lodsl
%gs
:(%esi
), %eax
# encoding: [0x66,0x65,0x67,0xad]
34 // ERR64
: invalid operand
35 // ERR32
: invalid operand
36 // ERR16
: invalid operand
39 // ERR64
: invalid operand
40 // ERR32
: invalid operand
41 // ERR16
: invalid operand
44 // 64: lodsw
(%esi
), %ax
# encoding: [0x66,0x67,0xad]
45 // 32: lodsw
(%esi
), %ax
# encoding: [0x66,0xad]
46 // 16: lodsw
(%esi
), %ax
# encoding: [0x67,0xad]
49 // 64: stosw
%ax
, %es
:(%rdi
) # encoding: [0x66,0xab]
50 // 32: stosw
%ax
, %es
:(%edi
) # encoding: [0x66,0xab]
51 // 16: stosw
%ax
, %es
:(%di
) # encoding: [0xab]
54 // 64: stosl
%eax
, %es
:(%edi
) # encoding: [0x67,0xab]
55 // 32: stosl
%eax
, %es
:(%edi
) # encoding: [0xab]
56 // 16: stosl
%eax
, %es
:(%edi
) # encoding: [0x66,0x67,0xab]
59 // ERR64
: invalid operand for instruction
60 // ERR32
: invalid operand for instruction
61 // ERR16
: invalid operand for instruction
64 // 64: stosb
%al
, %es
:(%edi
) # encoding: [0x67,0xaa]
65 // 32: stosb
%al
, %es
:(%edi
) # encoding: [0xaa]
66 // 16: stosb
%al
, %es
:(%edi
) # encoding: [0x67,0xaa]
69 // 64: stosq
%rax
, %es
:(%rdi
) # encoding: [0x48,0xab]
74 // 64: stosq
%rax
, %es
:(%edi
) # encoding: [0x48,0x67,0xab]
75 // ERR32
: only available in
64-bit mode
76 // ERR16
: only available in
64-bit mode
79 // 64: scasb
%es
:(%edi
), %al
# encoding: [0x67,0xae]
80 // 32: scasb
%es
:(%edi
), %al
# encoding: [0xae]
81 // 16: scasb
%es
:(%edi
), %al
# encoding: [0x67,0xae]
84 // 64: scasq
%es
:(%edi
), %rax
# encoding: [0x48,0x67,0xaf]
89 // ERR64
: invalid operand
90 // ERR32
: invalid operand
91 // ERR16
: invalid operand
94 // ERR64
: invalid
16-bit base register
95 // 16: scasw
%es
:(%di
), %ax
# encoding: [0xaf]
96 // 32: scasw
%es
:(%di
), %ax
# encoding: [0x66,0x67,0xaf]
99 // 64: cmpsb
%es
:(%rdi
), (%rsi
) # encoding: [0xa6]
100 // 32: cmpsb
%es
:(%edi
), (%esi
) # encoding: [0xa6]
101 // 16: cmpsb
%es
:(%di
), (%si
) # encoding: [0xa6]
104 // 64: cmpsw
%es
:(%edi
), (%esi
) # encoding: [0x66,0x67,0xa7]
105 // 32: cmpsw
%es
:(%edi
), (%esi
) # encoding: [0x66,0xa7]
106 // 16: cmpsw
%es
:(%edi
), (%esi
) # encoding: [0x67,0xa7]
109 // ERR64
: invalid
16-bit base register
110 // ERR32
: mismatching source
and destination
111 // ERR16
: mismatching source
and destination
113 cmpsl
%es
:(%edi
), %ss
:(%esi
)
114 // 64: cmpsl
%es
:(%edi
), %ss
:(%esi
) # encoding: [0x36,0x67,0xa7]
115 // 32: cmpsl
%es
:(%edi
), %ss
:(%esi
) # encoding: [0x36,0xa7]
116 // 16: cmpsl
%es
:(%edi
), %ss
:(%esi
) # encoding: [0x66,0x36,0x67,0xa7]
119 // 64: cmpsq
%es
:(%rdi
), (%rsi
) # encoding: [0x48,0xa7]
124 // 64: movsb
(%esi
), %es
:(%edi
) # encoding: [0x67,0xa4]
125 // 32: movsb
(%esi
), %es
:(%edi
) # encoding: [0xa4]
126 // 16: movsb
(%esi
), %es
:(%edi
) # encoding: [0x67,0xa4]
128 movsl
%gs
:(%esi
), (%edi
)
129 // 64: movsl
%gs
:(%esi
), %es
:(%edi
) # encoding: [0x65,0x67,0xa5]
130 // 32: movsl
%gs
:(%esi
), %es
:(%edi
) # encoding: [0x65,0xa5]
131 // 16: movsl
%gs
:(%esi
), %es
:(%edi
) # encoding: [0x66,0x65,0x67,0xa5]
134 // 64: outsb
(%rsi
), %dx
# encoding: [0x6e]
135 // 32: outsb
(%esi
), %dx
# encoding: [0x6e]
136 // 16: outsb
(%si
), %dx
# encoding: [0x6e]
138 outsw
%fs:(%esi
), %dx
139 // 64: outsw
%fs:(%esi
), %dx
# encoding: [0x66,0x64,0x67,0x6f]
140 // 32: outsw
%fs:(%esi
), %dx
# encoding: [0x66,0x64,0x6f]
141 // 16: outsw
%fs:(%esi
), %dx
# encoding: [0x64,0x67,0x6f]
144 // 64: insw
%dx
, %es
:(%edi
) # encoding: [0x66,0x67,0x6d]
145 // 32: insw
%dx
, %es
:(%edi
) # encoding: [0x66,0x6d]
146 // 16: insw
%dx
, %es
:(%edi
) # encoding: [0x67,0x6d]
149 // ERR64
: invalid
16-bit base register
150 // 32: insw
%dx
, %es
:(%di
) # encoding: [0x66,0x67,0x6d]
151 // 16: insw
%dx
, %es
:(%di
) # encoding: [0x6d]
154 // 64: insw
%dx
, %es
:(%edi
) # encoding: [0x66,0x67,0x6d]
155 // 32: insw
%dx
, %es
:(%edi
) # encoding: [0x66,0x6d]
156 // 16: insw
%dx
, %es
:(%edi
) # encoding: [0x67,0x6d]
159 // 64: insw
%dx
, %es
:(%rdi
) # encoding: [0x66,0x6d]