#define DISASSEM 0
#define X86_TWOB 0x0f
-static unsigned char *cptr( void (*label)() )
-{
- return (unsigned char *) label;
-}
-
static void do_realloc( struct x86_function *p )
{
}
#if 0
+static unsigned char *cptr( void (*label)() )
+{
+ return (unsigned char *) label;
+}
+
/* This doesn't work once we start reallocating & copying the
* generated code on buffer fills, because the call is relative to the
* current pc.
emit_op_modrm(p, 0x03, 0x01, dst, src );
}
+/* Calculate EAX * src, results in EDX:EAX.
+ */
void x86_mul( struct x86_function *p,
struct x86_reg src )
{
- assert (src.file == file_REG32 && src.mod == mod_REG);
- emit_op_modrm(p, 0xf7, 0, x86_make_reg (file_REG32, reg_SP), src );
+// assert (src.file == file_REG32 && src.mod == mod_REG);
+ emit_1ub(p, 0xf7);
+ emit_modrm_noreg(p, 4, src );
}
void x86_sub( struct x86_function *p,
emit_modrm( p, dst, src );
}
+void sse2_cvtdq2ps( struct x86_function *p,
+ struct x86_reg dst,
+ struct x86_reg src )
+{
+ emit_2ub(p, X86_TWOB, 0x5b);
+ emit_modrm( p, dst, src );
+}
+
/* Shufps can also be used to implement a reduced swizzle when dest ==
* arg0.
emit_modrm( p, dst, src );
}
+void sse2_punpcklbw( struct x86_function *p,
+ struct x86_reg dst,
+ struct x86_reg src )
+{
+ emit_3ub(p, 0x66, X86_TWOB, 0x60);
+ emit_modrm( p, dst, src );
+}
+
+
void sse2_rcpps( struct x86_function *p,
struct x86_reg dst,
struct x86_reg src )
void sse2_cvtps2dq( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
void sse2_cvttps2dq( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
+void sse2_cvtdq2ps( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
void sse2_movd( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
void sse2_packssdw( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
void sse2_packsswb( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
void sse_shufps( struct x86_function *p, struct x86_reg dest, struct x86_reg arg0,
unsigned char shuf );
void sse_pmovmskb( struct x86_function *p, struct x86_reg dest, struct x86_reg src );
+void sse2_punpcklbw( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
void x86_add( struct x86_function *p, struct x86_reg dst, struct x86_reg src );
void x86_and( struct x86_function *p, struct x86_reg dst, struct x86_reg src );