#define x86_byte(inst, x) (*(inst)++ = (unsigned char)(x))
-#define x86_address_byte(inst,m,o,r) do { *(inst)++ = ((((m)&0x03)<<6)|(((o)&0x07)<<3)|(((r)&0x07))); } while (0)
+#define x86_address_byte(inst,m,o,r) x86_byte (inst, ((((m)&0x03)<<6) | (((o)&0x07)<<3) | (((r)&0x07))))
+
#define x86_imm_emit32(inst,imm) \
do { \
x86_imm_buf imb; imb.val = (int) (imm); \
- *(inst)++ = imb.b [0]; \
- *(inst)++ = imb.b [1]; \
- *(inst)++ = imb.b [2]; \
- *(inst)++ = imb.b [3]; \
+ x86_byte (inst, imb.b [0]); \
+ x86_byte (inst, imb.b [1]); \
+ x86_byte (inst, imb.b [2]); \
+ x86_byte (inst, imb.b [3]); \
} while (0)
#define x86_imm_emit16(inst,imm) do { *(short*)(inst) = (imm); (inst) += 2; } while (0)
#define x86_imm_emit8(inst,imm) do { *(inst) = (unsigned char)((imm) & 0xff); ++(inst); } while (0)
#define kMaxMembaseEmitPadding 6
-#define x86_membase_emit_body(inst,r,basereg,disp) do {\
+#define x86_membase_emit(inst,r,basereg,disp) do {\
if ((basereg) == X86_ESP) { \
if ((disp) == 0) { \
x86_address_byte ((inst), 0, (r), X86_ESP); \
} \
} while (0)
-#define x86_membase_emit(inst,r,basereg,disp) \
- do { \
- x86_membase_emit_body((inst),(r),(basereg),(disp)); \
- } while (0)
-
#define kMaxMemindexEmitPadding 6
#define x86_memindex_emit(inst,r,basereg,disp,indexreg,shift) \
* the instruction is inspected for validity and the correct displacement
* is inserted.
*/
-#define x86_do_patch(ins,target) \
+#define x86_patch(ins,target) \
do { \
unsigned char* pos = (ins) + 1; \
int disp, size = 0; \
else assert (0); \
} while (0)
-#define x86_patch(ins,target) do { x86_do_patch((ins), (target)); } while (0)
+#define x86_breakpoint(inst) x86_byte (inst, 0xcc)
-#define x86_breakpoint(inst) \
- do { \
- x86_byte (inst, 0xcc); \
- } while (0)
+#define x86_cld(inst) x86_byte (inst, 0xfc)
+#define x86_stosb(inst) x86_byte (inst, 0xaa)
+#define x86_stosl(inst) x86_byte (inst, 0xab)
+#define x86_stosd(inst) x86_stosl (inst)
+#define x86_movsb(inst) x86_byte (inst, 0xa4)
+#define x86_movsl(inst) x86_byte (inst, 0xa5)
+#define x86_movsd(inst) x86_movsl (inst)
-#define x86_cld(inst) do { *(inst)++ =(unsigned char)0xfc; } while (0)
-#define x86_stosb(inst) do { *(inst)++ =(unsigned char)0xaa; } while (0)
-#define x86_stosl(inst) do { *(inst)++ =(unsigned char)0xab; } while (0)
-#define x86_stosd(inst) x86_stosl((inst))
-#define x86_movsb(inst) do { *(inst)++ =(unsigned char)0xa4; } while (0)
-#define x86_movsl(inst) do { *(inst)++ =(unsigned char)0xa5; } while (0)
-#define x86_movsd(inst) x86_movsl((inst))
-
-#define x86_prefix(inst,p) \
- do { \
- *(inst)++ =(unsigned char) (p); \
- } while (0)
+#define x86_prefix(inst,p) x86_byte (inst, p)
#define x86_mfence(inst) \
do { \
x86_membase_emit ((inst), 0, (basereg), (disp)); \
} while (0)
-#define x86_inc_reg(inst,reg) do { *(inst)++ = (unsigned char)0x40 + (reg); } while (0)
+#define x86_inc_reg(inst,reg) x86_byte (inst, (unsigned char)0x40 + (reg))
#define x86_dec_mem(inst,mem) \
do { \
x86_membase_emit ((inst), 1, (basereg), (disp)); \
} while (0)
-#define x86_dec_reg(inst,reg) do { *(inst)++ = (unsigned char)0x48 + (reg); } while (0)
+#define x86_dec_reg(inst,reg) x86_byte (inst, (unsigned char)0x48 + (reg))
#define x86_not_mem(inst,mem) \
do { \
do { \
if ((reg) == X86_EAX) { \
x86_codegen_pre(&(inst), 5); \
- *(inst)++ = (((unsigned char)(opc)) << 3) + 5; \
+ x86_byte (inst, (((unsigned char)(opc)) << 3) + 5); \
x86_imm_emit32 ((inst), (imm)); \
break; \
} \
#define x86_alu_mem_reg(inst,opc,mem,reg) \
do { \
x86_codegen_pre(&(inst), 6); \
- *(inst)++ = (((unsigned char)(opc)) << 3) + 1; \
+ x86_byte (inst, (((unsigned char)(opc)) << 3) + 1); \
x86_mem_emit ((inst), (reg), (mem)); \
} while (0)
#define x86_alu_membase_reg(inst,opc,basereg,disp,reg) \
do { \
x86_codegen_pre(&(inst), 1 + kMaxMembaseEmitPadding); \
- *(inst)++ = (((unsigned char)(opc)) << 3) + 1; \
+ x86_byte (inst, (((unsigned char)(opc)) << 3) + 1); \
x86_membase_emit ((inst), (reg), (basereg), (disp)); \
} while (0)
#define x86_alu_reg_reg(inst,opc,dreg,reg) \
do { \
x86_codegen_pre(&(inst), 2); \
- *(inst)++ = (((unsigned char)(opc)) << 3) + 3; \
+ x86_byte (inst, (((unsigned char)(opc)) << 3) + 3); \
x86_reg_emit ((inst), (dreg), (reg)); \
} while (0)
#define x86_alu_reg8_reg8(inst,opc,dreg,reg,is_dreg_h,is_reg_h) \
do { \
x86_codegen_pre(&(inst), 2); \
- *(inst)++ = (((unsigned char)(opc)) << 3) + 2; \
+ x86_byte (inst, (((unsigned char)(opc)) << 3) + 2); \
x86_reg8_emit ((inst), (dreg), (reg), (is_dreg_h), (is_reg_h)); \
} while (0)
#define x86_alu_reg_mem(inst,opc,reg,mem) \
do { \
x86_codegen_pre(&(inst), 6); \
- *(inst)++ = (((unsigned char)(opc)) << 3) + 3; \
+ x86_byte (inst, (((unsigned char)(opc)) << 3) + 3); \
x86_mem_emit ((inst), (reg), (mem)); \
} while (0)
#define x86_alu_reg_membase(inst,opc,reg,basereg,disp) \
do { \
x86_codegen_pre(&(inst), 1 + kMaxMembaseEmitPadding); \
- *(inst)++ = (((unsigned char)(opc)) << 3) + 3; \
+ x86_byte (inst, (((unsigned char)(opc)) << 3) + 3); \
x86_membase_emit ((inst), (reg), (basereg), (disp)); \
} while (0)
#define x86_mov_reg_imm(inst,reg,imm) \
do { \
x86_codegen_pre(&(inst), 5); \
- *(inst)++ = (unsigned char)0xb8 + (reg); \
+ x86_byte (inst, (unsigned char)0xb8 + (reg)); \
x86_imm_emit32 ((inst), (imm)); \
} while (0)
x86_byte (inst, 0x0f); \
if ((is_signed)) op += 0x08; \
if ((is_half)) op += 0x01; \
- *(inst)++ = op; \
+ x86_byte (inst, op); \
x86_reg_emit ((inst), (dreg), (reg)); \
} while (0)
x86_byte (inst, 0x0f); \
if ((is_signed)) op += 0x08; \
if ((is_half)) op += 0x01; \
- *(inst)++ = op; \
+ x86_byte (inst, op); \
x86_mem_emit ((inst), (dreg), (mem)); \
} while (0)
x86_byte (inst, 0x0f); \
if ((is_signed)) op += 0x08; \
if ((is_half)) op += 0x01; \
- *(inst)++ = op; \
+ x86_byte (inst, op); \
x86_membase_emit ((inst), (dreg), (basereg), (disp)); \
} while (0)
x86_byte (inst, 0x0f); \
if ((is_signed)) op += 0x08; \
if ((is_half)) op += 0x01; \
- *(inst)++ = op; \
+ x86_byte (inst, op); \
x86_memindex_emit ((inst), (dreg), (basereg), (disp), (indexreg), (shift)); \
} while (0)
#define x86_fp_op_mem(inst,opc,mem,is_double) \
do { \
x86_codegen_pre(&(inst), 6); \
- *(inst)++ = (is_double) ? (unsigned char)0xdc : (unsigned char)0xd8; \
+ x86_byte (inst, (is_double) ? (unsigned char)0xdc : (unsigned char)0xd8); \
x86_mem_emit ((inst), (opc), (mem)); \
} while (0)
#define x86_fp_op_membase(inst,opc,basereg,disp,is_double) \
do { \
x86_codegen_pre(&(inst), 1 + kMaxMembaseEmitPadding); \
- *(inst)++ = (is_double) ? (unsigned char)0xdc : (unsigned char)0xd8; \
+ x86_byte (inst, (is_double) ? 0xdc : 0xd8); \
x86_membase_emit ((inst), (opc), (basereg), (disp)); \
} while (0)
do { \
x86_codegen_pre(&(inst), 2); \
x86_byte (inst, 0xd8); \
- *(inst)++ = (unsigned char)0xc0+((opc)<<3)+((index)&0x07); \
+ x86_byte (inst, (unsigned char)0xc0+((opc)<<3)+((index)&0x07)); \
} while (0)
#define x86_fp_op_reg(inst,opc,index,pop_stack) \
do { \
static const unsigned char map[] = { 0, 1, 2, 3, 5, 4, 7, 6, 8}; \
x86_codegen_pre(&(inst), 2); \
- *(inst)++ = (pop_stack) ? (unsigned char)0xde : (unsigned char)0xdc; \
- *(inst)++ = (unsigned char)0xc0+(map[(opc)]<<3)+((index)&0x07); \
+ x86_byte (inst, (pop_stack) ? 0xde : 0xdc); \
+ x86_byte (inst, (unsigned char)0xc0+(map[(opc)]<<3)+((index)&0x07)); \
} while (0)
/**
#define x86_fp_int_op_membase(inst,opc,basereg,disp,is_int) \
do { \
x86_codegen_pre(&(inst), 1 + kMaxMembaseEmitPadding); \
- *(inst)++ = (is_int) ? (unsigned char)0xda : (unsigned char)0xde; \
+ x86_byte (inst, (is_int) ? 0xda : 0xde); \
x86_membase_emit ((inst), opc, (basereg), (disp)); \
} while (0)
do { \
x86_codegen_pre(&(inst), 2); \
x86_byte (inst, 0xdd); \
- *(inst)++ = (unsigned char)0xd8+(index); \
+ x86_byte (inst, (unsigned char)0xd8+(index)); \
} while (0)
#define x86_fcompp(inst) \
do { \
x86_codegen_pre(&(inst), 2); \
x86_byte (inst, 0xd9); \
- *(inst)++ = (unsigned char)0xc8 + ((index) & 0x07); \
+ x86_byte (inst, (unsigned char)0xc8 + ((index) & 0x07)); \
} while (0)
#define x86_fcomi(inst,index) \
do { \
x86_codegen_pre(&(inst), 2); \
x86_byte (inst, 0xdb); \
- *(inst)++ = (unsigned char)0xf0 + ((index) & 0x07); \
+ x86_byte (inst, (unsigned char)0xf0 + ((index) & 0x07)); \
} while (0)
#define x86_fcomip(inst,index) \
do { \
x86_codegen_pre(&(inst), 2); \
x86_byte (inst, 0xdf); \
- *(inst)++ = (unsigned char)0xf0 + ((index) & 0x07); \
+ x86_byte (inst, (unsigned char)0xf0 + ((index) & 0x07)); \
} while (0)
#define x86_fucomi(inst,index) \
do { \
x86_codegen_pre(&(inst), 2); \
x86_byte (inst, 0xdb); \
- *(inst)++ = (unsigned char)0xe8 + ((index) & 0x07); \
+ x86_byte (inst, (unsigned char)0xe8 + ((index) & 0x07)); \
} while (0)
#define x86_fucomip(inst,index) \
do { \
x86_codegen_pre(&(inst), 2); \
x86_byte (inst, 0xdf); \
- *(inst)++ = (unsigned char)0xe8 + ((index) & 0x07); \
+ x86_byte (inst, (unsigned char)0xe8 + ((index) & 0x07)); \
} while (0)
#define x86_fld(inst,mem,is_double) \
do { \
x86_codegen_pre(&(inst), 6); \
- *(inst)++ = (is_double) ? (unsigned char)0xdd : (unsigned char)0xd9; \
+ x86_byte (inst, (is_double) ? 0xdd : 0xd9); \
x86_mem_emit ((inst), 0, (mem)); \
} while (0)
#define x86_fld_membase(inst,basereg,disp,is_double) \
do { \
x86_codegen_pre(&(inst), 1 + kMaxMembaseEmitPadding); \
- *(inst)++ = (is_double) ? (unsigned char)0xdd : (unsigned char)0xd9; \
+ x86_byte (inst, (is_double) ? 0xdd : 0xd9); \
x86_membase_emit ((inst), 0, (basereg), (disp)); \
} while (0)
do { \
x86_codegen_pre(&(inst), 2); \
x86_byte (inst, 0xd9); \
- *(inst)++ = (unsigned char)0xc0 + ((index) & 0x07); \
+ x86_byte (inst, (unsigned char)0xc0 + ((index) & 0x07)); \
} while (0)
#define x86_fldz(inst) \
#define x86_fst(inst,mem,is_double,pop_stack) \
do { \
x86_codegen_pre(&(inst), 6); \
- *(inst)++ = (is_double) ? (unsigned char)0xdd: (unsigned char)0xd9; \
+ x86_byte (inst, (is_double) ? 0xdd: 0xd9); \
x86_mem_emit ((inst), 2 + ((pop_stack) ? 1 : 0), (mem)); \
} while (0)
#define x86_fst_membase(inst,basereg,disp,is_double,pop_stack) \
do { \
x86_codegen_pre(&(inst), 1 + kMaxMembaseEmitPadding); \
- *(inst)++ = (is_double) ? (unsigned char)0xdd: (unsigned char)0xd9; \
+ x86_byte (inst, (is_double) ? 0xdd: 0xd9); \
x86_membase_emit ((inst), 2 + ((pop_stack) ? 1 : 0), (basereg), (disp)); \
} while (0)
} while (0)
-#define x86_push_reg(inst,reg) \
- do { \
- *(inst)++ = (unsigned char)0x50 + (reg); \
- } while (0)
+#define x86_push_reg(inst,reg) x86_byte(inst, (unsigned char)0x50 + (reg))
#define x86_push_regp(inst,reg) \
do { \
} \
} while (0)
-#define x86_pop_reg(inst,reg) \
- do { \
- *(inst)++ = (unsigned char)0x58 + (reg); \
- } while (0)
+#define x86_pop_reg(inst,reg) x86_byte (inst, (unsigned char)0x58 + (reg))
#define x86_pop_mem(inst,mem) \
do { \
/*
* target is a pointer in our buffer.
*/
-#define x86_jump_code_body(inst,target) \
+#define x86_jump_code(inst,target) \
do { \
int t; \
x86_codegen_pre(&(inst), 2); \
} \
} while (0)
-#define x86_jump_code(inst,target) \
- do { \
- x86_jump_code_body((inst),(target)); \
- } while (0)
-
#define x86_jump_disp(inst,disp) \
do { \
int t = (disp) - 2; \
do { \
x86_codegen_pre(&(inst), 2); \
if ((is_signed)) \
- *(inst)++ = x86_cc_signed_map [(cond)]; \
+ x86_byte(inst, x86_cc_signed_map [(cond)]); \
else \
- *(inst)++ = x86_cc_unsigned_map [(cond)]; \
+ x86_byte(inst, x86_cc_unsigned_map [(cond)]); \
x86_imm_emit8 ((inst), (imm)); \
} while (0)
x86_codegen_pre(&(inst), 6); \
x86_byte (inst, 0x0f); \
if ((is_signed)) \
- *(inst)++ = x86_cc_signed_map [(cond)] + 0x10; \
+ x86_byte(inst, x86_cc_signed_map [(cond)] + 0x10); \
else \
- *(inst)++ = x86_cc_unsigned_map [(cond)] + 0x10; \
+ x86_byte(inst, x86_cc_unsigned_map [(cond)] + 0x10); \
x86_imm_emit32 ((inst), (imm)); \
} while (0)
#elif defined(TARGET_AMD64)
do { \
amd64_codegen_pre(inst); \
if ((is_signed)) \
- *(inst)++ = x86_cc_signed_map [(cond)]; \
+ x86_byte(inst, x86_cc_signed_map [(cond)]); \
else \
- *(inst)++ = x86_cc_unsigned_map [(cond)]; \
+ x86_byte(inst, x86_cc_unsigned_map [(cond)]); \
x86_imm_emit8 ((inst), (imm)); \
amd64_codegen_post(inst); \
} while (0)
amd64_codegen_pre(inst); \
x86_byte (inst, 0x0f); \
if ((is_signed)) \
- *(inst)++ = x86_cc_signed_map [(cond)] + 0x10; \
+ x86_byte(inst, x86_cc_signed_map [(cond)] + 0x10); \
else \
- *(inst)++ = x86_cc_unsigned_map [(cond)] + 0x10; \
+ x86_byte(inst, x86_cc_unsigned_map [(cond)] + 0x10); \
x86_imm_emit32 ((inst), (imm)); \
amd64_codegen_post(inst); \
} while (0)
/* This macro is used directly from mini-amd64.c and other */
/* amd64 specific files, so it needs to be instrumented directly. */
-#define x86_branch_body(inst,cond,target,is_signed) \
+#define x86_branch(inst,cond,target,is_signed) \
do { \
int offset = (target) - (inst) - 2; \
if (x86_is_imm8 ((offset))) \
} \
} while (0)
-#define x86_branch(inst,cond,target,is_signed) \
- do { \
- x86_branch_body((inst),(cond),(target),(is_signed)); \
- } while (0)
-
#endif /* TARGET_AMD64 */
#define x86_branch_disp(inst,cond,disp,is_signed) \
x86_codegen_pre(&(inst), 3); \
x86_byte (inst, 0x0f); \
if ((is_signed)) \
- *(inst)++ = x86_cc_signed_map [(cond)] + 0x20; \
+ x86_byte(inst, x86_cc_signed_map [(cond)] + 0x20); \
else \
- *(inst)++ = x86_cc_unsigned_map [(cond)] + 0x20; \
+ x86_byte(inst, x86_cc_unsigned_map [(cond)] + 0x20); \
x86_reg_emit ((inst), 0, (reg)); \
} while (0)
x86_codegen_pre(&(inst), 7); \
x86_byte (inst, 0x0f); \
if ((is_signed)) \
- *(inst)++ = x86_cc_signed_map [(cond)] + 0x20; \
+ x86_byte(inst, x86_cc_signed_map [(cond)] + 0x20); \
else \
- *(inst)++ = x86_cc_unsigned_map [(cond)] + 0x20; \
+ x86_byte(inst, x86_cc_unsigned_map [(cond)] + 0x20); \
x86_mem_emit ((inst), 0, (mem)); \
} while (0)
x86_codegen_pre(&(inst), 2 + kMaxMembaseEmitPadding); \
x86_byte (inst, 0x0f); \
if ((is_signed)) \
- *(inst)++ = x86_cc_signed_map [(cond)] + 0x20; \
+ x86_byte(inst, x86_cc_signed_map [(cond)] + 0x20); \
else \
- *(inst)++ = x86_cc_unsigned_map [(cond)] + 0x20; \
+ x86_byte(inst, x86_cc_unsigned_map [(cond)] + 0x20); \
x86_membase_emit ((inst), 0, (basereg), (disp)); \
} while (0)
#define x86_cmov_reg(inst,cond,is_signed,dreg,reg) \
do { \
x86_codegen_pre(&(inst), 3); \
- *(inst)++ = (unsigned char) 0x0f; \
+ x86_byte (inst, 0x0f); \
if ((is_signed)) \
- *(inst)++ = x86_cc_signed_map [(cond)] - 0x30; \
+ x86_byte(inst, x86_cc_signed_map [(cond)] - 0x30); \
else \
- *(inst)++ = x86_cc_unsigned_map [(cond)] - 0x30; \
+ x86_byte(inst, x86_cc_unsigned_map [(cond)] - 0x30); \
x86_reg_emit ((inst), (dreg), (reg)); \
} while (0)
#define x86_cmov_mem(inst,cond,is_signed,reg,mem) \
do { \
x86_codegen_pre(&(inst), 7); \
- *(inst)++ = (unsigned char) 0x0f; \
+ x86_byte(inst, 0x0f); \
if ((is_signed)) \
- *(inst)++ = x86_cc_signed_map [(cond)] - 0x30; \
+ x86_byte(inst, x86_cc_signed_map [(cond)] - 0x30); \
else \
- *(inst)++ = x86_cc_unsigned_map [(cond)] - 0x30; \
+ x86_byte(inst, x86_cc_unsigned_map [(cond)] - 0x30); \
x86_mem_emit ((inst), (reg), (mem)); \
} while (0)
#define x86_cmov_membase(inst,cond,is_signed,reg,basereg,disp) \
do { \
x86_codegen_pre(&(inst), 2 + kMaxMembaseEmitPadding); \
- *(inst)++ = (unsigned char) 0x0f; \
+ x86_byte(inst, 0x0f); \
if ((is_signed)) \
- *(inst)++ = x86_cc_signed_map [(cond)] - 0x30; \
+ x86_byte(inst, x86_cc_signed_map [(cond)] - 0x30); \
else \
- *(inst)++ = x86_cc_unsigned_map [(cond)] - 0x30; \
+ x86_byte(inst, x86_cc_unsigned_map [(cond)] - 0x30); \
x86_membase_emit ((inst), (reg), (basereg), (disp)); \
} while (0)
x86_codegen_pre(&(inst), 4); \
x86_byte (inst, 0xc8); \
x86_imm_emit16 ((inst), (framesize)); \
- *(inst)++ = 0; \
+ x86_byte(inst, 0); \
} while (0)
#define x86_leave(inst) do { x86_byte (inst, 0xc9); } while (0)
do { \
x86_codegen_pre(&(inst), 3); \
x86_byte (inst, 0x0F); \
- *(inst)++ = (unsigned char)(opc); \
+ x86_byte (inst, opc); \
x86_reg_emit ((inst), (dreg), (reg)); \
} while (0)
do { \
x86_codegen_pre(&(inst), 2 + kMaxMembaseEmitPadding); \
x86_byte (inst, 0x0f); \
- *(inst)++ = (unsigned char)(opc); \
+ x86_byte (inst, opc); \
x86_membase_emit ((inst), (sreg), (basereg), (disp)); \
} while (0)
do { \
x86_codegen_pre(&(inst), 2 + kMaxMembaseEmitPadding); \
x86_byte (inst, 0x0F); \
- *(inst)++ = (unsigned char)(opc); \
+ x86_byte (inst, opc); \
x86_membase_emit ((inst), (reg), (basereg), (disp)); \
} while (0)
do { \
x86_codegen_pre(&(inst), 4); \
x86_byte (inst, 0x0F); \
- *(inst)++ = (unsigned char)(opc); \
+ x86_byte (inst, opc); \
x86_reg_emit ((inst), (dreg), (reg)); \
- *(inst)++ = (unsigned char)(imm8); \
+ x86_byte (inst, imm8); \
} while (0)
#define x86_sse_alu_pd_reg_reg_imm8(inst,opc,dreg,reg, imm8) \
do { \
x86_codegen_pre(&(inst), 5); \
x86_sse_alu_pd_reg_reg ((inst), (opc), (dreg), (reg)); \
- *(inst)++ = (unsigned char)(imm); \
+ x86_byte (inst, imm); \
} while (0)
#define x86_sse_alu_pd_reg_membase_imm(inst,opc,dreg,basereg,disp,imm) \
do { \
x86_codegen_pre(&(inst), 4 + kMaxMembaseEmitPadding); \
x86_sse_alu_pd_reg_membase ((inst), (opc), (dreg),(basereg), (disp)); \
- *(inst)++ = (unsigned char)(imm); \
+ x86_byte (inst, imm); \
} while (0)
do { \
x86_codegen_pre(&(inst), 4); \
x86_sse_alu_reg_reg ((inst), (opc), (dreg), (reg)); \
- *(inst)++ = (unsigned char)imm; \
+ x86_byte (inst, imm); \
} while (0)
x86_byte (inst, 0x66); \
x86_byte (inst, 0x0F); \
x86_byte (inst, 0x38); \
- *(inst)++ = (unsigned char)(opc); \
+ x86_byte (inst, opc); \
x86_reg_emit ((inst), (dreg), (reg)); \
} while (0)
#define x86_pshufw_reg_reg(inst,dreg,sreg,mask,high_words) \
do { \
x86_codegen_pre(&(inst), 5); \
- *(inst)++ = (unsigned char)(high_words) ? 0xF3 : 0xF2; \
+ x86_byte (inst, (high_words) ? 0xF3 : 0xF2); \
x86_byte (inst, 0x0f); \
x86_byte (inst, 0x70); \
x86_reg_emit ((inst), (dreg), (sreg)); \
- *(inst)++ = (unsigned char)mask; \
+ x86_byte (inst, mask); \
} while (0)
#define x86_sse_shift_reg_imm(inst,opc,mode, dreg,imm) \
x86_sse_alu_pd_reg_reg (inst, opc, dreg, sreg); \
} while (0)
-
-
#endif // X86_H
-