Index: qemu/target-i386/op.c
===================================================================
--- qemu.orig/target-i386/op.c	2008-03-19 18:26:29.000000000 +0000
+++ qemu/target-i386/op.c	2008-03-19 18:28:13.000000000 +0000
@@ -2222,12 +2222,6 @@
     *(uint32_t *)(env->fptags + 4) = 0x01010101;
 }
 
-#define SHIFT 0
-#include "ops_sse.h"
-
-#define SHIFT 1
-#include "ops_sse.h"
-
 /* Secure Virtual Machine ops */
 
 void OPPROTO op_vmrun(void)
Index: qemu/target-i386/translate.c
===================================================================
--- qemu.orig/target-i386/translate.c	2008-03-19 18:26:29.000000000 +0000
+++ qemu/target-i386/translate.c	2008-03-19 19:04:31.000000000 +0000
@@ -2409,18 +2409,18 @@
 
 #define SSE_SPECIAL ((GenOpFunc2 *)1)
 
-#define MMX_OP2(x) { gen_op_ ## x ## _mmx, gen_op_ ## x ## _xmm }
-#define SSE_FOP(x) { gen_op_ ## x ## ps, gen_op_ ## x ## pd, \
-                     gen_op_ ## x ## ss, gen_op_ ## x ## sd, }
+#define MMX_OP2(x) { helper_ ## x ## _mmx, helper_ ## x ## _xmm }
+#define SSE_FOP(x) { helper_ ## x ## ps, helper_ ## x ## pd, \
+                     helper_ ## x ## ss, helper_ ## x ## sd, }
 
-static GenOpFunc2 *sse_op_table1[256][4] = {
+static void *sse_op_table1[256][4] = {
     /* pure SSE operations */
     [0x10] = { SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL }, /* movups, movupd, movss, movsd */
     [0x11] = { SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL }, /* movups, movupd, movss, movsd */
     [0x12] = { SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL }, /* movlps, movlpd, movsldup, movddup */
     [0x13] = { SSE_SPECIAL, SSE_SPECIAL },  /* movlps, movlpd */
-    [0x14] = { gen_op_punpckldq_xmm, gen_op_punpcklqdq_xmm },
-    [0x15] = { gen_op_punpckhdq_xmm, gen_op_punpckhqdq_xmm },
+    [0x14] = { helper_punpckldq_xmm, helper_punpcklqdq_xmm },
+    [0x15] = { helper_punpckhdq_xmm, helper_punpckhqdq_xmm },
     [0x16] = { SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL },  /* movhps, movhpd, movshdup */
     [0x17] = { SSE_SPECIAL, SSE_SPECIAL },  /* movhps, movhpd */
 
@@ -2430,28 +2430,28 @@
     [0x2b] = { SSE_SPECIAL, SSE_SPECIAL },  /* movntps, movntpd */
     [0x2c] = { SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL }, /* cvttps2pi, cvttpd2pi, cvttsd2si, cvttss2si */
     [0x2d] = { SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL }, /* cvtps2pi, cvtpd2pi, cvtsd2si, cvtss2si */
-    [0x2e] = { gen_op_ucomiss, gen_op_ucomisd },
-    [0x2f] = { gen_op_comiss, gen_op_comisd },
+    [0x2e] = { helper_ucomiss, helper_ucomisd },
+    [0x2f] = { helper_comiss, helper_comisd },
     [0x50] = { SSE_SPECIAL, SSE_SPECIAL }, /* movmskps, movmskpd */
     [0x51] = SSE_FOP(sqrt),
-    [0x52] = { gen_op_rsqrtps, NULL, gen_op_rsqrtss, NULL },
-    [0x53] = { gen_op_rcpps, NULL, gen_op_rcpss, NULL },
-    [0x54] = { gen_op_pand_xmm, gen_op_pand_xmm }, /* andps, andpd */
-    [0x55] = { gen_op_pandn_xmm, gen_op_pandn_xmm }, /* andnps, andnpd */
-    [0x56] = { gen_op_por_xmm, gen_op_por_xmm }, /* orps, orpd */
-    [0x57] = { gen_op_pxor_xmm, gen_op_pxor_xmm }, /* xorps, xorpd */
+    [0x52] = { helper_rsqrtps, NULL, helper_rsqrtss, NULL },
+    [0x53] = { helper_rcpps, NULL, helper_rcpss, NULL },
+    [0x54] = { helper_pand_xmm, helper_pand_xmm }, /* andps, andpd */
+    [0x55] = { helper_pandn_xmm, helper_pandn_xmm }, /* andnps, andnpd */
+    [0x56] = { helper_por_xmm, helper_por_xmm }, /* orps, orpd */
+    [0x57] = { helper_pxor_xmm, helper_pxor_xmm }, /* xorps, xorpd */
     [0x58] = SSE_FOP(add),
     [0x59] = SSE_FOP(mul),
-    [0x5a] = { gen_op_cvtps2pd, gen_op_cvtpd2ps,
-               gen_op_cvtss2sd, gen_op_cvtsd2ss },
-    [0x5b] = { gen_op_cvtdq2ps, gen_op_cvtps2dq, gen_op_cvttps2dq },
+    [0x5a] = { helper_cvtps2pd, helper_cvtpd2ps,
+               helper_cvtss2sd, helper_cvtsd2ss },
+    [0x5b] = { helper_cvtdq2ps, helper_cvtps2dq, helper_cvttps2dq },
     [0x5c] = SSE_FOP(sub),
     [0x5d] = SSE_FOP(min),
     [0x5e] = SSE_FOP(div),
     [0x5f] = SSE_FOP(max),
 
     [0xc2] = SSE_FOP(cmpeq),
-    [0xc6] = { (GenOpFunc2 *)gen_op_shufps, (GenOpFunc2 *)gen_op_shufpd },
+    [0xc6] = { helper_shufps, helper_shufpd },
 
     /* MMX ops and their SSE extensions */
     [0x60] = MMX_OP2(punpcklbw),
@@ -2466,14 +2466,14 @@
     [0x69] = MMX_OP2(punpckhwd),
     [0x6a] = MMX_OP2(punpckhdq),
     [0x6b] = MMX_OP2(packssdw),
-    [0x6c] = { NULL, gen_op_punpcklqdq_xmm },
-    [0x6d] = { NULL, gen_op_punpckhqdq_xmm },
+    [0x6c] = { NULL, helper_punpcklqdq_xmm },
+    [0x6d] = { NULL, helper_punpckhqdq_xmm },
     [0x6e] = { SSE_SPECIAL, SSE_SPECIAL }, /* movd mm, ea */
     [0x6f] = { SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL }, /* movq, movdqa, , movqdu */
-    [0x70] = { (GenOpFunc2 *)gen_op_pshufw_mmx,
-               (GenOpFunc2 *)gen_op_pshufd_xmm,
-               (GenOpFunc2 *)gen_op_pshufhw_xmm,
-               (GenOpFunc2 *)gen_op_pshuflw_xmm },
+    [0x70] = { helper_pshufw_mmx,
+               helper_pshufd_xmm,
+               helper_pshufhw_xmm,
+               helper_pshuflw_xmm },
     [0x71] = { SSE_SPECIAL, SSE_SPECIAL }, /* shiftw */
     [0x72] = { SSE_SPECIAL, SSE_SPECIAL }, /* shiftd */
     [0x73] = { SSE_SPECIAL, SSE_SPECIAL }, /* shiftq */
@@ -2481,13 +2481,13 @@
     [0x75] = MMX_OP2(pcmpeqw),
     [0x76] = MMX_OP2(pcmpeql),
     [0x77] = { SSE_SPECIAL }, /* emms */
-    [0x7c] = { NULL, gen_op_haddpd, NULL, gen_op_haddps },
-    [0x7d] = { NULL, gen_op_hsubpd, NULL, gen_op_hsubps },
+    [0x7c] = { NULL, helper_haddpd, NULL, helper_haddps },
+    [0x7d] = { NULL, helper_hsubpd, NULL, helper_hsubps },
     [0x7e] = { SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL }, /* movd, movd, , movq */
     [0x7f] = { SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL }, /* movq, movdqa, movdqu */
     [0xc4] = { SSE_SPECIAL, SSE_SPECIAL }, /* pinsrw */
     [0xc5] = { SSE_SPECIAL, SSE_SPECIAL }, /* pextrw */
-    [0xd0] = { NULL, gen_op_addsubpd, NULL, gen_op_addsubps },
+    [0xd0] = { NULL, helper_addsubpd, NULL, helper_addsubps },
     [0xd1] = MMX_OP2(psrlw),
     [0xd2] = MMX_OP2(psrld),
     [0xd3] = MMX_OP2(psrlq),
@@ -2509,7 +2509,7 @@
     [0xe3] = MMX_OP2(pavgw),
     [0xe4] = MMX_OP2(pmulhuw),
     [0xe5] = MMX_OP2(pmulhw),
-    [0xe6] = { NULL, gen_op_cvttpd2dq, gen_op_cvtdq2pd, gen_op_cvtpd2dq },
+    [0xe6] = { NULL, helper_cvttpd2dq, helper_cvtdq2pd, helper_cvtpd2dq },
     [0xe7] = { SSE_SPECIAL , SSE_SPECIAL },  /* movntq, movntq */
     [0xe8] = MMX_OP2(psubsb),
     [0xe9] = MMX_OP2(psubsw),
@@ -2536,7 +2536,7 @@
     [0xfe] = MMX_OP2(paddl),
 };
 
-static GenOpFunc2 *sse_op_table2[3 * 8][2] = {
+static void *sse_op_table2[3 * 8][2] = {
     [0 + 2] = MMX_OP2(psrlw),
     [0 + 4] = MMX_OP2(psraw),
     [0 + 6] = MMX_OP2(psllw),
@@ -2544,29 +2544,29 @@
     [8 + 4] = MMX_OP2(psrad),
     [8 + 6] = MMX_OP2(pslld),
     [16 + 2] = MMX_OP2(psrlq),
-    [16 + 3] = { NULL, gen_op_psrldq_xmm },
+    [16 + 3] = { NULL, helper_psrldq_xmm },
     [16 + 6] = MMX_OP2(psllq),
-    [16 + 7] = { NULL, gen_op_pslldq_xmm },
+    [16 + 7] = { NULL, helper_pslldq_xmm },
 };
 
-static GenOpFunc1 *sse_op_table3[4 * 3] = {
-    gen_op_cvtsi2ss,
-    gen_op_cvtsi2sd,
-    X86_64_ONLY(gen_op_cvtsq2ss),
-    X86_64_ONLY(gen_op_cvtsq2sd),
-
-    gen_op_cvttss2si,
-    gen_op_cvttsd2si,
-    X86_64_ONLY(gen_op_cvttss2sq),
-    X86_64_ONLY(gen_op_cvttsd2sq),
-
-    gen_op_cvtss2si,
-    gen_op_cvtsd2si,
-    X86_64_ONLY(gen_op_cvtss2sq),
-    X86_64_ONLY(gen_op_cvtsd2sq),
+static void *sse_op_table3[4 * 3] = {
+    helper_cvtsi2ss,
+    helper_cvtsi2sd,
+    X86_64_ONLY(helper_cvtsq2ss),
+    X86_64_ONLY(helper_cvtsq2sd),
+
+    helper_cvttss2si,
+    helper_cvttsd2si,
+    X86_64_ONLY(helper_cvttss2sq),
+    X86_64_ONLY(helper_cvttsd2sq),
+
+    helper_cvtss2si,
+    helper_cvtsd2si,
+    X86_64_ONLY(helper_cvtss2sq),
+    X86_64_ONLY(helper_cvtsd2sq),
 };
 
-static GenOpFunc2 *sse_op_table4[8][4] = {
+static void *sse_op_table4[8][4] = {
     SSE_FOP(cmpeq),
     SSE_FOP(cmplt),
     SSE_FOP(cmple),
@@ -2661,19 +2661,25 @@
 #endif
             {
                 gen_ldst_modrm(s, modrm, OT_LONG, OR_TMP0, 0);
-                gen_op_movl_mm_T0_mmx(offsetof(CPUX86State,fpregs[reg].mmx));
+                tcg_gen_helper_0_2(helper_movl_mm_T0_mmx,
+                                   offsetof(CPUX86State,fpregs[reg].mmx),
+                                   cpu_T[0]);
             }
             break;
         case 0x16e: /* movd xmm, ea */
 #ifdef TARGET_X86_64
             if (s->dflag == 2) {
                 gen_ldst_modrm(s, modrm, OT_QUAD, OR_TMP0, 0);
-                gen_op_movq_mm_T0_xmm(offsetof(CPUX86State,xmm_regs[reg]));
+                tcg_gen_helper_0_2(helper_movq_mm_T0_xmm,
+                                   offsetof(CPUX86State,xmm_regs[reg]),
+                                   cpu_T[0]);
             } else
 #endif
             {
                 gen_ldst_modrm(s, modrm, OT_LONG, OR_TMP0, 0);
-                gen_op_movl_mm_T0_xmm(offsetof(CPUX86State,xmm_regs[reg]));
+                tcg_gen_helper_0_2(helper_movl_mm_T0_xmm,
+                                   offsetof(CPUX86State,xmm_regs[reg]),
+                                   cpu_T[0]);
             }
             break;
         case 0x6f: /* movq mm, ea */
@@ -2805,19 +2811,22 @@
             } else
 #endif
             {
-                gen_op_movl_T0_mm_mmx(offsetof(CPUX86State,fpregs[reg].mmx));
+                tcg_gen_helper_1_1(helper_movl_T0_mm_mmx, cpu_T[0],
+                                   offsetof(CPUX86State,fpregs[reg].mmx));
                 gen_ldst_modrm(s, modrm, OT_LONG, OR_TMP0, 1);
             }
             break;
         case 0x17e: /* movd ea, xmm */
 #ifdef TARGET_X86_64
             if (s->dflag == 2) {
-                gen_op_movq_T0_mm_xmm(offsetof(CPUX86State,xmm_regs[reg]));
+                tcg_gen_helper_1_1(helper_movq_T0_mm_xmm, cpu_T[0],
+                                   offsetof(CPUX86State,xmm_regs[reg]));
                 gen_ldst_modrm(s, modrm, OT_QUAD, OR_TMP0, 1);
             } else
 #endif
             {
-                gen_op_movl_T0_mm_xmm(offsetof(CPUX86State,xmm_regs[reg]));
+                tcg_gen_helper_1_1(helper_movl_T0_mm_xmm, cpu_T[0],
+                                   offsetof(CPUX86State,xmm_regs[reg]));
                 gen_ldst_modrm(s, modrm, OT_LONG, OR_TMP0, 1);
             }
             break;
@@ -2926,16 +2935,19 @@
                 rm = (modrm & 7);
                 op2_offset = offsetof(CPUX86State,fpregs[rm].mmx);
             }
-            sse_op2(op2_offset, op1_offset);
+            tcg_gen_helper_0_2(sse_op2, tcg_const_i32(op2_offset),
+                               tcg_const_i32(op1_offset));
             break;
         case 0x050: /* movmskps */
             rm = (modrm & 7) | REX_B(s);
-            gen_op_movmskps(offsetof(CPUX86State,xmm_regs[rm]));
+            tcg_gen_helper_1_1(helper_movmskps, cpu_T[0],
+                               offsetof(CPUX86State,xmm_regs[rm]));
             gen_op_mov_reg_T0(OT_LONG, reg);
             break;
         case 0x150: /* movmskpd */
             rm = (modrm & 7) | REX_B(s);
-            gen_op_movmskpd(offsetof(CPUX86State,xmm_regs[rm]));
+            tcg_gen_helper_1_1(helper_movmskpd, cpu_T[0],
+                               offsetof(CPUX86State,xmm_regs[rm]));
             gen_op_mov_reg_T0(OT_LONG, reg);
             break;
         case 0x02a: /* cvtpi2ps */
@@ -2952,11 +2964,11 @@
             op1_offset = offsetof(CPUX86State,xmm_regs[reg]);
             switch(b >> 8) {
             case 0x0:
-                gen_op_cvtpi2ps(op1_offset, op2_offset);
+                tcg_gen_helper_0_2(helper_cvtpi2ps, op1_offset, op2_offset);
                 break;
             default:
             case 0x1:
-                gen_op_cvtpi2pd(op1_offset, op2_offset);
+                tcg_gen_helper_0_2(helper_cvtpi2pd, op1_offset, op2_offset);
                 break;
             }
             break;
@@ -2965,7 +2977,9 @@
             ot = (s->dflag == 2) ? OT_QUAD : OT_LONG;
             gen_ldst_modrm(s, modrm, ot, OR_TMP0, 0);
             op1_offset = offsetof(CPUX86State,xmm_regs[reg]);
-            sse_op_table3[(s->dflag == 2) * 2 + ((b >> 8) - 2)](op1_offset);
+            tcg_gen_helper_0_2(sse_op_table3[(s->dflag == 2) * 2 +
+                                             ((b >> 8) - 2)],
+                               op1_offset, cpu_T[0]);
             break;
         case 0x02c: /* cvttps2pi */
         case 0x12c: /* cvttpd2pi */
@@ -2983,16 +2997,16 @@
             op1_offset = offsetof(CPUX86State,fpregs[reg & 7].mmx);
             switch(b) {
             case 0x02c:
-                gen_op_cvttps2pi(op1_offset, op2_offset);
+                tcg_gen_helper_0_2(helper_cvttps2pi, op1_offset, op2_offset);
                 break;
             case 0x12c:
-                gen_op_cvttpd2pi(op1_offset, op2_offset);
+                tcg_gen_helper_0_2(helper_cvttpd2pi, op1_offset, op2_offset);
                 break;
             case 0x02d:
-                gen_op_cvtps2pi(op1_offset, op2_offset);
+                tcg_gen_helper_0_2(helper_cvtps2pi, op1_offset, op2_offset);
                 break;
             case 0x12d:
-                gen_op_cvtpd2pi(op1_offset, op2_offset);
+                tcg_gen_helper_0_2(helper_cvtpd2pi, op1_offset, op2_offset);
                 break;
             }
             break;
@@ -3014,8 +3028,8 @@
                 rm = (modrm & 7) | REX_B(s);
                 op2_offset = offsetof(CPUX86State,xmm_regs[rm]);
             }
-            sse_op_table3[(s->dflag == 2) * 2 + ((b >> 8) - 2) + 4 +
-                          (b & 1) * 4](op2_offset);
+            tcg_gen_helper_0_2(sse_op_table3[(s->dflag == 2) * 2 + ((b >> 8) - 2) + 4 +
+                                             (b & 1) * 4], op2_offset, cpu_T[0]);
             gen_op_mov_reg_T0(ot, reg);
             break;
         case 0xc4: /* pinsrw */
@@ -3025,10 +3039,14 @@
             val = ldub_code(s->pc++);
             if (b1) {
                 val &= 7;
-                gen_op_pinsrw_xmm(offsetof(CPUX86State,xmm_regs[reg]), val);
+                tcg_gen_helper_0_3(helper_pinsrw_xmm,
+                                   offsetof(CPUX86State,xmm_regs[reg]), val,
+                                   cpu_T[0]);
             } else {
                 val &= 3;
-                gen_op_pinsrw_mmx(offsetof(CPUX86State,fpregs[reg].mmx), val);
+                tcg_gen_helper_0_3(helper_pinsrw_mmx,
+                                   offsetof(CPUX86State,fpregs[reg].mmx), val,
+                                   cpu_T[0]);
             }
             break;
         case 0xc5: /* pextrw */
@@ -3039,11 +3057,13 @@
             if (b1) {
                 val &= 7;
                 rm = (modrm & 7) | REX_B(s);
-                gen_op_pextrw_xmm(offsetof(CPUX86State,xmm_regs[rm]), val);
+                tcg_gen_helper_1_2(helper_pextrw_xmm, cpu_T[0],
+                                   offsetof(CPUX86State,xmm_regs[rm]), val);
             } else {
                 val &= 3;
                 rm = (modrm & 7);
-                gen_op_pextrw_mmx(offsetof(CPUX86State,fpregs[rm].mmx), val);
+                tcg_gen_helper_1_2(helper_pextrw_mmx, cpu_T[0],
+                                   offsetof(CPUX86State,fpregs[rm].mmx), val);
             }
             reg = ((modrm >> 3) & 7) | rex_r;
             gen_op_mov_reg_T0(OT_LONG, reg);
@@ -3078,10 +3098,12 @@
                 goto illegal_op;
             if (b1) {
                 rm = (modrm & 7) | REX_B(s);
-                gen_op_pmovmskb_xmm(offsetof(CPUX86State,xmm_regs[rm]));
+                tcg_gen_helper_1_1(helper_pmovmskb_xmm, cpu_T[0],
+                                   offsetof(CPUX86State,xmm_regs[rm]));
             } else {
                 rm = (modrm & 7);
-                gen_op_pmovmskb_mmx(offsetof(CPUX86State,fpregs[rm].mmx));
+                tcg_gen_helper_1_1(helper_pmovmskb_mmx, cpu_T[0],
+                                   offsetof(CPUX86State,fpregs[rm].mmx));
             }
             reg = ((modrm >> 3) & 7) | rex_r;
             gen_op_mov_reg_T0(OT_LONG, reg);
@@ -3155,7 +3177,8 @@
         case 0xc6: /* pshufx insn */
             val = ldub_code(s->pc++);
             sse_op3 = (GenOpFunc3 *)sse_op2;
-            sse_op3(op1_offset, op2_offset, val);
+            tcg_gen_helper_0_3(sse_op3, tcg_const_i32(op1_offset),
+                               tcg_const_i32(op2_offset), tcg_const_tl(val));
             break;
         case 0xc2:
             /* compare insns */
@@ -3163,10 +3186,12 @@
             if (val >= 8)
                 goto illegal_op;
             sse_op2 = sse_op_table4[val][b1];
-            sse_op2(op1_offset, op2_offset);
+            tcg_gen_helper_0_2(sse_op2, tcg_const_i32(op1_offset),
+                               tcg_const_i32(op2_offset));
             break;
         default:
-            sse_op2(op1_offset, op2_offset);
+            tcg_gen_helper_0_2(sse_op2, tcg_const_i32(op1_offset),
+                               tcg_const_i32(op2_offset));
             break;
         }
         if (b == 0x2e || b == 0x2f) {
@@ -3175,7 +3200,6 @@
     }
 }
 
-
 /* convert one instruction. s->is_jmp is set if the translation must
    be stopped. Return the next pc value */
 static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
@@ -6427,11 +6451,13 @@
     [INDEX_op_imull_T0_T1] = CC_OSZAPC,
     X86_64_DEF([INDEX_op_imulq_T0_T1] = CC_OSZAPC,)
 
+#if 0
     /* sse */
     [INDEX_op_ucomiss] = CC_OSZAPC,
     [INDEX_op_ucomisd] = CC_OSZAPC,
     [INDEX_op_comiss] = CC_OSZAPC,
     [INDEX_op_comisd] = CC_OSZAPC,
+#endif
 
     /* bcd */
     [INDEX_op_aam] = CC_OSZAPC,
Index: qemu/target-i386/helper.c
===================================================================
--- qemu.orig/target-i386/helper.c	2008-03-19 18:26:29.000000000 +0000
+++ qemu/target-i386/helper.c	2008-03-19 18:28:13.000000000 +0000
@@ -4446,3 +4446,9 @@
 }
 
 #endif
+
+#define SHIFT 0
+#include "ops_sse.h"
+
+#define SHIFT 1
+#include "ops_sse.h"
Index: qemu/target-i386/ops_sse.h
===================================================================
--- qemu.orig/target-i386/ops_sse.h	2008-03-19 18:26:29.000000000 +0000
+++ qemu/target-i386/ops_sse.h	2008-03-19 18:28:13.000000000 +0000
@@ -35,13 +35,13 @@
 #define SUFFIX _xmm
 #endif
 
-void OPPROTO glue(op_psrlw, SUFFIX)(void)
+void glue(helper_psrlw, SUFFIX)(uint32_t dst_offset, uint32_t src_offset)
 {
     Reg *d, *s;
     int shift;
 
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     if (s->Q(0) > 15) {
         d->Q(0) = 0;
@@ -61,16 +61,15 @@
         d->W(7) >>= shift;
 #endif
     }
-    FORCE_RET();
 }
 
-void OPPROTO glue(op_psraw, SUFFIX)(void)
+void glue(helper_psraw, SUFFIX)(uint32_t dst_offset, uint32_t src_offset)
 {
     Reg *d, *s;
     int shift;
 
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     if (s->Q(0) > 15) {
         shift = 15;
@@ -89,13 +88,13 @@
 #endif
 }
 
-void OPPROTO glue(op_psllw, SUFFIX)(void)
+void glue(helper_psllw, SUFFIX)(uint32_t dst_offset, uint32_t src_offset)
 {
     Reg *d, *s;
     int shift;
 
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     if (s->Q(0) > 15) {
         d->Q(0) = 0;
@@ -115,16 +114,15 @@
         d->W(7) <<= shift;
 #endif
     }
-    FORCE_RET();
 }
 
-void OPPROTO glue(op_psrld, SUFFIX)(void)
+void glue(helper_psrld, SUFFIX)(uint32_t dst_offset, uint32_t src_offset)
 {
     Reg *d, *s;
     int shift;
 
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     if (s->Q(0) > 31) {
         d->Q(0) = 0;
@@ -140,16 +138,15 @@
         d->L(3) >>= shift;
 #endif
     }
-    FORCE_RET();
 }
 
-void OPPROTO glue(op_psrad, SUFFIX)(void)
+void glue(helper_psrad, SUFFIX)(uint32_t dst_offset, uint32_t src_offset)
 {
     Reg *d, *s;
     int shift;
 
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     if (s->Q(0) > 31) {
         shift = 31;
@@ -164,13 +161,13 @@
 #endif
 }
 
-void OPPROTO glue(op_pslld, SUFFIX)(void)
+void glue(helper_pslld, SUFFIX)(uint32_t dst_offset, uint32_t src_offset)
 {
     Reg *d, *s;
     int shift;
 
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     if (s->Q(0) > 31) {
         d->Q(0) = 0;
@@ -186,16 +183,15 @@
         d->L(3) <<= shift;
 #endif
     }
-    FORCE_RET();
 }
 
-void OPPROTO glue(op_psrlq, SUFFIX)(void)
+void glue(helper_psrlq, SUFFIX)(uint32_t dst_offset, uint32_t src_offset)
 {
     Reg *d, *s;
     int shift;
 
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     if (s->Q(0) > 63) {
         d->Q(0) = 0;
@@ -209,16 +205,15 @@
         d->Q(1) >>= shift;
 #endif
     }
-    FORCE_RET();
 }
 
-void OPPROTO glue(op_psllq, SUFFIX)(void)
+void glue(helper_psllq, SUFFIX)(uint32_t dst_offset, uint32_t src_offset)
 {
     Reg *d, *s;
     int shift;
 
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     if (s->Q(0) > 63) {
         d->Q(0) = 0;
@@ -232,17 +227,16 @@
         d->Q(1) <<= shift;
 #endif
     }
-    FORCE_RET();
 }
 
 #if SHIFT == 1
-void OPPROTO glue(op_psrldq, SUFFIX)(void)
+void glue(helper_psrldq, SUFFIX)(uint32_t dst_offset, uint32_t src_offset)
 {
     Reg *d, *s;
     int shift, i;
 
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
     shift = s->L(0);
     if (shift > 16)
         shift = 16;
@@ -250,16 +244,15 @@
         d->B(i) = d->B(i + shift);
     for(i = 16 - shift; i < 16; i++)
         d->B(i) = 0;
-    FORCE_RET();
 }
 
-void OPPROTO glue(op_pslldq, SUFFIX)(void)
+void glue(helper_pslldq, SUFFIX)(uint32_t dst_offset, uint32_t src_offset)
 {
     Reg *d, *s;
     int shift, i;
 
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
     shift = s->L(0);
     if (shift > 16)
         shift = 16;
@@ -267,16 +260,15 @@
         d->B(i) = d->B(i - shift);
     for(i = 0; i < shift; i++)
         d->B(i) = 0;
-    FORCE_RET();
 }
 #endif
 
-#define SSE_OP_B(name, F)\
-void OPPROTO glue(name, SUFFIX) (void)\
+#define SSE_HELPER_B(name, F)\
+void glue(name, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)\
 {\
     Reg *d, *s;\
-    d = (Reg *)((char *)env + PARAM1);\
-    s = (Reg *)((char *)env + PARAM2);\
+    d = (Reg *)((char *)env + dst_offset);\
+    s = (Reg *)((char *)env + src_offset);\
     d->B(0) = F(d->B(0), s->B(0));\
     d->B(1) = F(d->B(1), s->B(1));\
     d->B(2) = F(d->B(2), s->B(2));\
@@ -297,12 +289,12 @@
     )\
 }
 
-#define SSE_OP_W(name, F)\
-void OPPROTO glue(name, SUFFIX) (void)\
+#define SSE_HELPER_W(name, F)\
+void glue(name, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)\
 {\
     Reg *d, *s;\
-    d = (Reg *)((char *)env + PARAM1);\
-    s = (Reg *)((char *)env + PARAM2);\
+    d = (Reg *)((char *)env + dst_offset);\
+    s = (Reg *)((char *)env + src_offset);\
     d->W(0) = F(d->W(0), s->W(0));\
     d->W(1) = F(d->W(1), s->W(1));\
     d->W(2) = F(d->W(2), s->W(2));\
@@ -315,12 +307,12 @@
     )\
 }
 
-#define SSE_OP_L(name, F)\
-void OPPROTO glue(name, SUFFIX) (void)\
+#define SSE_HELPER_L(name, F)\
+void glue(name, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)\
 {\
     Reg *d, *s;\
-    d = (Reg *)((char *)env + PARAM1);\
-    s = (Reg *)((char *)env + PARAM2);\
+    d = (Reg *)((char *)env + dst_offset);\
+    s = (Reg *)((char *)env + src_offset);\
     d->L(0) = F(d->L(0), s->L(0));\
     d->L(1) = F(d->L(1), s->L(1));\
     XMM_ONLY(\
@@ -329,12 +321,12 @@
     )\
 }
 
-#define SSE_OP_Q(name, F)\
-void OPPROTO glue(name, SUFFIX) (void)\
+#define SSE_HELPER_Q(name, F)\
+void glue(name, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)\
 {\
     Reg *d, *s;\
-    d = (Reg *)((char *)env + PARAM1);\
-    s = (Reg *)((char *)env + PARAM2);\
+    d = (Reg *)((char *)env + dst_offset);\
+    s = (Reg *)((char *)env + src_offset);\
     d->Q(0) = F(d->Q(0), s->Q(0));\
     XMM_ONLY(\
     d->Q(1) = F(d->Q(1), s->Q(1));\
@@ -415,57 +407,57 @@
 #define FAVG(a, b) ((a) + (b) + 1) >> 1
 #endif
 
-SSE_OP_B(op_paddb, FADD)
-SSE_OP_W(op_paddw, FADD)
-SSE_OP_L(op_paddl, FADD)
-SSE_OP_Q(op_paddq, FADD)
+SSE_HELPER_B(helper_paddb, FADD)
+SSE_HELPER_W(helper_paddw, FADD)
+SSE_HELPER_L(helper_paddl, FADD)
+SSE_HELPER_Q(helper_paddq, FADD)
 
-SSE_OP_B(op_psubb, FSUB)
-SSE_OP_W(op_psubw, FSUB)
-SSE_OP_L(op_psubl, FSUB)
-SSE_OP_Q(op_psubq, FSUB)
+SSE_HELPER_B(helper_psubb, FSUB)
+SSE_HELPER_W(helper_psubw, FSUB)
+SSE_HELPER_L(helper_psubl, FSUB)
+SSE_HELPER_Q(helper_psubq, FSUB)
 
-SSE_OP_B(op_paddusb, FADDUB)
-SSE_OP_B(op_paddsb, FADDSB)
-SSE_OP_B(op_psubusb, FSUBUB)
-SSE_OP_B(op_psubsb, FSUBSB)
+SSE_HELPER_B(helper_paddusb, FADDUB)
+SSE_HELPER_B(helper_paddsb, FADDSB)
+SSE_HELPER_B(helper_psubusb, FSUBUB)
+SSE_HELPER_B(helper_psubsb, FSUBSB)
 
-SSE_OP_W(op_paddusw, FADDUW)
-SSE_OP_W(op_paddsw, FADDSW)
-SSE_OP_W(op_psubusw, FSUBUW)
-SSE_OP_W(op_psubsw, FSUBSW)
+SSE_HELPER_W(helper_paddusw, FADDUW)
+SSE_HELPER_W(helper_paddsw, FADDSW)
+SSE_HELPER_W(helper_psubusw, FSUBUW)
+SSE_HELPER_W(helper_psubsw, FSUBSW)
 
-SSE_OP_B(op_pminub, FMINUB)
-SSE_OP_B(op_pmaxub, FMAXUB)
+SSE_HELPER_B(helper_pminub, FMINUB)
+SSE_HELPER_B(helper_pmaxub, FMAXUB)
 
-SSE_OP_W(op_pminsw, FMINSW)
-SSE_OP_W(op_pmaxsw, FMAXSW)
+SSE_HELPER_W(helper_pminsw, FMINSW)
+SSE_HELPER_W(helper_pmaxsw, FMAXSW)
 
-SSE_OP_Q(op_pand, FAND)
-SSE_OP_Q(op_pandn, FANDN)
-SSE_OP_Q(op_por, FOR)
-SSE_OP_Q(op_pxor, FXOR)
+SSE_HELPER_Q(helper_pand, FAND)
+SSE_HELPER_Q(helper_pandn, FANDN)
+SSE_HELPER_Q(helper_por, FOR)
+SSE_HELPER_Q(helper_pxor, FXOR)
 
-SSE_OP_B(op_pcmpgtb, FCMPGTB)
-SSE_OP_W(op_pcmpgtw, FCMPGTW)
-SSE_OP_L(op_pcmpgtl, FCMPGTL)
+SSE_HELPER_B(helper_pcmpgtb, FCMPGTB)
+SSE_HELPER_W(helper_pcmpgtw, FCMPGTW)
+SSE_HELPER_L(helper_pcmpgtl, FCMPGTL)
 
-SSE_OP_B(op_pcmpeqb, FCMPEQ)
-SSE_OP_W(op_pcmpeqw, FCMPEQ)
-SSE_OP_L(op_pcmpeql, FCMPEQ)
+SSE_HELPER_B(helper_pcmpeqb, FCMPEQ)
+SSE_HELPER_W(helper_pcmpeqw, FCMPEQ)
+SSE_HELPER_L(helper_pcmpeql, FCMPEQ)
 
-SSE_OP_W(op_pmullw, FMULLW)
-SSE_OP_W(op_pmulhuw, FMULHUW)
-SSE_OP_W(op_pmulhw, FMULHW)
+SSE_HELPER_W(helper_pmullw, FMULLW)
+SSE_HELPER_W(helper_pmulhuw, FMULHUW)
+SSE_HELPER_W(helper_pmulhw, FMULHW)
 
-SSE_OP_B(op_pavgb, FAVG)
-SSE_OP_W(op_pavgw, FAVG)
+SSE_HELPER_B(helper_pavgb, FAVG)
+SSE_HELPER_W(helper_pavgw, FAVG)
 
-void OPPROTO glue(op_pmuludq, SUFFIX) (void)
+void glue(helper_pmuludq, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)
 {
     Reg *d, *s;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     d->Q(0) = (uint64_t)s->L(0) * (uint64_t)d->L(0);
 #if SHIFT == 1
@@ -473,18 +465,17 @@
 #endif
 }
 
-void OPPROTO glue(op_pmaddwd, SUFFIX) (void)
+void glue(helper_pmaddwd, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)
 {
     int i;
     Reg *d, *s;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     for(i = 0; i < (2 << SHIFT); i++) {
         d->L(i) = (int16_t)s->W(2*i) * (int16_t)d->W(2*i) +
             (int16_t)s->W(2*i+1) * (int16_t)d->W(2*i+1);
     }
-    FORCE_RET();
 }
 
 #if SHIFT == 0
@@ -496,12 +487,12 @@
         return a;
 }
 #endif
-void OPPROTO glue(op_psadbw, SUFFIX) (void)
+void glue(helper_psadbw, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)
 {
     unsigned int val;
     Reg *d, *s;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     val = 0;
     val += abs1(d->B(0) - s->B(0));
@@ -527,63 +518,62 @@
 #endif
 }
 
-void OPPROTO glue(op_maskmov, SUFFIX) (void)
+void glue(helper_maskmov, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)
 {
     int i;
     Reg *d, *s;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
     for(i = 0; i < (8 << SHIFT); i++) {
         if (s->B(i) & 0x80)
             stb(A0 + i, d->B(i));
     }
-    FORCE_RET();
 }
 
-void OPPROTO glue(op_movl_mm_T0, SUFFIX) (void)
+void glue(helper_movl_mm_T0, SUFFIX) (uint32_t dst_offset, target_ulong val)
 {
     Reg *d;
-    d = (Reg *)((char *)env + PARAM1);
-    d->L(0) = T0;
+    d = (Reg *)((char *)env + dst_offset);
+    d->L(0) = val;
     d->L(1) = 0;
 #if SHIFT == 1
     d->Q(1) = 0;
 #endif
 }
 
-void OPPROTO glue(op_movl_T0_mm, SUFFIX) (void)
+target_ulong glue(helper_movl_T0_mm, SUFFIX) (uint32_t src_offset)
 {
     Reg *s;
-    s = (Reg *)((char *)env + PARAM1);
-    T0 = s->L(0);
+    s = (Reg *)((char *)env + src_offset);
+    return s->L(0);
 }
 
 #ifdef TARGET_X86_64
-void OPPROTO glue(op_movq_mm_T0, SUFFIX) (void)
+void glue(helper_movq_mm_T0, SUFFIX) (uint32_t dst_offset, target_ulong val)
 {
     Reg *d;
-    d = (Reg *)((char *)env + PARAM1);
-    d->Q(0) = T0;
+    d = (Reg *)((char *)env + dst_offset);
+    d->Q(0) = val;
 #if SHIFT == 1
     d->Q(1) = 0;
 #endif
 }
 
-void OPPROTO glue(op_movq_T0_mm, SUFFIX) (void)
+target_ulong glue(helper_movq_T0_mm, SUFFIX) (uint32_t src_offset)
 {
     Reg *s;
-    s = (Reg *)((char *)env + PARAM1);
-    T0 = s->Q(0);
+    s = (Reg *)((char *)env + src_offset);
+    return s->Q(0);
 }
 #endif
 
 #if SHIFT == 0
-void OPPROTO glue(op_pshufw, SUFFIX) (void)
+void glue(helper_pshufw, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)
 {
     Reg r, *d, *s;
     int order;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
     order = PARAM3;
     r.W(0) = s->W(order & 3);
     r.W(1) = s->W((order >> 2) & 3);
@@ -592,12 +582,12 @@
     *d = r;
 }
 #else
-void OPPROTO op_shufps(void)
+void helper_shufps(uint32_t dst_offset, uint32_t src_offset)
 {
     Reg r, *d, *s;
     int order;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
     order = PARAM3;
     r.L(0) = d->L(order & 3);
     r.L(1) = d->L((order >> 2) & 3);
@@ -606,24 +596,24 @@
     *d = r;
 }
 
-void OPPROTO op_shufpd(void)
+void helper_shufpd(uint32_t dst_offset, uint32_t src_offset)
 {
     Reg r, *d, *s;
     int order;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
     order = PARAM3;
     r.Q(0) = d->Q(order & 1);
     r.Q(1) = s->Q((order >> 1) & 1);
     *d = r;
 }
 
-void OPPROTO glue(op_pshufd, SUFFIX) (void)
+void glue(helper_pshufd, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)
 {
     Reg r, *d, *s;
     int order;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
     order = PARAM3;
     r.L(0) = s->L(order & 3);
     r.L(1) = s->L((order >> 2) & 3);
@@ -632,12 +622,12 @@
     *d = r;
 }
 
-void OPPROTO glue(op_pshuflw, SUFFIX) (void)
+void glue(helper_pshuflw, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)
 {
     Reg r, *d, *s;
     int order;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
     order = PARAM3;
     r.W(0) = s->W(order & 3);
     r.W(1) = s->W((order >> 2) & 3);
@@ -647,12 +637,12 @@
     *d = r;
 }
 
-void OPPROTO glue(op_pshufhw, SUFFIX) (void)
+void glue(helper_pshufhw, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)
 {
     Reg r, *d, *s;
     int order;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
     order = PARAM3;
     r.Q(0) = s->Q(0);
     r.W(4) = s->W(4 + (order & 3));
@@ -667,39 +657,39 @@
 /* FPU ops */
 /* XXX: not accurate */
 
-#define SSE_OP_S(name, F)\
-void OPPROTO op_ ## name ## ps (void)\
+#define SSE_HELPER_S(name, F)\
+void helper_ ## name ## ps (uint32_t dst_offset, uint32_t src_offset)\
 {\
     Reg *d, *s;\
-    d = (Reg *)((char *)env + PARAM1);\
-    s = (Reg *)((char *)env + PARAM2);\
+    d = (Reg *)((char *)env + dst_offset);\
+    s = (Reg *)((char *)env + src_offset);\
     d->XMM_S(0) = F(32, d->XMM_S(0), s->XMM_S(0));\
     d->XMM_S(1) = F(32, d->XMM_S(1), s->XMM_S(1));\
     d->XMM_S(2) = F(32, d->XMM_S(2), s->XMM_S(2));\
     d->XMM_S(3) = F(32, d->XMM_S(3), s->XMM_S(3));\
 }\
 \
-void OPPROTO op_ ## name ## ss (void)\
+void helper_ ## name ## ss (uint32_t dst_offset, uint32_t src_offset)\
 {\
     Reg *d, *s;\
-    d = (Reg *)((char *)env + PARAM1);\
-    s = (Reg *)((char *)env + PARAM2);\
+    d = (Reg *)((char *)env + dst_offset);\
+    s = (Reg *)((char *)env + src_offset);\
     d->XMM_S(0) = F(32, d->XMM_S(0), s->XMM_S(0));\
 }\
-void OPPROTO op_ ## name ## pd (void)\
+void helper_ ## name ## pd (uint32_t dst_offset, uint32_t src_offset)\
 {\
     Reg *d, *s;\
-    d = (Reg *)((char *)env + PARAM1);\
-    s = (Reg *)((char *)env + PARAM2);\
+    d = (Reg *)((char *)env + dst_offset);\
+    s = (Reg *)((char *)env + src_offset);\
     d->XMM_D(0) = F(64, d->XMM_D(0), s->XMM_D(0));\
     d->XMM_D(1) = F(64, d->XMM_D(1), s->XMM_D(1));\
 }\
 \
-void OPPROTO op_ ## name ## sd (void)\
+void helper_ ## name ## sd (uint32_t dst_offset, uint32_t src_offset)\
 {\
     Reg *d, *s;\
-    d = (Reg *)((char *)env + PARAM1);\
-    s = (Reg *)((char *)env + PARAM2);\
+    d = (Reg *)((char *)env + dst_offset);\
+    s = (Reg *)((char *)env + src_offset);\
     d->XMM_D(0) = F(64, d->XMM_D(0), s->XMM_D(0));\
 }
 
@@ -711,69 +701,69 @@
 #define FPU_MAX(size, a, b) (a) > (b) ? (a) : (b)
 #define FPU_SQRT(size, a, b) float ## size ## _sqrt(b, &env->sse_status)
 
-SSE_OP_S(add, FPU_ADD)
-SSE_OP_S(sub, FPU_SUB)
-SSE_OP_S(mul, FPU_MUL)
-SSE_OP_S(div, FPU_DIV)
-SSE_OP_S(min, FPU_MIN)
-SSE_OP_S(max, FPU_MAX)
-SSE_OP_S(sqrt, FPU_SQRT)
+SSE_HELPER_S(add, FPU_ADD)
+SSE_HELPER_S(sub, FPU_SUB)
+SSE_HELPER_S(mul, FPU_MUL)
+SSE_HELPER_S(div, FPU_DIV)
+SSE_HELPER_S(min, FPU_MIN)
+SSE_HELPER_S(max, FPU_MAX)
+SSE_HELPER_S(sqrt, FPU_SQRT)
 
 
 /* float to float conversions */
-void OPPROTO op_cvtps2pd(void)
+void helper_cvtps2pd(uint32_t dst_offset, uint32_t src_offset)
 {
     float32 s0, s1;
     Reg *d, *s;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
     s0 = s->XMM_S(0);
     s1 = s->XMM_S(1);
     d->XMM_D(0) = float32_to_float64(s0, &env->sse_status);
     d->XMM_D(1) = float32_to_float64(s1, &env->sse_status);
 }
 
-void OPPROTO op_cvtpd2ps(void)
+void helper_cvtpd2ps(uint32_t dst_offset, uint32_t src_offset)
 {
     Reg *d, *s;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
     d->XMM_S(0) = float64_to_float32(s->XMM_D(0), &env->sse_status);
     d->XMM_S(1) = float64_to_float32(s->XMM_D(1), &env->sse_status);
     d->Q(1) = 0;
 }
 
-void OPPROTO op_cvtss2sd(void)
+void helper_cvtss2sd(uint32_t dst_offset, uint32_t src_offset)
 {
     Reg *d, *s;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
     d->XMM_D(0) = float32_to_float64(s->XMM_S(0), &env->sse_status);
 }
 
-void OPPROTO op_cvtsd2ss(void)
+void helper_cvtsd2ss(uint32_t dst_offset, uint32_t src_offset)
 {
     Reg *d, *s;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
     d->XMM_S(0) = float64_to_float32(s->XMM_D(0), &env->sse_status);
 }
 
 /* integer to float */
-void OPPROTO op_cvtdq2ps(void)
+void helper_cvtdq2ps(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (XMMReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    XMMReg *d = (XMMReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     d->XMM_S(0) = int32_to_float32(s->XMM_L(0), &env->sse_status);
     d->XMM_S(1) = int32_to_float32(s->XMM_L(1), &env->sse_status);
     d->XMM_S(2) = int32_to_float32(s->XMM_L(2), &env->sse_status);
     d->XMM_S(3) = int32_to_float32(s->XMM_L(3), &env->sse_status);
 }
 
-void OPPROTO op_cvtdq2pd(void)
+void helper_cvtdq2pd(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (XMMReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    XMMReg *d = (XMMReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     int32_t l0, l1;
     l0 = (int32_t)s->XMM_L(0);
     l1 = (int32_t)s->XMM_L(1);
@@ -781,210 +771,210 @@
     d->XMM_D(1) = int32_to_float64(l1, &env->sse_status);
 }
 
-void OPPROTO op_cvtpi2ps(void)
+void helper_cvtpi2ps(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (Reg *)((char *)env + PARAM1);
-    MMXReg *s = (MMXReg *)((char *)env + PARAM2);
+    XMMReg *d = (Reg *)((char *)env + dst_offset);
+    MMXReg *s = (MMXReg *)((char *)env + src_offset);
     d->XMM_S(0) = int32_to_float32(s->MMX_L(0), &env->sse_status);
     d->XMM_S(1) = int32_to_float32(s->MMX_L(1), &env->sse_status);
 }
 
-void OPPROTO op_cvtpi2pd(void)
+void helper_cvtpi2pd(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (Reg *)((char *)env + PARAM1);
-    MMXReg *s = (MMXReg *)((char *)env + PARAM2);
+    XMMReg *d = (Reg *)((char *)env + dst_offset);
+    MMXReg *s = (MMXReg *)((char *)env + src_offset);
     d->XMM_D(0) = int32_to_float64(s->MMX_L(0), &env->sse_status);
     d->XMM_D(1) = int32_to_float64(s->MMX_L(1), &env->sse_status);
 }
 
-void OPPROTO op_cvtsi2ss(void)
+void helper_cvtsi2ss(uint32_t dst_offset, target_ulong val)
 {
-    XMMReg *d = (Reg *)((char *)env + PARAM1);
-    d->XMM_S(0) = int32_to_float32(T0, &env->sse_status);
+    XMMReg *d = (Reg *)((char *)env + dst_offset);
+    d->XMM_S(0) = int32_to_float32(val, &env->sse_status);
 }
 
-void OPPROTO op_cvtsi2sd(void)
+void helper_cvtsi2sd(uint32_t dst_offset, target_ulong val)
 {
-    XMMReg *d = (Reg *)((char *)env + PARAM1);
-    d->XMM_D(0) = int32_to_float64(T0, &env->sse_status);
+    XMMReg *d = (Reg *)((char *)env + dst_offset);
+    d->XMM_D(0) = int32_to_float64(val, &env->sse_status);
 }
 
 #ifdef TARGET_X86_64
-void OPPROTO op_cvtsq2ss(void)
+void helper_cvtsq2ss(uint32_t dst_offset, target_ulong val)
 {
-    XMMReg *d = (Reg *)((char *)env + PARAM1);
-    d->XMM_S(0) = int64_to_float32(T0, &env->sse_status);
+    XMMReg *d = (Reg *)((char *)env + dst_offset);
+    d->XMM_S(0) = int64_to_float32(val, &env->sse_status);
 }
 
-void OPPROTO op_cvtsq2sd(void)
+void helper_cvtsq2sd(uint32_t dst_offset, target_ulong val)
 {
-    XMMReg *d = (Reg *)((char *)env + PARAM1);
-    d->XMM_D(0) = int64_to_float64(T0, &env->sse_status);
+    XMMReg *d = (Reg *)((char *)env + dst_offset);
+    d->XMM_D(0) = int64_to_float64(val, &env->sse_status);
 }
 #endif
 
 /* float to integer */
-void OPPROTO op_cvtps2dq(void)
+void helper_cvtps2dq(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (XMMReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    XMMReg *d = (XMMReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     d->XMM_L(0) = float32_to_int32(s->XMM_S(0), &env->sse_status);
     d->XMM_L(1) = float32_to_int32(s->XMM_S(1), &env->sse_status);
     d->XMM_L(2) = float32_to_int32(s->XMM_S(2), &env->sse_status);
     d->XMM_L(3) = float32_to_int32(s->XMM_S(3), &env->sse_status);
 }
 
-void OPPROTO op_cvtpd2dq(void)
+void helper_cvtpd2dq(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (XMMReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    XMMReg *d = (XMMReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     d->XMM_L(0) = float64_to_int32(s->XMM_D(0), &env->sse_status);
     d->XMM_L(1) = float64_to_int32(s->XMM_D(1), &env->sse_status);
     d->XMM_Q(1) = 0;
 }
 
-void OPPROTO op_cvtps2pi(void)
+void helper_cvtps2pi(uint32_t dst_offset, uint32_t src_offset)
 {
-    MMXReg *d = (MMXReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    MMXReg *d = (MMXReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     d->MMX_L(0) = float32_to_int32(s->XMM_S(0), &env->sse_status);
     d->MMX_L(1) = float32_to_int32(s->XMM_S(1), &env->sse_status);
 }
 
-void OPPROTO op_cvtpd2pi(void)
+void helper_cvtpd2pi(uint32_t dst_offset, uint32_t src_offset)
 {
-    MMXReg *d = (MMXReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    MMXReg *d = (MMXReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     d->MMX_L(0) = float64_to_int32(s->XMM_D(0), &env->sse_status);
     d->MMX_L(1) = float64_to_int32(s->XMM_D(1), &env->sse_status);
 }
 
-void OPPROTO op_cvtss2si(void)
+target_ulong helper_cvtss2si(uint32_t src_offset)
 {
-    XMMReg *s = (XMMReg *)((char *)env + PARAM1);
-    T0 = float32_to_int32(s->XMM_S(0), &env->sse_status);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
+    return float32_to_int32(s->XMM_S(0), &env->sse_status);
 }
 
-void OPPROTO op_cvtsd2si(void)
+target_ulong helper_cvtsd2si(uint32_t src_offset)
 {
-    XMMReg *s = (XMMReg *)((char *)env + PARAM1);
-    T0 = float64_to_int32(s->XMM_D(0), &env->sse_status);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
+    return float64_to_int32(s->XMM_D(0), &env->sse_status);
 }
 
 #ifdef TARGET_X86_64
-void OPPROTO op_cvtss2sq(void)
+target_ulong helper_cvtss2sq(uint32_t src_offset)
 {
-    XMMReg *s = (XMMReg *)((char *)env + PARAM1);
-    T0 = float32_to_int64(s->XMM_S(0), &env->sse_status);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
+    return float32_to_int64(s->XMM_S(0), &env->sse_status);
 }
 
-void OPPROTO op_cvtsd2sq(void)
+target_ulong helper_cvtsd2sq(uint32_t src_offset)
 {
-    XMMReg *s = (XMMReg *)((char *)env + PARAM1);
-    T0 = float64_to_int64(s->XMM_D(0), &env->sse_status);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
+    return float64_to_int64(s->XMM_D(0), &env->sse_status);
 }
 #endif
 
 /* float to integer truncated */
-void OPPROTO op_cvttps2dq(void)
+void helper_cvttps2dq(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (XMMReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    XMMReg *d = (XMMReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     d->XMM_L(0) = float32_to_int32_round_to_zero(s->XMM_S(0), &env->sse_status);
     d->XMM_L(1) = float32_to_int32_round_to_zero(s->XMM_S(1), &env->sse_status);
     d->XMM_L(2) = float32_to_int32_round_to_zero(s->XMM_S(2), &env->sse_status);
     d->XMM_L(3) = float32_to_int32_round_to_zero(s->XMM_S(3), &env->sse_status);
 }
 
-void OPPROTO op_cvttpd2dq(void)
+void helper_cvttpd2dq(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (XMMReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    XMMReg *d = (XMMReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     d->XMM_L(0) = float64_to_int32_round_to_zero(s->XMM_D(0), &env->sse_status);
     d->XMM_L(1) = float64_to_int32_round_to_zero(s->XMM_D(1), &env->sse_status);
     d->XMM_Q(1) = 0;
 }
 
-void OPPROTO op_cvttps2pi(void)
+void helper_cvttps2pi(uint32_t dst_offset, uint32_t src_offset)
 {
-    MMXReg *d = (MMXReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    MMXReg *d = (MMXReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     d->MMX_L(0) = float32_to_int32_round_to_zero(s->XMM_S(0), &env->sse_status);
     d->MMX_L(1) = float32_to_int32_round_to_zero(s->XMM_S(1), &env->sse_status);
 }
 
-void OPPROTO op_cvttpd2pi(void)
+void helper_cvttpd2pi(uint32_t dst_offset, uint32_t src_offset)
 {
-    MMXReg *d = (MMXReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    MMXReg *d = (MMXReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     d->MMX_L(0) = float64_to_int32_round_to_zero(s->XMM_D(0), &env->sse_status);
     d->MMX_L(1) = float64_to_int32_round_to_zero(s->XMM_D(1), &env->sse_status);
 }
 
-void OPPROTO op_cvttss2si(void)
+uint32_t helper_cvttss2si(uint32_t src_offset)
 {
-    XMMReg *s = (XMMReg *)((char *)env + PARAM1);
-    T0 = float32_to_int32_round_to_zero(s->XMM_S(0), &env->sse_status);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
+    return float32_to_int32_round_to_zero(s->XMM_S(0), &env->sse_status);
 }
 
-void OPPROTO op_cvttsd2si(void)
+uint32_t helper_cvttsd2si(uint32_t src_offset)
 {
-    XMMReg *s = (XMMReg *)((char *)env + PARAM1);
-    T0 = float64_to_int32_round_to_zero(s->XMM_D(0), &env->sse_status);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
+    return float64_to_int32_round_to_zero(s->XMM_D(0), &env->sse_status);
 }
 
 #ifdef TARGET_X86_64
-void OPPROTO op_cvttss2sq(void)
+uint32_t helper_cvttss2sq(uint32_t src_offset)
 {
-    XMMReg *s = (XMMReg *)((char *)env + PARAM1);
-    T0 = float32_to_int64_round_to_zero(s->XMM_S(0), &env->sse_status);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
+    return float32_to_int64_round_to_zero(s->XMM_S(0), &env->sse_status);
 }
 
-void OPPROTO op_cvttsd2sq(void)
+uint32_t helper_cvttsd2sq(uint32_t src_offset)
 {
-    XMMReg *s = (XMMReg *)((char *)env + PARAM1);
-    T0 = float64_to_int64_round_to_zero(s->XMM_D(0), &env->sse_status);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
+    return float64_to_int64_round_to_zero(s->XMM_D(0), &env->sse_status);
 }
 #endif
 
-void OPPROTO op_rsqrtps(void)
+void helper_rsqrtps(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (XMMReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    XMMReg *d = (XMMReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     d->XMM_S(0) = approx_rsqrt(s->XMM_S(0));
     d->XMM_S(1) = approx_rsqrt(s->XMM_S(1));
     d->XMM_S(2) = approx_rsqrt(s->XMM_S(2));
     d->XMM_S(3) = approx_rsqrt(s->XMM_S(3));
 }
 
-void OPPROTO op_rsqrtss(void)
+void helper_rsqrtss(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (XMMReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    XMMReg *d = (XMMReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     d->XMM_S(0) = approx_rsqrt(s->XMM_S(0));
 }
 
-void OPPROTO op_rcpps(void)
+void helper_rcpps(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (XMMReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    XMMReg *d = (XMMReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     d->XMM_S(0) = approx_rcp(s->XMM_S(0));
     d->XMM_S(1) = approx_rcp(s->XMM_S(1));
     d->XMM_S(2) = approx_rcp(s->XMM_S(2));
     d->XMM_S(3) = approx_rcp(s->XMM_S(3));
 }
 
-void OPPROTO op_rcpss(void)
+void helper_rcpss(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (XMMReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    XMMReg *d = (XMMReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     d->XMM_S(0) = approx_rcp(s->XMM_S(0));
 }
 
-void OPPROTO op_haddps(void)
+void helper_haddps(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (XMMReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    XMMReg *d = (XMMReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     XMMReg r;
     r.XMM_S(0) = d->XMM_S(0) + d->XMM_S(1);
     r.XMM_S(1) = d->XMM_S(2) + d->XMM_S(3);
@@ -993,20 +983,20 @@
     *d = r;
 }
 
-void OPPROTO op_haddpd(void)
+void helper_haddpd(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (XMMReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    XMMReg *d = (XMMReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     XMMReg r;
     r.XMM_D(0) = d->XMM_D(0) + d->XMM_D(1);
     r.XMM_D(1) = s->XMM_D(0) + s->XMM_D(1);
     *d = r;
 }
 
-void OPPROTO op_hsubps(void)
+void helper_hsubps(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (XMMReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    XMMReg *d = (XMMReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     XMMReg r;
     r.XMM_S(0) = d->XMM_S(0) - d->XMM_S(1);
     r.XMM_S(1) = d->XMM_S(2) - d->XMM_S(3);
@@ -1015,68 +1005,68 @@
     *d = r;
 }
 
-void OPPROTO op_hsubpd(void)
+void helper_hsubpd(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (XMMReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    XMMReg *d = (XMMReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     XMMReg r;
     r.XMM_D(0) = d->XMM_D(0) - d->XMM_D(1);
     r.XMM_D(1) = s->XMM_D(0) - s->XMM_D(1);
     *d = r;
 }
 
-void OPPROTO op_addsubps(void)
+void helper_addsubps(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (XMMReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    XMMReg *d = (XMMReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     d->XMM_S(0) = d->XMM_S(0) - s->XMM_S(0);
     d->XMM_S(1) = d->XMM_S(1) + s->XMM_S(1);
     d->XMM_S(2) = d->XMM_S(2) - s->XMM_S(2);
     d->XMM_S(3) = d->XMM_S(3) + s->XMM_S(3);
 }
 
-void OPPROTO op_addsubpd(void)
+void helper_addsubpd(uint32_t dst_offset, uint32_t src_offset)
 {
-    XMMReg *d = (XMMReg *)((char *)env + PARAM1);
-    XMMReg *s = (XMMReg *)((char *)env + PARAM2);
+    XMMReg *d = (XMMReg *)((char *)env + dst_offset);
+    XMMReg *s = (XMMReg *)((char *)env + src_offset);
     d->XMM_D(0) = d->XMM_D(0) - s->XMM_D(0);
     d->XMM_D(1) = d->XMM_D(1) + s->XMM_D(1);
 }
 
 /* XXX: unordered */
-#define SSE_OP_CMP(name, F)\
-void OPPROTO op_ ## name ## ps (void)\
+#define SSE_HELPER_CMP(name, F)\
+void helper_ ## name ## ps (uint32_t dst_offset, uint32_t src_offset)\
 {\
     Reg *d, *s;\
-    d = (Reg *)((char *)env + PARAM1);\
-    s = (Reg *)((char *)env + PARAM2);\
+    d = (Reg *)((char *)env + dst_offset);\
+    s = (Reg *)((char *)env + src_offset);\
     d->XMM_L(0) = F(32, d->XMM_S(0), s->XMM_S(0));\
     d->XMM_L(1) = F(32, d->XMM_S(1), s->XMM_S(1));\
     d->XMM_L(2) = F(32, d->XMM_S(2), s->XMM_S(2));\
     d->XMM_L(3) = F(32, d->XMM_S(3), s->XMM_S(3));\
 }\
 \
-void OPPROTO op_ ## name ## ss (void)\
+void helper_ ## name ## ss (uint32_t dst_offset, uint32_t src_offset)\
 {\
     Reg *d, *s;\
-    d = (Reg *)((char *)env + PARAM1);\
-    s = (Reg *)((char *)env + PARAM2);\
+    d = (Reg *)((char *)env + dst_offset);\
+    s = (Reg *)((char *)env + src_offset);\
     d->XMM_L(0) = F(32, d->XMM_S(0), s->XMM_S(0));\
 }\
-void OPPROTO op_ ## name ## pd (void)\
+void helper_ ## name ## pd (uint32_t dst_offset, uint32_t src_offset)\
 {\
     Reg *d, *s;\
-    d = (Reg *)((char *)env + PARAM1);\
-    s = (Reg *)((char *)env + PARAM2);\
+    d = (Reg *)((char *)env + dst_offset);\
+    s = (Reg *)((char *)env + src_offset);\
     d->XMM_Q(0) = F(64, d->XMM_D(0), s->XMM_D(0));\
     d->XMM_Q(1) = F(64, d->XMM_D(1), s->XMM_D(1));\
 }\
 \
-void OPPROTO op_ ## name ## sd (void)\
+void helper_ ## name ## sd (uint32_t dst_offset, uint32_t src_offset)\
 {\
     Reg *d, *s;\
-    d = (Reg *)((char *)env + PARAM1);\
-    s = (Reg *)((char *)env + PARAM2);\
+    d = (Reg *)((char *)env + dst_offset);\
+    s = (Reg *)((char *)env + src_offset);\
     d->XMM_Q(0) = F(64, d->XMM_D(0), s->XMM_D(0));\
 }
 
@@ -1089,147 +1079,144 @@
 #define FPU_CMPNLE(size, a, b) float ## size ## _le(a, b, &env->sse_status) ? 0 : -1
 #define FPU_CMPORD(size, a, b) float ## size ## _unordered(a, b, &env->sse_status) ? 0 : -1
 
-SSE_OP_CMP(cmpeq, FPU_CMPEQ)
-SSE_OP_CMP(cmplt, FPU_CMPLT)
-SSE_OP_CMP(cmple, FPU_CMPLE)
-SSE_OP_CMP(cmpunord, FPU_CMPUNORD)
-SSE_OP_CMP(cmpneq, FPU_CMPNEQ)
-SSE_OP_CMP(cmpnlt, FPU_CMPNLT)
-SSE_OP_CMP(cmpnle, FPU_CMPNLE)
-SSE_OP_CMP(cmpord, FPU_CMPORD)
+SSE_HELPER_CMP(cmpeq, FPU_CMPEQ)
+SSE_HELPER_CMP(cmplt, FPU_CMPLT)
+SSE_HELPER_CMP(cmple, FPU_CMPLE)
+SSE_HELPER_CMP(cmpunord, FPU_CMPUNORD)
+SSE_HELPER_CMP(cmpneq, FPU_CMPNEQ)
+SSE_HELPER_CMP(cmpnlt, FPU_CMPNLT)
+SSE_HELPER_CMP(cmpnle, FPU_CMPNLE)
+SSE_HELPER_CMP(cmpord, FPU_CMPORD)
 
 const int comis_eflags[4] = {CC_C, CC_Z, 0, CC_Z | CC_P | CC_C};
 
-void OPPROTO op_ucomiss(void)
+void helper_ucomiss(uint32_t dst_offset, uint32_t src_offset)
 {
     int ret;
     float32 s0, s1;
     Reg *d, *s;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     s0 = d->XMM_S(0);
     s1 = s->XMM_S(0);
     ret = float32_compare_quiet(s0, s1, &env->sse_status);
     CC_SRC = comis_eflags[ret + 1];
-    FORCE_RET();
 }
 
-void OPPROTO op_comiss(void)
+void helper_comiss(uint32_t dst_offset, uint32_t src_offset)
 {
     int ret;
     float32 s0, s1;
     Reg *d, *s;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     s0 = d->XMM_S(0);
     s1 = s->XMM_S(0);
     ret = float32_compare(s0, s1, &env->sse_status);
     CC_SRC = comis_eflags[ret + 1];
-    FORCE_RET();
 }
 
-void OPPROTO op_ucomisd(void)
+void helper_ucomisd(uint32_t dst_offset, uint32_t src_offset)
 {
     int ret;
     float64 d0, d1;
     Reg *d, *s;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     d0 = d->XMM_D(0);
     d1 = s->XMM_D(0);
     ret = float64_compare_quiet(d0, d1, &env->sse_status);
     CC_SRC = comis_eflags[ret + 1];
-    FORCE_RET();
 }
 
-void OPPROTO op_comisd(void)
+void helper_comisd(uint32_t dst_offset, uint32_t src_offset)
 {
     int ret;
     float64 d0, d1;
     Reg *d, *s;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     d0 = d->XMM_D(0);
     d1 = s->XMM_D(0);
     ret = float64_compare(d0, d1, &env->sse_status);
     CC_SRC = comis_eflags[ret + 1];
-    FORCE_RET();
 }
 
-void OPPROTO op_movmskps(void)
+uint32_t helper_movmskps(uint32_t src_offset)
 {
     int b0, b1, b2, b3;
     Reg *s;
-    s = (Reg *)((char *)env + PARAM1);
+    s = (Reg *)((char *)env + src_offset);
     b0 = s->XMM_L(0) >> 31;
     b1 = s->XMM_L(1) >> 31;
     b2 = s->XMM_L(2) >> 31;
     b3 = s->XMM_L(3) >> 31;
-    T0 = b0 | (b1 << 1) | (b2 << 2) | (b3 << 3);
+    return b0 | (b1 << 1) | (b2 << 2) | (b3 << 3);
 }
 
-void OPPROTO op_movmskpd(void)
+uint32_t helper_movmskpd(uint32_t src_offset)
 {
     int b0, b1;
     Reg *s;
-    s = (Reg *)((char *)env + PARAM1);
+    s = (Reg *)((char *)env + src_offset);
     b0 = s->XMM_L(1) >> 31;
     b1 = s->XMM_L(3) >> 31;
-    T0 = b0 | (b1 << 1);
+    return b0 | (b1 << 1);
 }
 
 #endif
 
-void OPPROTO glue(op_pmovmskb, SUFFIX)(void)
+uint32_t glue(helper_pmovmskb, SUFFIX)(uint32_t src_offset)
 {
     Reg *s;
-    s = (Reg *)((char *)env + PARAM1);
-    T0 = 0;
-    T0 |= (s->XMM_B(0) >> 7);
-    T0 |= (s->XMM_B(1) >> 6) & 0x02;
-    T0 |= (s->XMM_B(2) >> 5) & 0x04;
-    T0 |= (s->XMM_B(3) >> 4) & 0x08;
-    T0 |= (s->XMM_B(4) >> 3) & 0x10;
-    T0 |= (s->XMM_B(5) >> 2) & 0x20;
-    T0 |= (s->XMM_B(6) >> 1) & 0x40;
-    T0 |= (s->XMM_B(7)) & 0x80;
+    uint32_t ret;
+
+    s = (Reg *)((char *)env + src_offset);
+    ret = 0;
+    ret |= (s->XMM_B(0) >> 7);
+    ret |= (s->XMM_B(1) >> 6) & 0x02;
+    ret |= (s->XMM_B(2) >> 5) & 0x04;
+    ret |= (s->XMM_B(3) >> 4) & 0x08;
+    ret |= (s->XMM_B(4) >> 3) & 0x10;
+    ret |= (s->XMM_B(5) >> 2) & 0x20;
+    ret |= (s->XMM_B(6) >> 1) & 0x40;
+    ret |= (s->XMM_B(7)) & 0x80;
 #if SHIFT == 1
-    T0 |= (s->XMM_B(8) << 1) & 0x0100;
-    T0 |= (s->XMM_B(9) << 2) & 0x0200;
-    T0 |= (s->XMM_B(10) << 3) & 0x0400;
-    T0 |= (s->XMM_B(11) << 4) & 0x0800;
-    T0 |= (s->XMM_B(12) << 5) & 0x1000;
-    T0 |= (s->XMM_B(13) << 6) & 0x2000;
-    T0 |= (s->XMM_B(14) << 7) & 0x4000;
-    T0 |= (s->XMM_B(15) << 8) & 0x8000;
+    ret |= (s->XMM_B(8) << 1) & 0x0100;
+    ret |= (s->XMM_B(9) << 2) & 0x0200;
+    ret |= (s->XMM_B(10) << 3) & 0x0400;
+    ret |= (s->XMM_B(11) << 4) & 0x0800;
+    ret |= (s->XMM_B(12) << 5) & 0x1000;
+    ret |= (s->XMM_B(13) << 6) & 0x2000;
+    ret |= (s->XMM_B(14) << 7) & 0x4000;
+    ret |= (s->XMM_B(15) << 8) & 0x8000;
 #endif
+    return ret;
 }
 
-void OPPROTO glue(op_pinsrw, SUFFIX) (void)
+void glue(helper_pinsrw, SUFFIX) (uint32_t dst_offset, uint32_t pos, uint32_t val)
 {
-    Reg *d = (Reg *)((char *)env + PARAM1);
-    int pos = PARAM2;
+    Reg *d = (Reg *)((char *)env + dst_offset);
 
-    d->W(pos) = T0;
+    d->W(pos) = val;
 }
 
-void OPPROTO glue(op_pextrw, SUFFIX) (void)
+uint32_t glue(helper_pextrw, SUFFIX) (uint32_t src_offset, uint32_t pos)
 {
-    Reg *s = (Reg *)((char *)env + PARAM1);
-    int pos = PARAM2;
+    Reg *s = (Reg *)((char *)env + src_offset);
 
-    T0 = s->W(pos);
+    return s->W(pos);
 }
 
-void OPPROTO glue(op_packsswb, SUFFIX) (void)
+void glue(helper_packsswb, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)
 {
     Reg r, *d, *s;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     r.B(0) = satsb((int16_t)d->W(0));
     r.B(1) = satsb((int16_t)d->W(1));
@@ -1254,11 +1241,11 @@
     *d = r;
 }
 
-void OPPROTO glue(op_packuswb, SUFFIX) (void)
+void glue(helper_packuswb, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)
 {
     Reg r, *d, *s;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     r.B(0) = satub((int16_t)d->W(0));
     r.B(1) = satub((int16_t)d->W(1));
@@ -1283,11 +1270,11 @@
     *d = r;
 }
 
-void OPPROTO glue(op_packssdw, SUFFIX) (void)
+void glue(helper_packssdw, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)
 {
     Reg r, *d, *s;
-    d = (Reg *)((char *)env + PARAM1);
-    s = (Reg *)((char *)env + PARAM2);
+    d = (Reg *)((char *)env + dst_offset);
+    s = (Reg *)((char *)env + src_offset);
 
     r.W(0) = satsw(d->L(0));
     r.W(1) = satsw(d->L(1));
@@ -1306,11 +1293,11 @@
 
 #define UNPCK_OP(base_name, base)                               \
                                                                 \
-void OPPROTO glue(op_punpck ## base_name ## bw, SUFFIX) (void)   \
+void glue(helper_punpck ## base_name ## bw, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)   \
 {                                                               \
     Reg r, *d, *s;                                              \
-    d = (Reg *)((char *)env + PARAM1);                          \
-    s = (Reg *)((char *)env + PARAM2);                          \
+    d = (Reg *)((char *)env + dst_offset);                          \
+    s = (Reg *)((char *)env + src_offset);                          \
                                                                 \
     r.B(0) = d->B((base << (SHIFT + 2)) + 0);                   \
     r.B(1) = s->B((base << (SHIFT + 2)) + 0);                   \
@@ -1333,11 +1320,11 @@
     *d = r;                                                     \
 }                                                               \
                                                                 \
-void OPPROTO glue(op_punpck ## base_name ## wd, SUFFIX) (void)   \
+void glue(helper_punpck ## base_name ## wd, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)   \
 {                                                               \
     Reg r, *d, *s;                                              \
-    d = (Reg *)((char *)env + PARAM1);                          \
-    s = (Reg *)((char *)env + PARAM2);                          \
+    d = (Reg *)((char *)env + dst_offset);                          \
+    s = (Reg *)((char *)env + src_offset);                          \
                                                                 \
     r.W(0) = d->W((base << (SHIFT + 1)) + 0);                   \
     r.W(1) = s->W((base << (SHIFT + 1)) + 0);                   \
@@ -1352,11 +1339,11 @@
     *d = r;                                                     \
 }                                                               \
                                                                 \
-void OPPROTO glue(op_punpck ## base_name ## dq, SUFFIX) (void)   \
+void glue(helper_punpck ## base_name ## dq, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)   \
 {                                                               \
     Reg r, *d, *s;                                              \
-    d = (Reg *)((char *)env + PARAM1);                          \
-    s = (Reg *)((char *)env + PARAM2);                          \
+    d = (Reg *)((char *)env + dst_offset);                          \
+    s = (Reg *)((char *)env + src_offset);                          \
                                                                 \
     r.L(0) = d->L((base << SHIFT) + 0);                         \
     r.L(1) = s->L((base << SHIFT) + 0);                         \
@@ -1368,11 +1355,11 @@
 }                                                               \
                                                                 \
 XMM_ONLY(                                                       \
-void OPPROTO glue(op_punpck ## base_name ## qdq, SUFFIX) (void)  \
+void glue(helper_punpck ## base_name ## qdq, SUFFIX) (uint32_t dst_offset, uint32_t src_offset)  \
 {                                                               \
     Reg r, *d, *s;                                              \
-    d = (Reg *)((char *)env + PARAM1);                          \
-    s = (Reg *)((char *)env + PARAM2);                          \
+    d = (Reg *)((char *)env + dst_offset);                          \
+    s = (Reg *)((char *)env + src_offset);                          \
                                                                 \
     r.Q(0) = d->Q(base);                                        \
     r.Q(1) = s->Q(base);                                        \
Index: qemu/target-i386/helper.h
===================================================================
--- qemu.orig/target-i386/helper.h	2008-03-19 18:26:29.000000000 +0000
+++ qemu/target-i386/helper.h	2008-03-19 18:28:13.000000000 +0000
@@ -2,3 +2,293 @@
 
 void TCG_HELPER_PROTO helper_divl_EAX_T0(target_ulong t0);
 void TCG_HELPER_PROTO helper_idivl_EAX_T0(target_ulong t0);
+
+void TCG_HELPER_PROTO helper_psrlw_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psraw_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psllw_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psrld_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psrad_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pslld_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psrlq_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psllq_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psrldq_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pslldq_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_paddb_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_paddw_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_paddl_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_paddq_xmm(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_psubb_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psubw_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psubl_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psubq_xmm(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_paddusb_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_paddsb_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psubusb_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psubsb_xmm(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_paddusw_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_paddsw_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psubusw_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psubsw_xmm(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_pminub_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pmaxub_xmm(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_pminsw_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pmaxsw_xmm(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_pand_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pandn_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_por_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pxor_xmm(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_pcmpgtb_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pcmpgtw_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pcmpgtl_xmm(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_pcmpeqb_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pcmpeqw_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pcmpeql_xmm(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_pmullw_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pmulhuw_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pmulhw_xmm(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_pavgb_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pavgw_xmm(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pmuludq_xmm (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pmaddwd_xmm (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psadbw_xmm (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_maskmov_xmm (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_movl_mm_T0_xmm (uint32_t dst_offset, target_ulong val);
+target_ulong TCG_HELPER_PROTO helper_movl_T0_mm_xmm (uint32_t src_offset);
+#ifdef TARGET_X86_64
+void TCG_HELPER_PROTO helper_movq_mm_T0_xmm (uint32_t dst_offset, target_ulong val);
+target_ulong TCG_HELPER_PROTO helper_movq_T0_mm_xmm (uint32_t src_offset);
+#endif
+void TCG_HELPER_PROTO helper_pshufw_xmm (uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_psrlw_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psraw_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psllw_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psrld_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psrad_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pslld_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psrlq_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psllq_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psrldq_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pslldq_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_paddb_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_paddw_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_paddl_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_paddq_mmx(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_psubb_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psubw_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psubl_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psubq_mmx(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_paddusb_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_paddsb_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psubusb_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psubsb_mmx(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_paddusw_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_paddsw_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psubusw_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psubsw_mmx(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_pminub_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pmaxub_mmx(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_pminsw_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pmaxsw_mmx(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_pand_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pandn_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_por_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pxor_mmx(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_pcmpgtb_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pcmpgtw_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pcmpgtl_mmx(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_pcmpeqb_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pcmpeqw_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pcmpeql_mmx(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_pmullw_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pmulhuw_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pmulhw_mmx(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_pavgb_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pavgw_mmx(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pmuludq_mmx (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pmaddwd_mmx (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_psadbw_mmx (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_maskmov_mmx (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_movl_mm_T0_mmx (uint32_t dst_offset, target_ulong val);
+target_ulong TCG_HELPER_PROTO helper_movl_T0_mm_mmx (uint32_t src_offset);
+#ifdef TARGET_X86_64
+void TCG_HELPER_PROTO helper_movq_mm_T0_mmx (uint32_t dst_offset, target_ulong val);
+target_ulong TCG_HELPER_PROTO helper_movq_T0_mm_mmx (uint32_t src_offset);
+#endif
+void TCG_HELPER_PROTO helper_pshufw_mmx (uint32_t dst_offset, uint32_t src_offset);
+void helper_shufps(uint32_t dst_offset, uint32_t src_offset);
+void helper_shufpd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pshufd_xmm (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pshuflw_xmm (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pshufhw_xmm (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pshufd_mmx (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pshuflw_mmx (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pshufhw_mmx (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_addps (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_addss (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_addpd (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_addsd (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_subps (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_subss (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_subsd (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_subpd (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_mulps (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_mulss (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_mulpd (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_mulsd (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_divps (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_divss (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_divpd (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_divsd (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_minps (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_minss (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_minpd (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_minsd (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_maxps (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_maxss (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_maxpd (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_maxsd (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_sqrtps (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_sqrtss (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_sqrtpd (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_sqrtsd (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvtps2pd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvtpd2ps(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvtss2sd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvtsd2ss(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvtps2pd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvtpd2ps(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvtss2sd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvtsd2ss(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvtdq2ps(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvtdq2pd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvtpi2ps(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvtpi2pd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvtsi2ss(uint32_t dst_offset, target_ulong val);
+void TCG_HELPER_PROTO helper_cvtsi2sd(uint32_t dst_offset, target_ulong val);
+#ifdef TARGET_X86_64
+void TCG_HELPER_PROTO helper_cvtsq2ss(uint32_t dst_offset, target_ulong val);
+void TCG_HELPER_PROTO helper_cvtsq2sd(uint32_t dst_offset, target_ulong val);
+#endif
+void TCG_HELPER_PROTO helper_cvtps2dq(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvtpd2dq(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvtps2pi(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvtpd2pi(uint32_t dst_offset, uint32_t src_offset);
+target_ulong TCG_HELPER_PROTO helper_cvtss2si(uint32_t src_offset);
+target_ulong TCG_HELPER_PROTO helper_cvtsd2si(uint32_t src_offset);
+#ifdef TARGET_X86_64
+target_ulong TCG_HELPER_PROTO helper_cvtss2sq(uint32_t src_offset);
+target_ulong TCG_HELPER_PROTO helper_cvtsd2sq(uint32_t src_offset);
+#endif
+void TCG_HELPER_PROTO helper_cvttps2dq(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvttpd2dq(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvttps2pi(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cvttpd2pi(uint32_t dst_offset, uint32_t src_offset);
+uint32_t TCG_HELPER_PROTO helper_cvttss2si(uint32_t src_offset);
+uint32_t TCG_HELPER_PROTO helper_cvttsd2si(uint32_t src_offset);
+#ifdef TARGET_X86_64
+uint32_t TCG_HELPER_PROTO helper_cvttss2sq(uint32_t src_offset);
+uint32_t TCG_HELPER_PROTO helper_cvttsd2sq(uint32_t src_offset);
+#endif
+void TCG_HELPER_PROTO helper_rsqrtps(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_rsqrtss(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_rcpps(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_rcpss(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_haddps(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_haddpd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_hsubps(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_hsubpd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_addsubps(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_addsubpd(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_cmpeqps(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpltps(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpleps(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpunordps(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpneqps(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpnltps(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpnleps(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpordps(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_cmpeqss(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpltss(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpless(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpunordss(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpneqss(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpnltss(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpnless(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpordss(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_cmpeqpd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpltpd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmplepd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpunordpd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpneqpd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpnltpd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpnlepd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpordpd(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_cmpeqsd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpltsd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmplesd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpunordsd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpneqsd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpnltsd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpnlesd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_cmpordsd(uint32_t dst_offset, uint32_t src_offset);
+
+void TCG_HELPER_PROTO helper_ucomiss(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_comiss(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_ucomisd(uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_comisd(uint32_t dst_offset, uint32_t src_offset);
+uint32_t TCG_HELPER_PROTO helper_movmskps(uint32_t src_offset);
+uint32_t TCG_HELPER_PROTO helper_movmskpd(uint32_t src_offset);
+uint32_t TCG_HELPER_PROTO helper_pmovmskb_xmm(uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pinsrw_xmm (uint32_t dst_offset, uint32_t pos, uint32_t val);
+uint32_t TCG_HELPER_PROTO helper_pextrw_xmm (uint32_t src_offset, uint32_t pos);
+void TCG_HELPER_PROTO helper_packsswb_xmm (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_packuswb_xmm (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_packssdw_xmm (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_punpcklbw_xmm (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_punpcklwd_xmm (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_punpckldq_xmm (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_punpcklqdq_xmm (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_punpckhbw_xmm (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_punpckhwd_xmm (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_punpckhdq_xmm (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_punpckhqdq_xmm (uint32_t dst_offset, uint32_t src_offset);
+
+uint32_t TCG_HELPER_PROTO helper_pmovmskb_mmx(uint32_t src_offset);
+void TCG_HELPER_PROTO helper_pinsrw_mmx (uint32_t dst_offset, uint32_t pos, uint32_t val);
+uint32_t TCG_HELPER_PROTO helper_pextrw_mmx (uint32_t src_offset, uint32_t pos);
+void TCG_HELPER_PROTO helper_packsswb_mmx (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_packuswb_mmx (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_packssdw_mmx (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_punpcklbw_mmx (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_punpcklwd_mmx (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_punpckldq_mmx (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_punpcklqdq_mmx (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_punpckhbw_mmx (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_punpckhwd_mmx (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_punpckhdq_mmx (uint32_t dst_offset, uint32_t src_offset);
+void TCG_HELPER_PROTO helper_punpckhqdq_mmx (uint32_t dst_offset, uint32_t src_offset);
