target-mips: special3 instruction dinsm translation error
Bug #1071149 reported by
Nikita Kanunnikov
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Function decode_opc() in translate.c calls function gen_bitops(), which has such prototype:
/* special3 bitfield operations */
static void gen_bitops (DisasContext *ctx, uint32_t opc, int rt,
The code for DINSM instruction is:
case OPC_DINSM ... OPC_DINS:
break;
But rd ≠ msb according to MIPS64R2 standard, rd = msb - 32.
Changed in qemu: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
That's why in gen_bitops() does later:
case OPC_DINSM:
if (lsb > msb)
goto fail;
mask = ((msb - lsb + 1 + 32 < 64) ? ((1ULL << (msb - lsb + 1 + 32)) - 1) : ~0ULL) << lsb;
...
case OPC_DINSU:
if (lsb > msb)
goto fail;
mask = ((1ULL << (msb - lsb + 1)) - 1) << (lsb + 32);
...
case OPC_DINS:
gen_load_ gpr(t0, rt);
if (lsb > msb)
goto fail;
mask = ((1ULL << (msb - lsb + 1)) - 1) << lsb;
For me there is no bug there, but if you believe the contrary, please send a testcase.