* Fixed data mangling problems in R5900 COP2 LQC2/SQC2 instructions.
authorFrank Ch. Eigler <fche@redhat.com>
Fri, 17 Apr 1998 19:04:53 +0000 (19:04 +0000)
committerFrank Ch. Eigler <fche@redhat.com>
Fri, 17 Apr 1998 19:04:53 +0000 (19:04 +0000)
sim/mips/ChangeLog
sim/mips/interp.c

index 180210581381319db035486fbd79af2300189495..8bc443c30563be9cdd51ec91220e8aeec2175c10 100644 (file)
@@ -1,4 +1,11 @@
 start-sanitize-sky
+Fri Apr 17 14:50:39 1998  Frank Ch. Eigler  <fche@cygnus.com>
+
+       * r5900.igen (COP_[LS]Q): Transfer COP2 quadwords.
+       * interp.c (cop_[ls]q): Fixes corresponding to above.
+       
+end-sanitize-sky
+start-sanitize-sky
 Thu Apr 16 15:24:14 1998  Frank Ch. Eigler  <fche@cygnus.com>
 
        * interp.c (decode_coproc): Adapt COP2 micro interlock to
index 5ed3d4453b73bd99999c8c8ab97547019b33ff9e..8f45da9fd9748dd7aa0b627382e632d3db619c69 100644 (file)
@@ -2951,18 +2951,18 @@ cop_lq (SIM_DESC sd,
     {
     case 2:
       {
-       unsigned_16 xyzw;
+       int i;
 
        while(vu0_busy())
          vu0_issue(sd);
        
-       memcpy(& xyzw, & memword, sizeof(xyzw));
-       xyzw = H2T_16(xyzw);
        /* one word at a time, argh! */
-       write_vu_vec_reg(&(vu0_device.regs), coproc_reg, 0, A4_16(& xyzw, 3));
-       write_vu_vec_reg(&(vu0_device.regs), coproc_reg, 1, A4_16(& xyzw, 2));
-       write_vu_vec_reg(&(vu0_device.regs), coproc_reg, 2, A4_16(& xyzw, 1));
-       write_vu_vec_reg(&(vu0_device.regs), coproc_reg, 3, A4_16(& xyzw, 0));
+       for(i=0; i<4; i++)
+         {
+           unsigned_4 value;
+           value = H2T_4(*A4_16(& memword, 3-i));
+           write_vu_vec_reg(&(vu0_device.regs), coproc_reg, i, & value);
+         }
       }
     break;
     
@@ -3053,16 +3053,18 @@ cop_sq (SIM_DESC sd,
     case 2:
       {
        unsigned_16 xyzw;
+       int i;
 
        while(vu0_busy())
          vu0_issue(sd);
        
        /* one word at a time, argh! */
-       read_vu_vec_reg(&(vu0_device.regs), coproc_reg, 0, A4_16(& xyzw, 3));
-       read_vu_vec_reg(&(vu0_device.regs), coproc_reg, 1, A4_16(& xyzw, 2));
-       read_vu_vec_reg(&(vu0_device.regs), coproc_reg, 2, A4_16(& xyzw, 1));
-       read_vu_vec_reg(&(vu0_device.regs), coproc_reg, 3, A4_16(& xyzw, 0));
-       xyzw = T2H_16(xyzw);
+       for(i=0; i<4; i++)
+         {
+           unsigned_4 value;
+           read_vu_vec_reg(&(vu0_device.regs), coproc_reg, i, & value);
+           *A4_16(& xyzw, 3-i) = T2H_4(value);
+         }
        return xyzw;
       }
     break;