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.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
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.
14 * Author: Jack Lange <jarusl@cs.northwestern.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
20 #ifdef __DECODER_TEST__
21 #include "vmm_decoder.h"
23 #include <xed/xed-interface.h>
29 #include <palacios/vmm_decoder.h>
30 #include <palacios/vmm_xed.h>
31 #include <xed/xed-interface.h>
32 #include <palacios/vm_guest.h>
33 #include <palacios/vmm.h>
40 #define PrintDebug(fmt, args...)
46 static uint_t tables_inited = 0;
49 #define GPR_REGISTER 0
50 #define SEGMENT_REGISTER 1
51 #define CTRL_REGISTER 2
52 #define DEBUG_REGISTER 3
56 /* Disgusting mask hack...
57 I can't think right now, so we'll do it this way...
59 static const ullong_t mask_1 = 0x00000000000000ffLL;
60 static const ullong_t mask_2 = 0x000000000000ffffLL;
61 static const ullong_t mask_4 = 0x00000000ffffffffLL;
62 static const ullong_t mask_8 = 0xffffffffffffffffLL;
65 #define MASK(val, length) ({ \
66 ullong_t mask = 0x0LL; \
79 struct memory_operand {
87 uint_t displacement_size;
88 ullong_t displacement;
94 static v3_op_type_t get_opcode(xed_iform_enum_t iform);
96 static int xed_reg_to_v3_reg(struct guest_info * info, xed_reg_enum_t xed_reg, addr_t * v3_reg, uint_t * reg_len);
97 static int get_memory_operand(struct guest_info * info, xed_decoded_inst_t * xed_instr, uint_t index, struct x86_operand * operand);
99 static int set_decoder_mode(struct guest_info * info, xed_state_t * state) {
100 switch (info->cpu_mode) {
102 if (state->mmode != XED_MACHINE_MODE_LEGACY_16) {
103 xed_state_init(state,
104 XED_MACHINE_MODE_LEGACY_16,
105 XED_ADDRESS_WIDTH_16b,
106 XED_ADDRESS_WIDTH_16b);
112 if (state->mmode != XED_MACHINE_MODE_LEGACY_32) {
113 xed_state_init(state,
114 XED_MACHINE_MODE_LEGACY_32,
115 XED_ADDRESS_WIDTH_32b,
116 XED_ADDRESS_WIDTH_32b);
120 if (state->mmode != XED_MACHINE_MODE_LONG_64) {
121 state->mmode = XED_MACHINE_MODE_LONG_64;
125 PrintError("Unsupported CPU mode: %d\n", info->cpu_mode);
131 static int is_flags_reg(xed_reg_enum_t xed_reg) {
144 int v3_init_decoder(struct guest_info * info) {
145 // Global library initialization, only do it once
146 if (tables_inited == 0) {
151 xed_state_t * decoder_state = (xed_state_t *)V3_Malloc(sizeof(xed_state_t));
152 xed_state_zero(decoder_state);
154 info->decoder_state = decoder_state;
161 int v3_basic_mem_decode(struct guest_info * info, addr_t instr_ptr, struct basic_instr_info * instr_info) {
162 xed_decoded_inst_t xed_instr;
163 xed_error_enum_t xed_error;
166 if (set_decoder_mode(info, info->decoder_state) == -1) {
167 PrintError("Could not set decoder mode\n");
172 xed_decoded_inst_zero_set_mode(&xed_instr, info->decoder_state);
174 xed_error = xed_decode(&xed_instr,
175 REINTERPRET_CAST(const xed_uint8_t *, instr_ptr),
176 XED_MAX_INSTRUCTION_BYTES);
178 if (xed_error != XED_ERROR_NONE) {
179 PrintError("Xed error: %s\n", xed_error_enum_t2str(xed_error));
183 instr_info->instr_length = xed_decoded_inst_get_length(&xed_instr);
186 if (xed_decoded_inst_number_of_memory_operands(&xed_instr) == 0) {
187 PrintError("Tried to decode memory operation with no memory operands\n");
191 instr_info->op_size = xed_decoded_inst_get_memory_operand_length(&xed_instr, 0);
194 xed_category_enum_t cat = xed_decoded_inst_get_category(&xed_instr);
195 if (cat == XED_CATEGORY_STRINGOP) {
196 instr_info->str_op = 1;
198 instr_info->str_op = 0;
201 xed_operand_values_t * operands = xed_decoded_inst_operands(&xed_instr);
202 if (xed_operand_values_has_real_rep(operands)) {
203 instr_info->has_rep = 1;
205 instr_info->has_rep = 0;
212 static int decode_string_op(struct guest_info * info,
213 xed_decoded_inst_t * xed_instr, const xed_inst_t * xi,
214 struct x86_instr * instr) {
216 PrintDebug("String operation\n");
218 if (instr->op_type == V3_OP_MOVS) {
219 instr->num_operands = 2;
221 if (get_memory_operand(info, xed_instr, 0, &(instr->dst_operand)) == -1) {
222 PrintError("Could not get Destination memory operand\n");
226 if (get_memory_operand(info, xed_instr, 1, &(instr->src_operand)) == -1) {
227 PrintError("Could not get Source memory operand\n");
231 if (instr->prefixes.rep == 1) {
233 uint_t reg_length = 0;
235 xed_reg_to_v3_reg(info, xed_decoded_inst_get_reg(xed_instr, XED_OPERAND_REG0), ®_addr, ®_length);
236 instr->str_op_length = MASK(*(addr_t *)reg_addr, reg_length);
238 instr->str_op_length = 1;
248 int v3_decode(struct guest_info * info, addr_t instr_ptr, struct x86_instr * instr) {
249 xed_decoded_inst_t xed_instr;
250 xed_error_enum_t xed_error;
253 v3_get_prefixes((uchar_t *)instr_ptr, &(instr->prefixes));
255 if (set_decoder_mode(info, info->decoder_state) == -1) {
256 PrintError("Could not set decoder mode\n");
260 xed_decoded_inst_zero_set_mode(&xed_instr, info->decoder_state);
262 xed_error = xed_decode(&xed_instr,
263 REINTERPRET_CAST(const xed_uint8_t *, instr_ptr),
264 XED_MAX_INSTRUCTION_BYTES);
267 if (xed_error != XED_ERROR_NONE) {
268 PrintError("Xed error: %s\n", xed_error_enum_t2str(xed_error));
272 const xed_inst_t * xi = xed_decoded_inst_inst(&xed_instr);
274 instr->instr_length = xed_decoded_inst_get_length(&xed_instr);
277 xed_iform_enum_t iform = xed_decoded_inst_get_iform_enum(&xed_instr);
280 xed_iclass_enum_t iclass = xed_decoded_inst_get_iclass(&xed_instr);
282 PrintDebug("iform=%s, iclass=%s\n", xed_iform_enum_t2str(iform), xed_iclass_enum_t2str(iclass));
286 if ((instr->op_type = get_opcode(iform)) == V3_INVALID_OP) {
287 PrintError("Could not get opcode. (iform=%s)\n", xed_iform_enum_t2str(iform));
292 // We special case the string operations...
293 if (xed_decoded_inst_get_category(&xed_instr) == XED_CATEGORY_STRINGOP) {
294 instr->is_str_op = 1;
295 return decode_string_op(info, &xed_instr, xi, instr);
297 instr->is_str_op = 0;
298 instr->str_op_length = 0;
302 instr->num_operands = xed_decoded_inst_noperands(&xed_instr);
304 if (instr->num_operands > 3) {
305 PrintDebug("Special Case Not Handled\n");
308 } else if (instr->num_operands == 3) {
309 const xed_operand_t * op = xed_inst_operand(xi, 2);
310 xed_operand_enum_t op_enum = xed_operand_name(op);
312 if ((!xed_operand_is_register(op_enum)) ||
313 (!is_flags_reg(xed_decoded_inst_get_reg(&xed_instr, op_enum)))) {
315 PrintError("Special Case not handled\n");
322 //PrintDebug("Number of operands: %d\n", instr->num_operands);
323 //PrintDebug("INSTR length: %d\n", instr->instr_length);
326 if (instr->num_operands >= 1) {
327 const xed_operand_t * op = xed_inst_operand(xi, 0);
328 xed_operand_enum_t op_enum = xed_operand_name(op);
330 struct x86_operand * v3_op = NULL;
332 if (xed_operand_written(op)) {
333 v3_op = &(instr->dst_operand);
335 v3_op = &(instr->src_operand);
339 if (xed_operand_is_register(op_enum)) {
340 xed_reg_enum_t xed_reg = xed_decoded_inst_get_reg(&xed_instr, op_enum);
341 int v3_reg_type = xed_reg_to_v3_reg(info,
346 if (v3_reg_type == -1) {
347 PrintError("First operand is an Unhandled Operand: %s\n", xed_reg_enum_t2str(xed_reg));
348 v3_op->type = INVALID_OPERAND;
350 } else if (v3_reg_type == SEGMENT_REGISTER) {
351 struct v3_segment * seg_reg = (struct v3_segment *)(v3_op->operand);
352 v3_op->operand = (addr_t)&(seg_reg->selector);
355 v3_op->type = REG_OPERAND;
360 case XED_OPERAND_MEM0:
362 if (get_memory_operand(info, &xed_instr, 0, v3_op) == -1) {
363 PrintError("Could not get first memory operand\n");
369 case XED_OPERAND_MEM1:
370 case XED_OPERAND_IMM1:
372 PrintError("Illegal Operand Order\n");
376 case XED_OPERAND_IMM0:
377 case XED_OPERAND_AGEN:
378 case XED_OPERAND_PTR:
379 case XED_OPERAND_RELBR:
381 PrintError("Unhandled Operand Type\n");
389 // set second operand
390 if (instr->num_operands >= 2) {
391 const xed_operand_t * op = xed_inst_operand(xi, 1);
392 // xed_operand_type_enum_t op_type = xed_operand_type(op);
393 xed_operand_enum_t op_enum = xed_operand_name(op);
395 struct x86_operand * v3_op;
397 if (xed_operand_written(op)) {
398 v3_op = &(instr->dst_operand);
400 v3_op = &(instr->src_operand);
404 if (xed_operand_is_register(op_enum)) {
405 xed_reg_enum_t xed_reg = xed_decoded_inst_get_reg(&xed_instr, op_enum);
406 int v3_reg_type = xed_reg_to_v3_reg(info,
410 if (v3_reg_type == -1) {
411 PrintError("Second operand is an Unhandled Operand: %s\n", xed_reg_enum_t2str(xed_reg));
412 v3_op->type = INVALID_OPERAND;
414 } else if (v3_reg_type == SEGMENT_REGISTER) {
415 struct v3_segment * seg_reg = (struct v3_segment *)(v3_op->operand);
416 v3_op->operand = (addr_t)&(seg_reg->selector);
419 v3_op->type = REG_OPERAND;
426 case XED_OPERAND_MEM0:
428 if (get_memory_operand(info, &xed_instr, 0, v3_op) == -1) {
429 PrintError("Could not get first memory operand\n");
435 case XED_OPERAND_IMM0:
437 instr->src_operand.size = xed_decoded_inst_get_immediate_width(&xed_instr);
439 if (instr->src_operand.size > 4) {
440 PrintError("Unhandled 64 bit immediates\n");
443 instr->src_operand.operand = xed_decoded_inst_get_unsigned_immediate(&xed_instr);
445 instr->src_operand.type = IMM_OPERAND;
450 case XED_OPERAND_MEM1:
451 case XED_OPERAND_IMM1:
453 PrintError("Illegal Operand Order\n");
456 case XED_OPERAND_AGEN:
457 case XED_OPERAND_PTR:
458 case XED_OPERAND_RELBR:
460 PrintError("Unhandled Operand Type\n");
468 if (instr->num_operands >= 3) {
469 const xed_operand_t * op = xed_inst_operand(xi, 2);
470 xed_operand_type_enum_t op_type = xed_operand_type(op);
471 xed_operand_enum_t op_enum = xed_operand_name(op);
473 if (xed_operand_is_register(op_enum)) {
474 xed_reg_enum_t xed_reg = xed_decoded_inst_get_reg(&xed_instr, op_enum);
475 int v3_reg_type = xed_reg_to_v3_reg(info,
477 &(instr->third_operand.operand),
478 &(instr->third_operand.size));
480 if (v3_reg_type == -1) {
481 PrintError("Third operand is an Unhandled Operand: %s\n", xed_reg_enum_t2str(xed_reg));
482 instr->third_operand.type = INVALID_OPERAND;
484 } else if (v3_reg_type == SEGMENT_REGISTER) {
485 struct v3_segment * seg_reg = (struct v3_segment *)(instr->third_operand.operand);
486 instr->third_operand.operand = (addr_t)&(seg_reg->selector);
490 instr->third_operand.type = REG_OPERAND;
494 PrintError("Unhandled third operand type %s\n", xed_operand_type_enum_t2str(op_type));
507 int v3_encode(struct guest_info * info, struct x86_instr * instr, char * instr_buf) {
516 static int get_memory_operand(struct guest_info * info, xed_decoded_inst_t * xed_instr, uint_t op_index, struct x86_operand * operand) {
517 struct memory_operand mem_op;
523 ullong_t displacement;
524 // struct v3_segment * seg_reg;
529 memset((void*)&mem_op, '\0', sizeof(struct memory_operand));
531 xed_reg_enum_t xed_seg = xed_decoded_inst_get_seg_reg(xed_instr, op_index);
532 if (xed_seg != XED_REG_INVALID) {
533 struct v3_segment *tmp_segment;
534 if (xed_reg_to_v3_reg(info, xed_seg, (addr_t *)&tmp_segment, &(mem_op.segment_size)) == -1) {
535 PrintError("Unhandled Segment Register\n");
538 mem_op.segment = tmp_segment->base;
541 xed_reg_enum_t xed_base = xed_decoded_inst_get_base_reg(xed_instr, op_index);
542 if (xed_base != XED_REG_INVALID) {
544 if (xed_reg_to_v3_reg(info, xed_base, &base_reg, &(mem_op.base_size)) == -1) {
545 PrintError("Unhandled Base register\n");
548 mem_op.base = *(addr_t *)base_reg;
553 xed_reg_enum_t xed_idx = xed_decoded_inst_get_index_reg(xed_instr, op_index);
554 if ((op_index == 0) && (xed_idx != XED_REG_INVALID)) {
557 if (xed_reg_to_v3_reg(info, xed_idx, &index_reg, &(mem_op.index_size)) == -1) {
558 PrintError("Unhandled Index Register\n");
562 mem_op.index= *(addr_t *)index_reg;
564 xed_uint_t xed_scale = xed_decoded_inst_get_scale(xed_instr, op_index);
565 if (xed_scale != 0) {
566 mem_op.scale = xed_scale;
571 xed_uint_t disp_bits = xed_decoded_inst_get_memory_displacement_width(xed_instr, op_index);
573 xed_int64_t xed_disp = xed_decoded_inst_get_memory_displacement(xed_instr, op_index);
575 mem_op.displacement_size = disp_bits;
576 mem_op.displacement = xed_disp;
579 operand->type = MEM_OPERAND;
580 operand->size = xed_decoded_inst_get_memory_operand_length(xed_instr, op_index);
584 PrintDebug("Struct: Seg=%p, base=%p, index=%p, scale=%p, displacement=%p\n",
585 (void *)mem_op.segment, (void*)mem_op.base, (void *)mem_op.index,
586 (void *)mem_op.scale, (void *)(addr_t)mem_op.displacement);
589 PrintDebug("operand size: %d\n", operand->size);
591 seg = mem_op.segment;
592 base = MASK(mem_op.base, mem_op.base_size);
593 index = MASK(mem_op.index, mem_op.index_size);
594 scale = mem_op.scale;
595 displacement = MASK(mem_op.displacement, mem_op.displacement_size);
597 PrintDebug("Seg=%p, base=%p, index=%p, scale=%p, displacement=%p\n",
598 (void *)seg, (void *)base, (void *)index, (void *)scale, (void *)(addr_t)displacement);
600 operand->operand = seg + base + (scale * index) + displacement;
605 static int xed_reg_to_v3_reg(struct guest_info * info, xed_reg_enum_t xed_reg, addr_t * v3_reg, uint_t * reg_len) {
608 case XED_REG_INVALID:
617 *v3_reg = (addr_t)&(info->vm_regs.rax);
621 *v3_reg = (addr_t)&(info->vm_regs.rax);
625 *v3_reg = (addr_t)&(info->vm_regs.rax);
629 *v3_reg = (addr_t)(&(info->vm_regs.rax)) + 1;
633 *v3_reg = (addr_t)&(info->vm_regs.rax);
638 *v3_reg = (addr_t)&(info->vm_regs.rcx);
642 *v3_reg = (addr_t)&(info->vm_regs.rcx);
646 *v3_reg = (addr_t)&(info->vm_regs.rcx);
650 *v3_reg = (addr_t)(&(info->vm_regs.rcx)) + 1;
654 *v3_reg = (addr_t)&(info->vm_regs.rcx);
659 *v3_reg = (addr_t)&(info->vm_regs.rdx);
663 *v3_reg = (addr_t)&(info->vm_regs.rdx);
667 *v3_reg = (addr_t)&(info->vm_regs.rdx);
671 *v3_reg = (addr_t)(&(info->vm_regs.rdx)) + 1;
675 *v3_reg = (addr_t)&(info->vm_regs.rdx);
680 *v3_reg = (addr_t)&(info->vm_regs.rbx);
684 *v3_reg = (addr_t)&(info->vm_regs.rbx);
688 *v3_reg = (addr_t)&(info->vm_regs.rbx);
692 *v3_reg = (addr_t)(&(info->vm_regs.rbx)) + 1;
696 *v3_reg = (addr_t)&(info->vm_regs.rbx);
702 *v3_reg = (addr_t)&(info->vm_regs.rsp);
706 *v3_reg = (addr_t)&(info->vm_regs.rsp);
710 *v3_reg = (addr_t)&(info->vm_regs.rsp);
714 *v3_reg = (addr_t)&(info->vm_regs.rsp);
719 *v3_reg = (addr_t)&(info->vm_regs.rbp);
723 *v3_reg = (addr_t)&(info->vm_regs.rbp);
727 *v3_reg = (addr_t)&(info->vm_regs.rbp);
731 *v3_reg = (addr_t)&(info->vm_regs.rbp);
738 *v3_reg = (addr_t)&(info->vm_regs.rsi);
742 *v3_reg = (addr_t)&(info->vm_regs.rsi);
746 *v3_reg = (addr_t)&(info->vm_regs.rsi);
750 *v3_reg = (addr_t)&(info->vm_regs.rsi);
756 *v3_reg = (addr_t)&(info->vm_regs.rdi);
760 *v3_reg = (addr_t)&(info->vm_regs.rdi);
764 *v3_reg = (addr_t)&(info->vm_regs.rdi);
768 *v3_reg = (addr_t)&(info->vm_regs.rdi);
777 *v3_reg = (addr_t)&(info->rip);
779 return CTRL_REGISTER;
781 *v3_reg = (addr_t)&(info->rip);
783 return CTRL_REGISTER;
785 *v3_reg = (addr_t)&(info->rip);
787 return CTRL_REGISTER;
790 *v3_reg = (addr_t)&(info->ctrl_regs.rflags);
792 return CTRL_REGISTER;
794 *v3_reg = (addr_t)&(info->ctrl_regs.rflags);
796 return CTRL_REGISTER;
798 *v3_reg = (addr_t)&(info->ctrl_regs.rflags);
800 return CTRL_REGISTER;
803 *v3_reg = (addr_t)&(info->ctrl_regs.cr0);
805 return CTRL_REGISTER;
807 *v3_reg = (addr_t)&(info->ctrl_regs.cr2);
809 return CTRL_REGISTER;
811 *v3_reg = (addr_t)&(info->ctrl_regs.cr3);
813 return CTRL_REGISTER;
815 *v3_reg = (addr_t)&(info->ctrl_regs.cr4);
817 return CTRL_REGISTER;
819 *v3_reg = (addr_t)&(info->ctrl_regs.cr8);
821 return CTRL_REGISTER;
843 *v3_reg = (addr_t)&(info->segments.cs);
844 return SEGMENT_REGISTER;
846 *v3_reg = (addr_t)&(info->segments.ds);
847 return SEGMENT_REGISTER;
849 *v3_reg = (addr_t)&(info->segments.es);
850 return SEGMENT_REGISTER;
852 *v3_reg = (addr_t)&(info->segments.ss);
853 return SEGMENT_REGISTER;
855 *v3_reg = (addr_t)&(info->segments.fs);
856 return SEGMENT_REGISTER;
858 *v3_reg = (addr_t)&(info->segments.gs);
859 return SEGMENT_REGISTER;
866 PrintError("Segment selector operand... Don't know how to handle this...\n");
969 case XED_REG_STACKPUSH:
970 case XED_REG_STACKPOP:
976 case XED_REG_X87CONTROL:
977 case XED_REG_X87STATUS:
980 case XED_REG_X87PUSH:
982 case XED_REG_X87POP2:
1017 static v3_op_type_t get_opcode(xed_iform_enum_t iform) {
1020 case XED_IFORM_MOV_CR_GPR64_CR:
1021 case XED_IFORM_MOV_CR_GPR32_CR:
1022 return V3_OP_MOVCR2;
1024 case XED_IFORM_MOV_CR_CR_GPR64:
1025 case XED_IFORM_MOV_CR_CR_GPR32:
1026 return V3_OP_MOV2CR;
1028 case XED_IFORM_SMSW_GPRv:
1031 case XED_IFORM_LMSW_GPR16:
1034 case XED_IFORM_CLTS:
1037 case XED_IFORM_ADC_MEMv_GPRv:
1038 case XED_IFORM_ADC_MEMv_IMM:
1039 case XED_IFORM_ADC_MEMb_GPR8:
1040 case XED_IFORM_ADC_MEMb_IMM:
1043 case XED_IFORM_ADD_MEMv_GPRv:
1044 case XED_IFORM_ADD_MEMb_IMM:
1045 case XED_IFORM_ADD_MEMb_GPR8:
1046 case XED_IFORM_ADD_MEMv_IMM:
1049 case XED_IFORM_AND_MEMv_IMM:
1050 case XED_IFORM_AND_MEMb_GPR8:
1051 case XED_IFORM_AND_MEMv_GPRv:
1052 case XED_IFORM_AND_MEMb_IMM:
1055 case XED_IFORM_SUB_MEMv_IMM:
1056 case XED_IFORM_SUB_MEMb_GPR8:
1057 case XED_IFORM_SUB_MEMb_IMM:
1058 case XED_IFORM_SUB_MEMv_GPRv:
1061 case XED_IFORM_MOV_MEMv_GPRv:
1062 case XED_IFORM_MOV_MEMb_GPR8:
1063 case XED_IFORM_MOV_MEMb_AL:
1064 case XED_IFORM_MOV_MEMv_IMM:
1065 case XED_IFORM_MOV_MEMb_IMM:
1068 case XED_IFORM_DEC_MEMv:
1069 case XED_IFORM_DEC_MEMb:
1072 case XED_IFORM_INC_MEMb:
1073 case XED_IFORM_INC_MEMv:
1076 case XED_IFORM_OR_MEMv_IMM:
1077 case XED_IFORM_OR_MEMb_IMM:
1078 case XED_IFORM_OR_MEMv_GPRv:
1079 case XED_IFORM_OR_MEMb_GPR8:
1082 case XED_IFORM_XOR_MEMv_GPRv:
1083 case XED_IFORM_XOR_MEMb_IMM:
1084 case XED_IFORM_XOR_MEMb_GPR8:
1085 case XED_IFORM_XOR_MEMv_IMM:
1088 case XED_IFORM_NEG_MEMb:
1089 case XED_IFORM_NEG_MEMv:
1092 case XED_IFORM_NOT_MEMv:
1093 case XED_IFORM_NOT_MEMb:
1096 case XED_IFORM_XCHG_MEMv_GPRv:
1097 case XED_IFORM_XCHG_MEMb_GPR8:
1100 case XED_IFORM_SETB_MEMb:
1103 case XED_IFORM_SETBE_MEMb:
1106 case XED_IFORM_SETL_MEMb:
1109 case XED_IFORM_SETLE_MEMb:
1112 case XED_IFORM_SETNB_MEMb:
1115 case XED_IFORM_SETNBE_MEMb:
1116 return V3_OP_SETNBE;
1118 case XED_IFORM_SETNL_MEMb:
1121 case XED_IFORM_SETNLE_MEMb:
1122 return V3_OP_SETNLE;
1124 case XED_IFORM_SETNO_MEMb:
1127 case XED_IFORM_SETNP_MEMb:
1130 case XED_IFORM_SETNS_MEMb:
1133 case XED_IFORM_SETNZ_MEMb:
1136 case XED_IFORM_SETO_MEMb:
1139 case XED_IFORM_SETP_MEMb:
1142 case XED_IFORM_SETS_MEMb:
1145 case XED_IFORM_SETZ_MEMb:
1148 case XED_IFORM_MOVSB:
1149 case XED_IFORM_MOVSW:
1150 case XED_IFORM_MOVSD:
1151 case XED_IFORM_MOVSQ:
1155 return V3_INVALID_OP;