void sse_prefetch1( struct x86_function *p, struct x86_reg ptr) { DUMP_R( ptr ); assert(ptr.mod != mod_REG); emit_2ub(p, 0x0f, 0x18); emit_modrm_noreg(p, 2, ptr); }
void x87_fistp( struct x86_function *p, struct x86_reg dst ) { DUMP_R( dst ); emit_1ub(p, 0xdb); emit_modrm_noreg(p, 3, dst); note_x87_pop(p); }
static void x87_arith_op( struct x86_function *p, struct x86_reg dst, struct x86_reg arg, unsigned char dst0ub0, unsigned char dst0ub1, unsigned char arg0ub0, unsigned char arg0ub1, unsigned char argmem_noreg) { assert(dst.file == file_x87); if (arg.file == file_x87) { if (dst.idx == 0) emit_2ub(p, dst0ub0, dst0ub1+arg.idx); else if (arg.idx == 0) emit_2ub(p, arg0ub0, arg0ub1+arg.idx); else assert(0); } else if (dst.idx == 0) { assert(arg.file == file_REG32); emit_1ub(p, 0xd8); emit_modrm_noreg(p, argmem_noreg, arg); } else assert(0); }
/* Calculate EAX * src, results in EDX:EAX. */ void x86_mul( struct x86_function *p, struct x86_reg src ) { DUMP_R( src ); emit_1ub(p, 0xf7); emit_modrm_noreg(p, 4, src ); }
void x87_fild( struct x86_function *p, struct x86_reg arg ) { DUMP_R( arg ); emit_1ub(p, 0xdf); emit_modrm_noreg(p, 0, arg); note_x87_push(p); }
void x87_fldcw( struct x86_function *p, struct x86_reg arg ) { assert(arg.file == file_REG32); assert(arg.mod != mod_REG); emit_1ub(p, 0xd9); emit_modrm_noreg(p, 5, arg); }
/** * Immediate group 1 instructions. */ static INLINE void x86_group1_imm( struct x86_function *p, unsigned op, struct x86_reg dst, int imm ) { assert(dst.file == file_REG32); assert(dst.mod == mod_REG); if(-0x80 <= imm && imm < 0x80) { emit_1ub(p, 0x83); emit_modrm_noreg(p, op, dst); emit_1b(p, (char)imm); } else { emit_1ub(p, 0x81); emit_modrm_noreg(p, op, dst); emit_1i(p, imm); } }
void x87_fcomp( struct x86_function *p, struct x86_reg dst ) { if (dst.file == file_x87) emit_2ub(p, 0xd8, 0xd8 + dst.idx); else { emit_1ub(p, 0xd8); emit_modrm_noreg(p, 3, dst); } }
void x87_fst( struct x86_function *p, struct x86_reg dst ) { if (dst.file == file_x87) emit_2ub(p, 0xdd, 0xd0 + dst.idx); else { emit_1ub(p, 0xd9); emit_modrm_noreg(p, 2, dst); } }
void x87_fnstcw( struct x86_function *p, struct x86_reg dst ) { DUMP_R( dst ); assert(dst.file == file_REG32); emit_1ub(p, 0x9b); /* WAIT -- needed? */ emit_1ub(p, 0xd9); emit_modrm_noreg(p, 7, dst); }
void x87_fld( struct x86_function *p, struct x86_reg arg ) { if (arg.file == file_x87) emit_2ub(p, 0xd9, 0xc0 + arg.idx); else { emit_1ub(p, 0xd9); emit_modrm_noreg(p, 0, arg); } }
void x87_fcom( struct x86_function *p, struct x86_reg dst ) { DUMP_R( dst ); if (dst.file == file_x87) emit_2ub(p, 0xd8, 0xd0 + dst.idx); else { emit_1ub(p, 0xd8); emit_modrm_noreg(p, 2, dst); } }
void x87_fstp( struct x86_function *p, struct x86_reg dst ) { DUMP_R( dst ); if (dst.file == file_x87) emit_2ub(p, 0xdd, 0xd8 + dst.idx); else { emit_1ub(p, 0xd9); emit_modrm_noreg(p, 3, dst); } note_x87_pop(p); }
void x87_fnstsw( struct x86_function *p, struct x86_reg dst ) { assert(dst.file == file_REG32); if (dst.idx == reg_AX && dst.mod == mod_REG) emit_2ub(p, 0xdf, 0xe0); else { emit_1ub(p, 0xdd); emit_modrm_noreg(p, 7, dst); } }
void x86_mov_imm( struct x86_function *p, struct x86_reg dst, int imm ) { DUMP_RI( dst, imm ); if(dst.mod == mod_REG) x86_mov_reg_imm(p, dst, imm); else { emit_1ub(p, 0xc7); emit_modrm_noreg(p, 0, dst); emit_1i(p, imm); } }
void x86_push( struct x86_function *p, struct x86_reg reg ) { DUMP_R( reg ); if (reg.mod == mod_REG) emit_1ub(p, 0x50 + reg.idx); else { emit_1ub(p, 0xff); emit_modrm_noreg(p, 6, reg); } p->stack_offset += 4; }
void x87_fist( struct x86_function *p, struct x86_reg dst ) { DUMP_R( dst ); emit_1ub(p, 0xdb); emit_modrm_noreg(p, 2, dst); }
void x86_call( struct x86_function *p, struct x86_reg reg) { DUMP_R( reg ); emit_1ub(p, 0xff); emit_modrm_noreg(p, 2, reg); }
void x87_fistp( struct x86_function *p, struct x86_reg dst ) { emit_1ub(p, 0xdb); emit_modrm_noreg(p, 3, dst); }
void x87_fild( struct x86_function *p, struct x86_reg arg ) { emit_1ub(p, 0xdf); emit_modrm_noreg(p, 0, arg); }