Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'Release-1.2' of ssh://palacios@newskysaw.cs.northwestern.edu//home...
[palacios.git] / palacios / include / palacios / vmm_instr_emulator.h
1 /*
2  * This file is part of the Palacios Virtual Machine Monitor developed
3  * by the V3VEE Project with funding from the United States National 
4  * Science Foundation and the Department of Energy.  
5  *
6  * The V3VEE Project is a joint project between Northwestern University
7  * and the University of New Mexico.  You can find out more at 
8  * http://www.v3vee.org
9  *
10  * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> 
11  * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org> 
12  * All rights reserved.
13  *
14  * Author: Jack Lange <jarusl@cs.northwestern.edu>
15  *
16  * This is free software.  You are permitted to use,
17  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
18  */
19
20 #include <palacios/vmm_types.h>
21
22
23
24 #define MAKE_1OP_8FLAGS_INST(iname) static inline void iname##8(addr_t * dst,  addr_t * flags) { \
25         /* Some of the flags values are not copied out in a pushf, we save them here */ \
26         addr_t flags_rsvd = *flags & ~0xfffe7fff;                       \
27                                                                         \
28         asm volatile (                                                  \
29                       "pushf; "                                         \
30                       "push %2; "                                       \
31                       "popf; "                                          \
32                       #iname"b %0; "                                    \
33                       "pushf; "                                         \
34                       "pop %1; "                                        \
35                       "popf; "                                          \
36                       : "=q"(*(uint8_t *)dst),"=q"(*flags)              \
37                       : "q"(*flags), "0"(*(uint8_t *)dst)               \
38                       );                                                \
39         *flags |= flags_rsvd;                                           \
40                                                                         \
41     }
42
43 #define MAKE_1OP_16FLAGS_INST(iname) static inline void iname##16(addr_t * dst,  addr_t * flags) { \
44         /* Some of the flags values are not copied out in a pushf, we save them here */ \
45         addr_t flags_rsvd = *flags & ~0xfffe7fff;                       \
46                                                                         \
47         asm volatile (                                                  \
48                       "pushf; "                                         \
49                       "push %2; "                                       \
50                       "popf; "                                          \
51                       #iname"w %0; "                                    \
52                       "pushf; "                                         \
53                       "pop %1; "                                        \
54                       "popf; "                                          \
55                       : "=q"(*(uint16_t *)dst),"=q"(*flags)             \
56                       : "q"(*flags), "0"(*(uint16_t *)dst)              \
57                       );                                                \
58         *flags |= flags_rsvd;                                           \
59                                                                         \
60     }
61
62 #define MAKE_1OP_32FLAGS_INST(iname) static inline void iname##32(addr_t * dst,  addr_t * flags) { \
63         /* Some of the flags values are not copied out in a pushf, we save them here */ \
64         addr_t flags_rsvd = *flags & ~0xfffe7fff;                       \
65                                                                         \
66         asm volatile (                                                  \
67                       "pushf; "                                         \
68                       "push %2; "                                       \
69                       "popf; "                                          \
70                       #iname"l %0; "                                    \
71                       "pushf; "                                         \
72                       "pop %1; "                                        \
73                       "popf; "                                          \
74                       : "=q"(*(uint32_t *)dst),"=q"(*flags)             \
75                       : "q"(*flags), "0"(*(uint32_t *)dst)              \
76                       );                                                \
77         *flags |= flags_rsvd;                                           \
78                                                                         \
79     }
80
81 #define MAKE_1OP_64FLAGS_INST(iname) static inline void iname##64(addr_t * dst,  addr_t * flags) { \
82         /* Some of the flags values are not copied out in a pushf, we save them here */ \
83         addr_t flags_rsvd = *flags & ~0xfffe7fff;                       \
84                                                                         \
85         asm volatile (                                                  \
86                       "pushfq; "                                        \
87                       "push %2; "                                       \
88                       "popfq; "                                         \
89                       #iname"q %0; "                                    \
90                       "pushfq; "                                        \
91                       "pop %1; "                                        \
92                       "popfq; "                                         \
93                       : "=q"(*(uint64_t *)dst),"=q"(*flags)             \
94                       : "q"(*flags), "0"(*(uint64_t *)dst)              \
95                       );                                                \
96         *flags |= flags_rsvd;                                           \
97                                                                         \
98     }
99
100
101
102 #define MAKE_1OP_8_INST(iname) static inline void iname##8(addr_t * dst) { \
103         asm volatile (                                                  \
104                       #iname"b %0; "                                    \
105                       : "=q"(*(uint8_t *)dst)                           \
106                       : "0"(*(uint8_t *)dst)                            \
107                       );                                                \
108     }
109
110 #define MAKE_1OP_16_INST(iname) static inline void iname##16(addr_t * dst) { \
111         asm volatile (                                                  \
112                       #iname"w %0; "                                    \
113                       : "=q"(*(uint16_t *)dst)                          \
114                       :  "0"(*(uint16_t *)dst)                          \
115                       );                                                \
116     }
117
118 #define MAKE_1OP_32_INST(iname) static inline void iname##32(addr_t * dst) { \
119         asm volatile (                                                  \
120                       #iname"l %0; "                                    \
121                       : "=q"(*(uint32_t *)dst)                          \
122                       : "0"(*(uint32_t *)dst)                           \
123                       );                                                \
124     }
125
126 #define MAKE_1OP_64_INST(iname) static inline void iname##64(addr_t * dst) { \
127         asm volatile (                                                  \
128                       #iname"q %0; "                                    \
129                       : "=q"(*(uint64_t *)dst)                          \
130                       : "0"(*(uint64_t *)dst)                           \
131                       );                                                \
132     }
133
134
135 #define MAKE_2OP_64FLAGS_INST(iname) static inline void iname##64(addr_t * dst, addr_t * src, addr_t * flags) { \
136         /* Some of the flags values are not copied out in a pushf, we save them here */ \
137         addr_t flags_rsvd = *flags & ~0xfffe7fff;                       \
138                                                                         \
139         asm volatile (                                                  \
140                       "pushfq\r\n"                                      \
141                       "push %3\r\n"                                     \
142                       "popfq\r\n"                                       \
143                       #iname"q %2, %0\r\n"                              \
144                       "pushfq\r\n"                                      \
145                       "pop %1\r\n"                                      \
146                       "popfq\r\n"                                       \
147                       : "=q"(*(uint64_t *)dst),"=q"(*flags)             \
148                       : "q"(*(uint64_t *)src),"q"(*flags), "0"(*(uint64_t *)dst) \
149                       );                                                \
150         *flags |= flags_rsvd;                                           \
151                                                                         \
152     }
153
154
155
156
157 #define MAKE_2OP_32FLAGS_INST(iname) static inline void iname##32(addr_t * dst, addr_t * src, addr_t * flags) { \
158         /* Some of the flags values are not copied out in a pushf, we save them here */ \
159         addr_t flags_rsvd = *flags & ~0xfffe7fff;                       \
160                                                                         \
161         asm volatile (                                                  \
162                       "pushf; "                                         \
163                       "push %3; "                                       \
164                       "popf; "                                          \
165                       #iname"l %2, %0; "                                \
166                       "pushf; "                                         \
167                       "pop %1; "                                        \
168                       "popf; "                                          \
169                       : "=q"(*(uint32_t *)dst),"=q"(*flags)             \
170                       : "q"(*(uint32_t *)src),"q"(*flags), "0"(*(uint32_t *)dst) \
171                       );                                                \
172         *flags |= flags_rsvd;                                           \
173     }
174
175
176 #define MAKE_2OP_16FLAGS_INST(iname) static inline void iname##16(addr_t * dst, addr_t * src, addr_t * flags) { \
177         /* Some of the flags values are not copied out in a pushf, we save them here */ \
178         addr_t flags_rsvd = *flags & ~0xfffe7fff;                       \
179                                                                         \
180         asm volatile (                                                  \
181                       "pushf; "                                         \
182                       "push %3; "                                       \
183                       "popf; "                                          \
184                       #iname"w %2, %0; "                                \
185                       "pushf; "                                         \
186                       "pop %1; "                                        \
187                       "popf; "                                          \
188                       : "=q"(*(uint16_t *)dst),"=q"(*flags)             \
189                       : "q"(*(uint16_t *)src),"q"(*flags), "0"(*(uint16_t *)dst) \
190                       );                                                \
191         *flags |= flags_rsvd;                                           \
192     }
193
194 #define MAKE_2OP_8FLAGS_INST(iname) static inline void iname##8(addr_t * dst, addr_t * src, addr_t * flags) { \
195         /* Some of the flags values are not copied out in a pushf, we save them here */ \
196         addr_t flags_rsvd = *flags & ~0xfffe7fff;                       \
197                                                                         \
198         asm volatile (                                                  \
199                       "pushf; "                                         \
200                       "push %3; "                                       \
201                       "popf; "                                          \
202                       #iname"b %2, %0; "                                \
203                       "pushf; "                                         \
204                       "pop %1; "                                        \
205                       "popf; "                                          \
206                       : "=q"(*(uint8_t *)dst),"=q"(*flags)              \
207                       : "q"(*(uint8_t *)src),"q"(*flags), "0"(*(uint8_t *)dst) \
208                       );                                                \
209         *flags |= flags_rsvd;                                           \
210     }
211
212
213
214
215
216 #define MAKE_2OP_64STR_INST(iname) static inline void iname##64(addr_t * dst, \
217                                                                 addr_t * src, \
218                                                                 addr_t * ecx, addr_t * flags) { \
219         /* Some of the flags values are not copied out in a pushf, we save them here */ \
220         addr_t flags_rsvd = *flags & ~0xfffe7fff;                       \
221                                                                         \
222         asm volatile (                                                  \
223                       "pushfq; "                                        \
224                       "pushq %4; "                                      \
225                       "popfq; "                                         \
226                       "rep; "                                           \
227                       #iname"q; "                                       \
228                       "pushfq; "                                        \
229                       "popq %0; "                                       \
230                       "popfq; "                                         \
231                       : "=q"(*flags)                                    \
232                       : "D"(*dst),"S"(*src),"c"(*ecx),"q"(*flags)       \
233                       );                                                \
234         *flags |= flags_rsvd;                                           \
235     }
236
237
238 #define MAKE_2OP_32STR_INST(iname) static inline void iname##32(addr_t * dst, \
239                                                                 addr_t * src, \
240                                                                 addr_t * ecx, addr_t * flags) { \
241         /* Some of the flags values are not copied out in a pushf, we save them here */ \
242         addr_t flags_rsvd = *flags & ~0xfffe7fff;                       \
243                                                                         \
244         asm volatile (                                                  \
245                       "pushf; "                                         \
246                       "push %4; "                                       \
247                       "popf; "                                          \
248                       "rep; "                                           \
249                       #iname"l; "                                       \
250                       "pushf; "                                         \
251                       "pop %0; "                                        \
252                       "popf; "                                          \
253                       : "=q"(*flags)                                    \
254                       : "D"(*dst),"S"(*src),"c"(*ecx),"q"(*flags)       \
255                       );                                                \
256         *flags |= flags_rsvd;                                           \
257     }
258
259 #define MAKE_2OP_16STR_INST(iname) static inline void iname##16(addr_t * dst, \
260                                                                 addr_t * src, \
261                                                                 addr_t * ecx, addr_t * flags) { \
262         /* Some of the flags values are not copied out in a pushf, we save them here */ \
263         addr_t flags_rsvd = *flags & ~0xfffe7fff;                       \
264                                                                         \
265         asm volatile (                                                  \
266                       "pushf; "                                         \
267                       "push %4; "                                       \
268                       "popf; "                                          \
269                       "rep; "                                           \
270                       #iname"w; "                                       \
271                       "pushf; "                                         \
272                       "pop %0; "                                        \
273                       "popf; "                                          \
274                       : "=q"(*flags)                                    \
275                       : "D"(*dst),"S"(*src),"c"(*ecx),"q"(*flags)       \
276                       );                                                \
277         *flags |= flags_rsvd;                                           \
278     }
279
280
281
282 #define MAKE_2OP_8STR_INST(iname) static inline void iname##8(addr_t * dst, \
283                                                               addr_t * src, \
284                                                               addr_t * ecx, addr_t * flags) { \
285         /* Some of the flags values are not copied out in a pushf, we save them here */ \
286         addr_t flags_rsvd = *flags & ~0xfffe7fff;                       \
287                                                                         \
288         asm volatile (                                                  \
289                       "pushf; "                                         \
290                       "push %4; "                                       \
291                       "popf; "                                          \
292                       "rep; "                                           \
293                       #iname"b; "                                       \
294                       "pushf; "                                         \
295                       "pop %0; "                                        \
296                       "popf; "                                          \
297                       : "=q"(*flags)                                    \
298                       : "D"(*dst),"S"(*src),"c"(*ecx),"q"(*flags)       \
299                       );                                                \
300         *flags |= flags_rsvd;                                           \
301     }
302
303
304
305
306 #define MAKE_1OP_64STR_INST(iname) static inline void iname##64(addr_t * dst, \
307                                                                 addr_t * src, \
308                                                                 addr_t * ecx, addr_t * flags) { \
309         /* Some of the flags values are not copied out in a pushf, we save them here */ \
310         addr_t flags_rsvd = *flags & ~0xfffe7fff;                       \
311                                                                         \
312         asm volatile (                                                  \
313                       "pushfq; "                                        \
314                       "pushq %4; "                                      \
315                       "popfq; "                                         \
316                       "rep; "                                           \
317                       #iname"q; "                                       \
318                       "pushfq; "                                        \
319                       "popq %0; "                                       \
320                       "popfq; "                                         \
321                       : "=q"(*flags)                                    \
322                       : "D"(*dst),"a"(*src),"c"(*ecx),"q"(*flags)       \
323                       );                                                \
324                                                                         \
325         *flags |= flags_rsvd;                                           \
326     }
327
328
329 #define MAKE_1OP_32STR_INST(iname) static inline void iname##32(addr_t * dst, \
330                                                                 addr_t * src, \
331                                                                 addr_t * ecx, addr_t * flags) { \
332         /* Some of the flags values are not copied out in a pushf, we save them here */ \
333         addr_t flags_rsvd = *flags & ~0xfffe7fff;                       \
334                                                                         \
335         asm volatile (                                                  \
336                       "pushf; "                                         \
337                       "push %4; "                                       \
338                       "popf; "                                          \
339                       "rep; "                                           \
340                       #iname"l; "                                       \
341                       "pushf; "                                         \
342                       "pop %0; "                                        \
343                       "popf; "                                          \
344                       : "=q"(*flags)                                    \
345                       : "D"(*dst),"a"(*src),"c"(*ecx),"q"(*flags)       \
346                       );                                                \
347         *flags |= flags_rsvd;                                           \
348     }
349
350 #define MAKE_1OP_16STR_INST(iname) static inline void iname##16(addr_t * dst, \
351                                                                 addr_t * src, \
352                                                                 addr_t * ecx, addr_t * flags) { \
353         /* Some of the flags values are not copied out in a pushf, we save them here */ \
354         addr_t flags_rsvd = *flags & ~0xfffe7fff;                       \
355                                                                         \
356         asm volatile (                                                  \
357                       "pushf; "                                         \
358                       "push %4; "                                       \
359                       "popf; "                                          \
360                       "rep; "                                           \
361                       #iname"w; "                                       \
362                       "pushf; "                                         \
363                       "pop %0; "                                        \
364                       "popf; "                                          \
365                       : "=q"(*flags)                                    \
366                       : "D"(*dst),"a"(*src),"c"(*ecx),"q"(*flags)       \
367                       );                                                \
368         *flags |= flags_rsvd;                                           \
369     }
370
371
372
373 #define MAKE_1OP_8STR_INST(iname) static inline void iname##8(addr_t * dst, \
374                                                               addr_t * src, \
375                                                               addr_t * ecx, addr_t * flags) { \
376         /* Some of the flags values are not copied out in a pushf, we save them here */ \
377         addr_t flags_rsvd = *flags & ~0xfffe7fff;                       \
378                                                                         \
379         asm volatile (                                                  \
380                       "pushf; "                                         \
381                       "push %4; "                                       \
382                       "popf; "                                          \
383                       "rep; "                                           \
384                       #iname"b; "                                       \
385                       "pushf; "                                         \
386                       "pop %0; "                                        \
387                       "popf; "                                          \
388                       : "=q"(*flags)                                    \
389                       : "D"(*dst),"a"(*src),"c"(*ecx),"q"(*flags)       \
390                       );                                                \
391         *flags |= flags_rsvd;                                           \
392     }
393
394
395
396
397 #define MAKE_2OP_64_INST(iname) static inline void iname##64(addr_t * dst, addr_t * src) { \
398         asm volatile (                                                  \
399                       #iname"q %1, %0; "                                \
400                       : "=q"(*(uint64_t *)dst)                          \
401                       : "q"(*(uint64_t *)src), "0"(*(uint64_t *)dst)    \
402                       );                                                \
403     }
404
405 #define MAKE_2OP_32_INST(iname) static inline void iname##32(addr_t * dst, addr_t * src) { \
406         asm volatile (                                                  \
407                       #iname"l %1, %0; "                                \
408                       : "=q"(*(uint32_t *)dst)                          \
409                       : "q"(*(uint32_t *)src), "0"(*(uint32_t *)dst)    \
410                       );                                                \
411     }
412
413 #define MAKE_2OP_16_INST(iname) static inline void iname##16(addr_t * dst, addr_t * src) { \
414         asm volatile (                                                  \
415                       #iname"w %1, %0; "                                \
416                       : "=q"(*(uint16_t *)dst)                          \
417                       : "q"(*(uint16_t *)src), "0"(*(uint16_t *)dst)    \
418                       );                                                \
419     }
420
421 #define MAKE_2OP_8_INST(iname) static inline void iname##8(addr_t * dst, addr_t * src) { \
422         asm volatile (                                                  \
423                       #iname"b %1, %0; "                                \
424                       : "=q"(*(uint8_t *)dst)                           \
425                       : "q"(*(uint8_t *)src), "0"(*(uint8_t *)dst)      \
426                       );                                                \
427     }
428
429
430
431
432
433 #define MAKE_2OP_8EXT_INST(iname) static inline void iname##8(addr_t * dst, addr_t * src, uint_t dst_len) { \
434         if (dst_len == 2) {                                             \
435             asm volatile (                                              \
436                           #iname" %1, %0; "                             \
437                           : "=q"(*(uint16_t *)dst)                      \
438                           : "q"(*(uint8_t *)src), "0"(*(uint16_t *)dst) \
439                           );                                            \
440         } else if (dst_len == 4) {                                      \
441             asm volatile (                                              \
442                           #iname" %1, %0; "                             \
443                           : "=q"(*(uint32_t *)dst)                      \
444                           : "q"(*(uint8_t *)src), "0"(*(uint32_t *)dst) \
445                           );                                            \
446         } else if (dst_len == 8) {                                      \
447             asm volatile (                                              \
448                           #iname" %1, %0; "                             \
449                           : "=q"(*(uint64_t *)dst)                      \
450                           : "q"(*(uint8_t *)src), "0"(*(uint64_t *)dst) \
451                           );                                            \
452         }                                                               \
453     }
454
455 #define MAKE_2OP_16EXT_INST(iname) static inline void iname##16(addr_t * dst, addr_t * src, uint_t dst_len) { \
456         if (dst_len == 4) {                                             \
457             asm volatile (                                              \
458                           #iname" %1, %0; "                             \
459                           : "=q"(*(uint32_t *)dst)                      \
460                           : "q"(*(uint16_t *)src), "0"(*(uint32_t *)dst) \
461                           );                                            \
462         } else if (dst_len == 8) {                                      \
463             asm volatile (                                              \
464                           #iname" %1, %0; "                             \
465                           : "=q"(*(uint64_t *)dst)                      \
466                           : "q"(*(uint16_t *)src), "0"(*(uint64_t *)dst) \
467                           );                                            \
468         }                                                               \
469     }
470
471
472
473
474 #define MAKE_2OUT_64_INST(iname) static inline void iname##64(addr_t * dst, addr_t * src) { \
475         asm volatile (                                                  \
476                       #iname"q %1, %0; "                                \
477                       : "=q"(*(uint64_t *)dst), "=q"(*(uint64_t *)src)  \
478                       : "0"(*(uint64_t *)dst), "1"(*(uint64_t *)src)    \
479                       );                                                \
480     }
481
482 #define MAKE_2OUT_32_INST(iname) static inline void iname##32(addr_t * dst, addr_t * src) { \
483         asm volatile (                                                  \
484                       #iname"l %1, %0; "                                \
485                       : "=q"(*(uint32_t *)dst), "=q"(*(uint32_t *)src)  \
486                       :  "0"(*(uint32_t *)dst), "1"(*(uint32_t *)src)   \
487                       );                                                \
488     }
489
490 #define MAKE_2OUT_16_INST(iname) static inline void iname##16(addr_t * dst, addr_t * src) { \
491         asm volatile (                                                  \
492                       #iname"w %1, %0; "                                \
493                       : "=q"(*(uint16_t *)dst), "=q"(*(uint16_t *)src)  \
494                       : "0"(*(uint16_t *)dst), "1"(*(uint16_t *)src)    \
495                       );                                                \
496     }
497
498 #define MAKE_2OUT_8_INST(iname) static inline void iname##8(addr_t * dst, addr_t * src) { \
499         asm volatile (                                                  \
500                       #iname"b %1, %0; "                                \
501                       : "=q"(*(uint8_t *)dst), "=q"(*(uint8_t *)src)    \
502                       : "0"(*(uint8_t *)dst), "1"(*(uint8_t *)src)      \
503                       );                                                \
504     }
505
506
507
508
509
510
511 /****************************/
512 /* 8 Bit instruction forms  */
513 /****************************/
514
515 MAKE_2OP_8FLAGS_INST(adc);
516 MAKE_2OP_8FLAGS_INST(add);
517 MAKE_2OP_8FLAGS_INST(and);
518 MAKE_2OP_8FLAGS_INST(or);
519 MAKE_2OP_8FLAGS_INST(xor);
520 MAKE_2OP_8FLAGS_INST(sub);
521
522
523 MAKE_1OP_8FLAGS_INST(inc);
524 MAKE_1OP_8FLAGS_INST(dec);
525 MAKE_1OP_8FLAGS_INST(neg);
526 MAKE_1OP_8FLAGS_INST(setb);
527 MAKE_1OP_8FLAGS_INST(setbe);
528 MAKE_1OP_8FLAGS_INST(setl);
529 MAKE_1OP_8FLAGS_INST(setle);
530 MAKE_1OP_8FLAGS_INST(setnb);
531 MAKE_1OP_8FLAGS_INST(setnbe);
532 MAKE_1OP_8FLAGS_INST(setnl);
533 MAKE_1OP_8FLAGS_INST(setnle);
534 MAKE_1OP_8FLAGS_INST(setno);
535 MAKE_1OP_8FLAGS_INST(setnp);
536 MAKE_1OP_8FLAGS_INST(setns);
537 MAKE_1OP_8FLAGS_INST(setnz);
538 MAKE_1OP_8FLAGS_INST(seto);
539 MAKE_1OP_8FLAGS_INST(setp);
540 MAKE_1OP_8FLAGS_INST(sets);
541 MAKE_1OP_8FLAGS_INST(setz);
542
543
544 MAKE_1OP_8_INST(not);
545
546 MAKE_2OP_8_INST(mov);
547 MAKE_2OP_8EXT_INST(movzx);
548 MAKE_2OP_8EXT_INST(movsx);
549
550 MAKE_2OUT_8_INST(xchg);
551
552 MAKE_2OP_8STR_INST(movs);
553 MAKE_1OP_8STR_INST(stos);
554 MAKE_1OP_8STR_INST(scas);
555
556
557 /****************************/
558 /* 16 Bit instruction forms */
559 /****************************/
560 MAKE_2OP_16FLAGS_INST(adc);
561 MAKE_2OP_16FLAGS_INST(add);
562 MAKE_2OP_16FLAGS_INST(and);
563 MAKE_2OP_16FLAGS_INST(or);
564 MAKE_2OP_16FLAGS_INST(xor);
565 MAKE_2OP_16FLAGS_INST(sub);
566
567
568 MAKE_1OP_16FLAGS_INST(inc);
569 MAKE_1OP_16FLAGS_INST(dec);
570 MAKE_1OP_16FLAGS_INST(neg);
571
572 MAKE_1OP_16_INST(not);
573
574 MAKE_2OP_16_INST(mov);
575 MAKE_2OP_16EXT_INST(movzx);
576 MAKE_2OP_16EXT_INST(movsx);
577 MAKE_2OUT_16_INST(xchg);
578
579 MAKE_2OP_16STR_INST(movs);
580 MAKE_1OP_16STR_INST(stos);
581 MAKE_1OP_16STR_INST(scas);
582
583
584 /****************************/
585 /* 32 Bit instruction forms */
586 /****************************/
587 MAKE_2OP_32FLAGS_INST(adc);
588 MAKE_2OP_32FLAGS_INST(add);
589 MAKE_2OP_32FLAGS_INST(and);
590 MAKE_2OP_32FLAGS_INST(or);
591 MAKE_2OP_32FLAGS_INST(xor);
592 MAKE_2OP_32FLAGS_INST(sub);
593
594
595 MAKE_1OP_32FLAGS_INST(inc);
596 MAKE_1OP_32FLAGS_INST(dec);
597 MAKE_1OP_32FLAGS_INST(neg);
598
599 MAKE_1OP_32_INST(not);
600
601 MAKE_2OP_32_INST(mov);
602
603 MAKE_2OUT_32_INST(xchg);
604
605
606
607 MAKE_2OP_32STR_INST(movs);
608 MAKE_1OP_32STR_INST(stos);
609 MAKE_1OP_32STR_INST(scas);
610
611
612
613 #ifdef __V3_64BIT__
614
615 /****************************/
616 /* 64 Bit instruction forms */
617 /****************************/
618 MAKE_2OP_64FLAGS_INST(adc);
619 MAKE_2OP_64FLAGS_INST(add);
620 MAKE_2OP_64FLAGS_INST(and);
621 MAKE_2OP_64FLAGS_INST(or);
622 MAKE_2OP_64FLAGS_INST(xor);
623 MAKE_2OP_64FLAGS_INST(sub);
624
625 MAKE_1OP_64FLAGS_INST(inc);
626 MAKE_1OP_64FLAGS_INST(dec);
627 MAKE_1OP_64FLAGS_INST(neg);
628
629 MAKE_1OP_64_INST(not);
630
631
632 MAKE_2OP_64_INST(mov);
633 MAKE_2OP_64STR_INST(movs);
634 MAKE_1OP_64STR_INST(stos);
635 MAKE_1OP_64STR_INST(scas);
636
637 MAKE_2OUT_64_INST(xchg);
638
639
640 #endif