Commit d52cf7a64afb766b2b9a88738353bb5ec810b328

Authored by bellard
1 parent bb2d5314

sse fix


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1224 c046a42c-6fe2-441c-8c8c-71466251a162
target-i386/ops_sse.h
... ... @@ -528,7 +528,7 @@ void OPPROTO glue(op_maskmov, SUFFIX) (void)
528 528 s = (Reg *)((char *)env + PARAM2);
529 529 for(i = 0; i < (8 << SHIFT); i++) {
530 530 if (s->B(i) & 0x80)
531   - stb(A0, d->B(i));
  531 + stb(A0 + i, d->B(i));
532 532 }
533 533 }
534 534  
... ... @@ -565,6 +565,20 @@ void OPPROTO glue(op_pshufw, SUFFIX) (void)
565 565 *d = r;
566 566 }
567 567 #else
  568 +void OPPROTO op_shufps(void)
  569 +{
  570 + Reg r, *d, *s;
  571 + int order;
  572 + d = (Reg *)((char *)env + PARAM1);
  573 + s = (Reg *)((char *)env + PARAM2);
  574 + order = PARAM3;
  575 + r.L(0) = d->L(order & 3);
  576 + r.L(1) = d->L((order >> 2) & 3);
  577 + r.L(2) = s->L((order >> 4) & 3);
  578 + r.L(3) = s->L((order >> 6) & 3);
  579 + *d = r;
  580 +}
  581 +
568 582 void OPPROTO op_shufpd(void)
569 583 {
570 584 Reg r, *d, *s;
... ... @@ -572,7 +586,7 @@ void OPPROTO op_shufpd(void)
572 586 d = (Reg *)((char *)env + PARAM1);
573 587 s = (Reg *)((char *)env + PARAM2);
574 588 order = PARAM3;
575   - r.Q(0) = s->Q(order & 1);
  589 + r.Q(0) = d->Q(order & 1);
576 590 r.Q(1) = s->Q((order >> 1) & 1);
577 591 *d = r;
578 592 }
... ...
target-i386/translate.c
... ... @@ -2292,7 +2292,7 @@ static GenOpFunc2 *sse_op_table1[256][4] = {
2292 2292 [0x5f] = SSE_FOP(max),
2293 2293  
2294 2294 [0xc2] = SSE_FOP(cmpeq),
2295   - [0xc6] = { (GenOpFunc2 *)gen_op_pshufd_xmm, (GenOpFunc2 *)gen_op_shufpd },
  2295 + [0xc6] = { (GenOpFunc2 *)gen_op_shufps, (GenOpFunc2 *)gen_op_shufpd },
2296 2296  
2297 2297 /* MMX ops and their SSE extensions */
2298 2298 [0x60] = MMX_OP2(punpcklbw),
... ...