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.


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