Bug 405458 - MIPS mkFormVEC arguments swapped?
Summary: MIPS mkFormVEC arguments swapped?
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-13 23:56 UTC by Mark Wielaard
Modified: 2019-03-18 15:52 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.