2 # Due to bug, REP(NE) is not allowed for 16-bit versions of string instructions
3 # (because there would be two non-rex prefixes: rep and data16).
4 # See http://code.google.com/p/nativeclient/issues/detail?id=1950
8 # lea (%r15,%rdi,1), %rdi
10 # rep scasw %es:(%rdi), %ax
13 VALIDATOR: 0000000000000006: 66 f3 af scasw [%rdi]
14 VALIDATOR: ERROR: More than one (non-REX) prefix byte specified
15 VALIDATOR: Checking jump targets: 0 to 9
16 VALIDATOR: Checking that basic blocks are aligned
17 *** <input> IS UNSAFE ***
19 0000000000000000: 89 ff mov %edi, %edi
20 0000000000000002: 49 8d 3c 3f lea %rdi, [%r15+%rdi*1]
21 0000000000000006: 66 f3 af scasw [%rdi]
23 6: [0] unrecognized instruction
25 ----------------------------------------------------------------------
29 # lea (%r15,%rdi,1), %rdi
31 # repne scasw %es:(%rdi), %ax
34 VALIDATOR: 0000000000000006: 66 f2 af scasw [%rdi]
35 VALIDATOR: ERROR: More than one (non-REX) prefix byte specified
36 VALIDATOR: Checking jump targets: 0 to 9
37 VALIDATOR: Checking that basic blocks are aligned
38 *** <input> IS UNSAFE ***
40 0000000000000000: 89 ff mov %edi, %edi
41 0000000000000002: 49 8d 3c 3f lea %rdi, [%r15+%rdi*1]
42 0000000000000006: 66 f2 af scasw [%rdi]
44 6: [0] unrecognized instruction
46 ----------------------------------------------------------------------
50 # lea (%r15,%rdi,1), %rdi
52 # rep stosw %ax, %es:(%rdi)
55 VALIDATOR: 0000000000000006: 66 f3 ab stosw [%rdi]
56 VALIDATOR: ERROR: More than one (non-REX) prefix byte specified
57 VALIDATOR: Checking jump targets: 0 to 9
58 VALIDATOR: Checking that basic blocks are aligned
59 *** <input> IS UNSAFE ***
61 0000000000000000: 89 ff mov %edi, %edi
62 0000000000000002: 49 8d 3c 3f lea %rdi, [%r15+%rdi*1]
63 0000000000000006: 66 f3 ab stosw [%rdi]
65 6: [0] unrecognized instruction
67 ----------------------------------------------------------------------
71 # lea (%r15,%rsi,1), %rsi
73 # rep lodsw %ds:(%rsi), %ax
76 VALIDATOR: 0000000000000006: 66 f3 ad lodsw [%rsi]
77 VALIDATOR: ERROR: More than one (non-REX) prefix byte specified
78 VALIDATOR: Checking jump targets: 0 to 9
79 VALIDATOR: Checking that basic blocks are aligned
80 *** <input> IS UNSAFE ***
82 0000000000000000: 89 f6 mov %esi, %esi
83 0000000000000002: 49 8d 34 37 lea %rsi, [%r15+%rsi*1]
84 0000000000000006: 66 f3 ad lodsw [%rsi]
86 6: [0] unrecognized instruction
88 ----------------------------------------------------------------------
92 # lea (%r15,%rsi,1), %rsi
96 # lea (%r15,%rdi,1), %rdi
98 # rep movsw %ds:(%rsi), %es:(%rdi)
101 VALIDATOR: 000000000000000c: 66 f3 a5 movsw [%rdi], [%rsi]
102 VALIDATOR: ERROR: More than one (non-REX) prefix byte specified
103 VALIDATOR: Checking jump targets: 0 to f
104 VALIDATOR: Checking that basic blocks are aligned
105 *** <input> IS UNSAFE ***
107 0000000000000000: 89 f6 mov %esi, %esi
108 0000000000000002: 49 8d 34 37 lea %rsi, [%r15+%rsi*1]
109 0000000000000006: 89 ff mov %edi, %edi
110 0000000000000008: 49 8d 3c 3f lea %rdi, [%r15+%rdi*1]
111 000000000000000c: 66 f3 a5 movsw [%rdi], [%rsi]
113 c: [0] unrecognized instruction
115 ----------------------------------------------------------------------
119 # lea (%r15,%rsi,1), %rsi
123 # lea (%r15,%rdi,1), %rdi
125 # rep cmpsw %es:(%rdi), %ds:(%rsi)
128 VALIDATOR: 000000000000000c: 66 f3 a7 cmpsw [%rdi], [%rsi]
129 VALIDATOR: ERROR: More than one (non-REX) prefix byte specified
130 VALIDATOR: Checking jump targets: 0 to f
131 VALIDATOR: Checking that basic blocks are aligned
132 *** <input> IS UNSAFE ***
134 0000000000000000: 89 f6 mov %esi, %esi
135 0000000000000002: 49 8d 34 37 lea %rsi, [%r15+%rsi*1]
136 0000000000000006: 89 ff mov %edi, %edi
137 0000000000000008: 49 8d 3c 3f lea %rdi, [%r15+%rdi*1]
138 000000000000000c: 66 f3 a7 cmpsw [%rdi], [%rsi]
140 c: [0] unrecognized instruction
142 ----------------------------------------------------------------------
146 # lea (%r15,%rsi,1), %rsi
150 # lea (%r15,%rdi,1), %rdi
152 # repne cmpsw %es:(%rdi), %ds:(%rsi)
155 VALIDATOR: 000000000000000c: 66 f2 a7 cmpsw [%rdi], [%rsi]
156 VALIDATOR: ERROR: More than one (non-REX) prefix byte specified
157 VALIDATOR: Checking jump targets: 0 to f
158 VALIDATOR: Checking that basic blocks are aligned
159 *** <input> IS UNSAFE ***
161 0000000000000000: 89 f6 mov %esi, %esi
162 0000000000000002: 49 8d 34 37 lea %rsi, [%r15+%rsi*1]
163 0000000000000006: 89 ff mov %edi, %edi
164 0000000000000008: 49 8d 3c 3f lea %rdi, [%r15+%rdi*1]
165 000000000000000c: 66 f2 a7 cmpsw [%rdi], [%rsi]
167 c: [0] unrecognized instruction
169 ----------------------------------------------------------------------
171 # Examples of valid string instructions.
173 # DATA16, but no REP/REPNE prefix:
176 # lea (%r15,%rdi,1), %rdi
178 # scasw %es:(%rdi), %ax
181 # REP, but no DATA16 prefix:
184 # lea (%r15,%rdi,1),%rdi
186 # rep stosb %al, %es:(%rdi)
189 VALIDATOR: Checking jump targets: 0 to 10
190 VALIDATOR: Checking that basic blocks are aligned
191 *** <input> is safe ***
193 0000000000000000: 89 ff mov %edi, %edi
194 0000000000000002: 49 8d 3c 3f lea %rdi, [%r15+%rdi*1]
195 0000000000000006: 66 af scasw [%rdi]
196 0000000000000008: 89 ff mov %edi, %edi
197 000000000000000a: 49 8d 3c 3f lea %rdi, [%r15+%rdi*1]
198 000000000000000e: f3 aa stosb [%rdi]