Bug 341997 - MIPS64: Cavium OCTEON instructions - immediate operand handled incorrectly
Summary: MIPS64: Cavium OCTEON instructions - immediate operand handled incorrectly
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (show other bugs)
Version: 3.10 SVN
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-18 10:01 UTC by Maran Pakkirisamy
Modified: 2015-08-14 09:09 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
fix to correctly handle SNEI and SEQI in VEX (717 bytes, patch)
2014-12-18 10:05 UTC, Maran Pakkirisamy
Details
test case update for SNEI and SEQI (2.33 KB, patch)
2014-12-18 10:11 UTC, Maran Pakkirisamy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maran Pakkirisamy 2014-12-18 10:01:52 UTC
Cavium OCTEON mips instructions SNEI and SEQI extracts the operands from bit field [15:6].
However the VEX implementation of these instructions extract the immediate operands from [15:0] incorrectly.

This caused branches in C programs to fail on valgrind when gcc emitted these instructions.

Reproducible: Always
Comment 1 Maran Pakkirisamy 2014-12-18 10:05:19 UTC
Created attachment 90032 [details]
fix to correctly handle SNEI and SEQI in VEX
Comment 2 Maran Pakkirisamy 2014-12-18 10:11:57 UTC
Created attachment 90033 [details]
test case update for SNEI and SEQI

Update the testcase to validate the matching case (source operand == immediate value).
This case was not present and hence the bug was uncaught.
Comment 3 Julian Seward 2015-02-03 00:22:55 UTC
Peter, can/should this be committed?
Comment 4 Crestez Dan Leonard 2015-03-26 14:37:25 UTC
I am running on octeon2 and can confirm that this patch does fix something useful.

Without this patch ld.so fails to load stuff from /usr/lib because the snei instruction is emulated incorrectly.
Comment 5 Petar Jovanovic 2015-03-28 01:33:25 UTC
(In reply to Maran Pakkirisamy from comment #1)
> Created attachment 90032 [details]
> fix to correctly handle SNEI and SEQI in VEX

Fix applied in r3108. Thank you.

(In reply to Maran Pakkirisamy from comment #2)
> Created attachment 90033 [details]
> test case update for SNEI and SEQI
> 
> Update the testcase to validate the matching case (source operand ==
> immediate value).
> This case was not present and hence the bug was uncaught.

The test updated, r15043. Thanks.
Comment 6 Petar Jovanovic 2015-03-28 01:34:08 UTC
(In reply to Julian Seward from comment #3)
> Peter, can/should this be committed?

Done. We can close the issue now.