]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
mips64: extract correct immediate value for Cavium SEQI and SNEI
authorPetar Jovanovic <mips32r2@gmail.com>
Sat, 28 Mar 2015 01:20:02 +0000 (01:20 +0000)
committerPetar Jovanovic <mips32r2@gmail.com>
Sat, 28 Mar 2015 01:20:02 +0000 (01:20 +0000)
Extract immediate value from bit fields [15:6] instead of [15:0].
This fixes the issue reported in BZ #341997.

Related Valgrind commit - r15043.

Patch by Maran Pakkirisamy.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3108

VEX/priv/guest_mips_toIR.c

index bfc9124c7478b28bf4ffca0aaf341ffca84fc97d..8e94298142181d7d29f57057a77a13210248df2e 100644 (file)
@@ -2239,7 +2239,10 @@ static Bool dis_instr_CVM ( UInt theInstr )
    UChar  regRs    = get_rs(theInstr);
    UChar  regRt    = get_rt(theInstr);
    UChar  regRd    = get_rd(theInstr);
-   UInt   imm      = get_imm(theInstr);
+   /* MIPS trap instructions extract code from theInstr[15:6].
+      Cavium OCTEON instructions SNEI, SEQI extract immediate operands
+      from the same bit field [15:6]. */
+   UInt   imm      = get_code(theInstr);
    UChar  lenM1    = get_msb(theInstr);
    UChar  p        = get_lsb(theInstr);
    IRType ty       = mode64? Ity_I64 : Ity_I32;