#define X86_TWOB 0x0f
+#define DUMP_SSE 0
+
+#if DUMP_SSE
+
+static void
+_print_reg(
+ struct x86_reg reg )
+{
+ if (reg.mod != mod_REG)
+ debug_printf( "[" );
+
+ switch( reg.file ) {
+ case file_REG32:
+ switch( reg.idx ) {
+ case reg_AX: debug_printf( "EAX" ); break;
+ case reg_CX: debug_printf( "ECX" ); break;
+ case reg_DX: debug_printf( "EDX" ); break;
+ case reg_BX: debug_printf( "EBX" ); break;
+ case reg_SP: debug_printf( "ESP" ); break;
+ case reg_BP: debug_printf( "EBP" ); break;
+ case reg_SI: debug_printf( "ESI" ); break;
+ case reg_DI: debug_printf( "EDI" ); break;
+ }
+ break;
+ case file_MMX:
+ debug_printf( "MMX%u", reg.idx );
+ break;
+ case file_XMM:
+ debug_printf( "XMM%u", reg.idx );
+ break;
+ case file_x87:
+ debug_printf( "fp%u", reg.idx );
+ break;
+ }
+
+ if (reg.mod == mod_DISP8 ||
+ reg.mod == mod_DISP32)
+ debug_printf("+%d", reg.disp);
+
+ if (reg.mod != mod_REG)
+ debug_printf( "]" );
+}
+
+static void
+_fill(
+ const char *op )
+{
+ unsigned count = 10 - strlen( op );
+
+ while( count-- ) {
+ debug_printf( " " );
+ }
+}
+
+#define DUMP_START() debug_printf( "\nsse-dump start ----------------" )
+#define DUMP_END() debug_printf( "\nsse-dump end ----------------\n" )
+#define DUMP( OP ) debug_printf( "\n%s", OP )
+
+#define DUMP_I( OP, I ) do { \
+ debug_printf( "\n%s", OP ); \
+ _fill( OP ); \
+ debug_printf( "%u", I ); \
+} while( 0 )
+
+#define DUMP_R( OP, R0 ) do { \
+ debug_printf( "\n%s", OP ); \
+ _fill( OP ); \
+ _print_reg( R0 ); \
+} while( 0 )
+
+#define DUMP_RR( OP, R0, R1 ) do { \
+ debug_printf( "\n%s", OP ); \
+ _fill( OP ); \
+ _print_reg( R0 ); \
+ debug_printf( ", " ); \
+ _print_reg( R1 ); \
+} while( 0 )
+
+#define DUMP_RI( OP, R0, I ) do { \
+ debug_printf( "\n%s", OP ); \
+ _fill( OP ); \
+ _print_reg( R0 ); \
+ debug_printf( ", " ); \
+ debug_printf( "%u", I ); \
+} while( 0 )
+
+#define DUMP_RRI( OP, R0, R1, I ) do { \
+ debug_printf( "\n%s", OP ); \
+ _fill( OP ); \
+ _print_reg( R0 ); \
+ debug_printf( ", " ); \
+ _print_reg( R1 ); \
+ debug_printf( ", " ); \
+ debug_printf( "%u", I ); \
+} while( 0 )
+
+#else
+
+#define DUMP_START()
+#define DUMP_END()
+#define DUMP( OP )
+#define DUMP_I( OP, I )
+#define DUMP_R( OP, R0 )
+#define DUMP_RR( OP, R0, R1 )
+#define DUMP_RI( OP, R0, I )
+#define DUMP_RRI( OP, R0, R1, I )
+
+#endif
+
+
static void do_realloc( struct x86_function *p )
{
if (p->size == 0) {
unsigned char *x86_jmp_forward( struct x86_function *p)
{
+ DUMP( __FUNCTION__ );
emit_1ub(p, 0xe9);
emit_1i(p, 0);
return x86_get_label(p);
unsigned char *x86_call_forward( struct x86_function *p)
{
+ DUMP( __FUNCTION__ );
+
emit_1ub(p, 0xe8);
emit_1i(p, 0);
return x86_get_label(p);
void x86_jmp( struct x86_function *p, unsigned char *label)
{
+ DUMP_I( __FUNCTION__, label );
emit_1ub(p, 0xe9);
emit_1i(p, pointer_to_intptr( label ) - pointer_to_intptr( x86_get_label(p) ) - 4);
}
*/
void x86_call( struct x86_function *p, void (*label)())
{
+ DUMP_I( __FUNCTION__, label );
emit_1ub(p, 0xe8);
emit_1i(p, cptr(label) - x86_get_label(p) - 4);
}
#else
void x86_call( struct x86_function *p, struct x86_reg reg)
{
+ DUMP_R( __FUNCTION__, reg );
emit_1ub(p, 0xff);
emit_modrm_noreg(p, 2, reg);
}
*/
void x86_mov_reg_imm( struct x86_function *p, struct x86_reg dst, int imm )
{
+ DUMP_RI( __FUNCTION__, dst, imm );
assert(dst.mod == mod_REG);
emit_1ub(p, 0xb8 + dst.idx);
emit_1i(p, imm);
void x86_push( struct x86_function *p,
struct x86_reg reg )
{
+ DUMP_R( __FUNCTION__, reg );
assert(reg.mod == mod_REG);
emit_1ub(p, 0x50 + reg.idx);
p->stack_offset += 4;
void x86_pop( struct x86_function *p,
struct x86_reg reg )
{
+ DUMP_R( __FUNCTION__, reg );
assert(reg.mod == mod_REG);
emit_1ub(p, 0x58 + reg.idx);
p->stack_offset -= 4;
void x86_inc( struct x86_function *p,
struct x86_reg reg )
{
+ DUMP_R( __FUNCTION__, reg );
assert(reg.mod == mod_REG);
emit_1ub(p, 0x40 + reg.idx);
}
void x86_dec( struct x86_function *p,
struct x86_reg reg )
{
+ DUMP_R( __FUNCTION__, reg );
assert(reg.mod == mod_REG);
emit_1ub(p, 0x48 + reg.idx);
}
void x86_ret( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_1ub(p, 0xc3);
}
void x86_sahf( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_1ub(p, 0x9e);
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_op_modrm( p, 0x8b, 0x89, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_op_modrm( p, 0x33, 0x31, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_op_modrm( p, 0x3b, 0x39, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_1ub(p, 0x8d);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_1ub(p, 0x85);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_op_modrm(p, 0x03, 0x01, dst, src );
}
void x86_mul( struct x86_function *p,
struct x86_reg src )
{
+ DUMP_R( __FUNCTION__, src );
emit_1ub(p, 0xf7);
emit_modrm_noreg(p, 4, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_2ub(p, X86_TWOB, 0xAF);
emit_modrm(p, dst, src);
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_op_modrm(p, 0x2b, 0x29, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_op_modrm( p, 0x0b, 0x09, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_op_modrm( p, 0x23, 0x21, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_2ub(p, 0xF3, X86_TWOB);
emit_op_modrm( p, 0x10, 0x11, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_1ub(p, X86_TWOB);
emit_op_modrm( p, 0x28, 0x29, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_1ub(p, X86_TWOB);
emit_op_modrm( p, 0x10, 0x11, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
assert(dst.mod != mod_REG || src.mod != mod_REG);
emit_1ub(p, X86_TWOB);
emit_op_modrm( p, 0x16, 0x17, dst, src ); /* cf movlhps */
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
assert(dst.mod != mod_REG || src.mod != mod_REG);
emit_1ub(p, X86_TWOB);
emit_op_modrm( p, 0x12, 0x13, dst, src ); /* cf movhlps */
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_2ub(p, X86_TWOB, 0x5F);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_3ub(p, 0xF3, X86_TWOB, 0x5F);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_3ub(p, 0xF3, X86_TWOB, 0x5E);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_2ub(p, X86_TWOB, 0x5D);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_2ub(p, X86_TWOB, 0x5C);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_2ub(p, X86_TWOB, 0x59);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_3ub(p, 0xF3, X86_TWOB, 0x59);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_2ub(p, X86_TWOB, 0x58);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_3ub(p, 0xF3, X86_TWOB, 0x58);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_2ub(p, X86_TWOB, 0x55);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_2ub(p, X86_TWOB, 0x54);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_2ub(p, X86_TWOB, 0x52);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_3ub(p, 0xF3, X86_TWOB, 0x52);
emit_modrm( p, dst, src );
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
assert(dst.mod == mod_REG && src.mod == mod_REG);
emit_2ub(p, X86_TWOB, 0x12);
emit_modrm( p, dst, src );
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
assert(dst.mod == mod_REG && src.mod == mod_REG);
emit_2ub(p, X86_TWOB, 0x16);
emit_modrm( p, dst, src );
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_2ub(p, X86_TWOB, 0x56);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_2ub(p, X86_TWOB, 0x57);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
assert(dst.file == file_MMX &&
(src.file == file_XMM || src.mod != mod_REG));
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_2ub(p, X86_TWOB, 0x5b);
emit_modrm( p, dst, src );
}
* arg0.
*/
void sse_shufps( struct x86_function *p,
- struct x86_reg dest,
- struct x86_reg arg0,
+ struct x86_reg dst,
+ struct x86_reg src,
unsigned char shuf)
{
+ DUMP_RRI( __FUNCTION__, dst, src, shuf );
emit_2ub(p, X86_TWOB, 0xC6);
- emit_modrm(p, dest, arg0);
+ emit_modrm(p, dst, src);
emit_1ub(p, shuf);
}
void sse_cmpps( struct x86_function *p,
- struct x86_reg dest,
- struct x86_reg arg0,
+ struct x86_reg dst,
+ struct x86_reg src,
unsigned char cc)
{
+ DUMP_RRI( "CMPPS", dst, src, cc );
emit_2ub(p, X86_TWOB, 0xC2);
- emit_modrm(p, dest, arg0);
+ emit_modrm(p, dst, src);
emit_1ub(p, cc);
}
void sse_pmovmskb( struct x86_function *p,
- struct x86_reg dest,
+ struct x86_reg dst,
struct x86_reg src)
{
- emit_3ub(p, 0x66, X86_TWOB, 0xD7);
- emit_modrm(p, dest, src);
+ DUMP_RR( __FUNCTION__, dst, src );
+ emit_3ub(p, 0x66, X86_TWOB, 0xD7);
+ emit_modrm(p, dst, src);
}
/***********************************************************************
* Perform a reduced swizzle:
*/
void sse2_pshufd( struct x86_function *p,
- struct x86_reg dest,
- struct x86_reg arg0,
+ struct x86_reg dst,
+ struct x86_reg src,
unsigned char shuf)
{
+ DUMP_RRI( __FUNCTION__, dst, src, shuf );
emit_3ub(p, 0x66, X86_TWOB, 0x70);
- emit_modrm(p, dest, arg0);
+ emit_modrm(p, dst, src);
emit_1ub(p, shuf);
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_3ub( p, 0xF3, X86_TWOB, 0x5B );
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_3ub(p, 0x66, X86_TWOB, 0x5B);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_3ub(p, 0x66, X86_TWOB, 0x6B);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_3ub(p, 0x66, X86_TWOB, 0x63);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_3ub(p, 0x66, X86_TWOB, 0x67);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_3ub(p, 0x66, X86_TWOB, 0x60);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_2ub(p, X86_TWOB, 0x53);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_3ub(p, 0xF3, X86_TWOB, 0x53);
emit_modrm( p, dst, src );
}
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
emit_2ub(p, 0x66, X86_TWOB);
emit_op_modrm( p, 0x6e, 0x7e, dst, src );
}
*/
void x87_fist( struct x86_function *p, struct x86_reg dst )
{
+ DUMP_R( __FUNCTION__, dst );
emit_1ub(p, 0xdb);
emit_modrm_noreg(p, 2, dst);
}
void x87_fistp( struct x86_function *p, struct x86_reg dst )
{
+ DUMP_R( __FUNCTION__, dst );
emit_1ub(p, 0xdb);
emit_modrm_noreg(p, 3, dst);
}
void x87_fild( struct x86_function *p, struct x86_reg arg )
{
+ DUMP_R( __FUNCTION__, arg );
emit_1ub(p, 0xdf);
emit_modrm_noreg(p, 0, arg);
}
void x87_fldz( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xd9, 0xee);
}
void x87_fldcw( struct x86_function *p, struct x86_reg arg )
{
+ DUMP_R( __FUNCTION__, arg );
assert(arg.file == file_REG32);
assert(arg.mod != mod_REG);
emit_1ub(p, 0xd9);
void x87_fld1( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xd9, 0xe8);
}
void x87_fldl2e( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xd9, 0xea);
}
void x87_fldln2( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xd9, 0xed);
}
void x87_fwait( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_1ub(p, 0x9b);
}
void x87_fnclex( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xdb, 0xe2);
}
assert(0);
}
-void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
+void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg src )
{
- x87_arith_op(p, dst, arg,
+ DUMP_RR( __FUNCTION__, dst, src );
+ x87_arith_op(p, dst, src,
0xd8, 0xc8,
0xdc, 0xc8,
4);
}
-void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
+void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg src )
{
- x87_arith_op(p, dst, arg,
+ DUMP_RR( __FUNCTION__, dst, src );
+ x87_arith_op(p, dst, src,
0xd8, 0xe0,
0xdc, 0xe8,
4);
}
-void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
+void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg src )
{
- x87_arith_op(p, dst, arg,
+ DUMP_RR( __FUNCTION__, dst, src );
+ x87_arith_op(p, dst, src,
0xd8, 0xe8,
0xdc, 0xe0,
5);
}
-void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
+void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg src )
{
- x87_arith_op(p, dst, arg,
+ DUMP_RR( __FUNCTION__, dst, src );
+ x87_arith_op(p, dst, src,
0xd8, 0xc0,
0xdc, 0xc0,
0);
}
-void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
+void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg src )
{
- x87_arith_op(p, dst, arg,
+ DUMP_RR( __FUNCTION__, dst, src );
+ x87_arith_op(p, dst, src,
0xd8, 0xf0,
0xdc, 0xf8,
6);
}
-void x87_fdivr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg )
+void x87_fdivr( struct x86_function *p, struct x86_reg dst, struct x86_reg src )
{
- x87_arith_op(p, dst, arg,
+ DUMP_RR( __FUNCTION__, dst, src );
+ x87_arith_op(p, dst, src,
0xd8, 0xf8,
0xdc, 0xf0,
7);
void x87_fmulp( struct x86_function *p, struct x86_reg dst )
{
+ DUMP_R( __FUNCTION__, dst );
assert(dst.file == file_x87);
assert(dst.idx >= 1);
emit_2ub(p, 0xde, 0xc8+dst.idx);
void x87_fsubp( struct x86_function *p, struct x86_reg dst )
{
+ DUMP_R( __FUNCTION__, dst );
assert(dst.file == file_x87);
assert(dst.idx >= 1);
emit_2ub(p, 0xde, 0xe8+dst.idx);
void x87_fsubrp( struct x86_function *p, struct x86_reg dst )
{
+ DUMP_R( __FUNCTION__, dst );
assert(dst.file == file_x87);
assert(dst.idx >= 1);
emit_2ub(p, 0xde, 0xe0+dst.idx);
void x87_faddp( struct x86_function *p, struct x86_reg dst )
{
+ DUMP_R( __FUNCTION__, dst );
assert(dst.file == file_x87);
assert(dst.idx >= 1);
emit_2ub(p, 0xde, 0xc0+dst.idx);
void x87_fdivp( struct x86_function *p, struct x86_reg dst )
{
+ DUMP_R( __FUNCTION__, dst );
assert(dst.file == file_x87);
assert(dst.idx >= 1);
emit_2ub(p, 0xde, 0xf8+dst.idx);
void x87_fdivrp( struct x86_function *p, struct x86_reg dst )
{
+ DUMP_R( __FUNCTION__, dst );
assert(dst.file == file_x87);
assert(dst.idx >= 1);
emit_2ub(p, 0xde, 0xf0+dst.idx);
void x87_fucom( struct x86_function *p, struct x86_reg arg )
{
+ DUMP_R( __FUNCTION__, arg );
assert(arg.file == file_x87);
emit_2ub(p, 0xdd, 0xe0+arg.idx);
}
void x87_fucomp( struct x86_function *p, struct x86_reg arg )
{
+ DUMP_R( __FUNCTION__, arg );
assert(arg.file == file_x87);
emit_2ub(p, 0xdd, 0xe8+arg.idx);
}
void x87_fucompp( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xda, 0xe9);
}
void x87_fxch( struct x86_function *p, struct x86_reg arg )
{
+ DUMP_R( __FUNCTION__, arg );
assert(arg.file == file_x87);
emit_2ub(p, 0xd9, 0xc8+arg.idx);
}
void x87_fabs( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xd9, 0xe1);
}
void x87_fchs( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xd9, 0xe0);
}
void x87_fcos( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xd9, 0xff);
}
void x87_fprndint( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xd9, 0xfc);
}
void x87_fscale( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xd9, 0xfd);
}
void x87_fsin( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xd9, 0xfe);
}
void x87_fsincos( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xd9, 0xfb);
}
void x87_fsqrt( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xd9, 0xfa);
}
void x87_fxtract( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xd9, 0xf4);
}
*/
void x87_f2xm1( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xd9, 0xf0);
}
*/
void x87_fyl2x( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xd9, 0xf1);
}
*/
void x87_fyl2xp1( struct x86_function *p )
{
+ DUMP( __FUNCTION__ );
emit_2ub(p, 0xd9, 0xf9);
}
void x87_fld( struct x86_function *p, struct x86_reg arg )
{
+ DUMP_R( __FUNCTION__, arg );
if (arg.file == file_x87)
emit_2ub(p, 0xd9, 0xc0 + arg.idx);
else {
void x87_fst( struct x86_function *p, struct x86_reg dst )
{
+ DUMP_R( __FUNCTION__, dst );
if (dst.file == file_x87)
emit_2ub(p, 0xdd, 0xd0 + dst.idx);
else {
void x87_fstp( struct x86_function *p, struct x86_reg dst )
{
+ DUMP_R( __FUNCTION__, dst );
if (dst.file == file_x87)
emit_2ub(p, 0xdd, 0xd8 + dst.idx);
else {
void x87_fcom( struct x86_function *p, struct x86_reg dst )
{
+ DUMP_R( __FUNCTION__, dst );
if (dst.file == file_x87)
emit_2ub(p, 0xd8, 0xd0 + dst.idx);
else {
void x87_fcomp( struct x86_function *p, struct x86_reg dst )
{
+ DUMP_R( __FUNCTION__, dst );
if (dst.file == file_x87)
emit_2ub(p, 0xd8, 0xd8 + dst.idx);
else {
void x87_fnstsw( struct x86_function *p, struct x86_reg dst )
{
+ DUMP_R( __FUNCTION__, dst );
assert(dst.file == file_REG32);
if (dst.idx == reg_AX &&
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
assert(dst.file == file_MMX &&
(src.file == file_MMX || src.mod != mod_REG));
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
assert(dst.file == file_MMX &&
(src.file == file_MMX || src.mod != mod_REG));
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
p->need_emms = 1;
emit_1ub(p, X86_TWOB);
emit_op_modrm( p, 0x6e, 0x7e, dst, src );
struct x86_reg dst,
struct x86_reg src )
{
+ DUMP_RR( __FUNCTION__, dst, src );
p->need_emms = 1;
emit_1ub(p, X86_TWOB);
emit_op_modrm( p, 0x6f, 0x7f, dst, src );