Bug 405458

Summary: MIPS mkFormVEC arguments swapped?
Product: [Developer tools] valgrind Reporter: Mark Wielaard <mark>
Component: vexAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal CC: mips32r2
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Mark Wielaard 2019-03-13 23:56:21 UTC
The following function in VEX/priv/host_mips_defs.c

static UChar *mkFormVEC(UChar *p, UInt op, UInt ws, UInt wt, UInt wd) {
   UInt theInstr;
   vassert(op  < 0x20);
   vassert(wt  < 0x20);
   vassert(ws  < 0x20);
   vassert(wd  < 0x20);
   theInstr = OPC_MSA | (op << 21) | (wt << 16) | (ws << 11) |
              (wd << 6) | 0x1E;
   return emit32(p, theInstr);
}

And the use in:

      case Msa_VEC: {
            UInt v_wt = qregEnc(i->Min.MsaVec.wt);
            UInt v_ws = qregEnc(i->Min.MsaVec.ws);
            UInt v_wd = qregEnc(i->Min.MsaVec.wd);
            p = mkFormVEC(p, i->Min.MsaVec.op, v_wt, v_ws, v_wd);
            goto done;
         }

Looks like they swap the arguments wt and ws.