aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--target-i386/ops_sse.h18
-rw-r--r--target-i386/translate.c2
2 files changed, 17 insertions, 3 deletions
diff --git a/target-i386/ops_sse.h b/target-i386/ops_sse.h
index 39c90d0c29..2ba2db3a7b 100644
--- a/target-i386/ops_sse.h
+++ b/target-i386/ops_sse.h
@@ -528,7 +528,7 @@ void OPPROTO glue(op_maskmov, SUFFIX) (void)
s = (Reg *)((char *)env + PARAM2);
for(i = 0; i < (8 << SHIFT); i++) {
if (s->B(i) & 0x80)
- stb(A0, d->B(i));
+ stb(A0 + i, d->B(i));
}
}
@@ -565,6 +565,20 @@ void OPPROTO glue(op_pshufw, SUFFIX) (void)
*d = r;
}
#else
+void OPPROTO op_shufps(void)
+{
+ Reg r, *d, *s;
+ int order;
+ d = (Reg *)((char *)env + PARAM1);
+ s = (Reg *)((char *)env + PARAM2);
+ order = PARAM3;
+ r.L(0) = d->L(order & 3);
+ r.L(1) = d->L((order >> 2) & 3);
+ r.L(2) = s->L((order >> 4) & 3);
+ r.L(3) = s->L((order >> 6) & 3);
+ *d = r;
+}
+
void OPPROTO op_shufpd(void)
{
Reg r, *d, *s;
@@ -572,7 +586,7 @@ void OPPROTO op_shufpd(void)
d = (Reg *)((char *)env + PARAM1);
s = (Reg *)((char *)env + PARAM2);
order = PARAM3;
- r.Q(0) = s->Q(order & 1);
+ r.Q(0) = d->Q(order & 1);
r.Q(1) = s->Q((order >> 1) & 1);
*d = r;
}
diff --git a/target-i386/translate.c b/target-i386/translate.c
index e548387ebd..17ce6fa603 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -2292,7 +2292,7 @@ static GenOpFunc2 *sse_op_table1[256][4] = {
[0x5f] = SSE_FOP(max),
[0xc2] = SSE_FOP(cmpeq),
- [0xc6] = { (GenOpFunc2 *)gen_op_pshufd_xmm, (GenOpFunc2 *)gen_op_shufpd },
+ [0xc6] = { (GenOpFunc2 *)gen_op_shufps, (GenOpFunc2 *)gen_op_shufpd },
/* MMX ops and their SSE extensions */
[0x60] = MMX_OP2(punpcklbw),