]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Power PC Fix V bit error in 128-bit BCD add and subtract instructions
authorCarl Love <cel@us.ibm.com>
Tue, 26 Apr 2016 19:53:56 +0000 (19:53 +0000)
committerCarl Love <cel@us.ibm.com>
Tue, 26 Apr 2016 19:53:56 +0000 (19:53 +0000)
commitb52e8b1c78aa752a6121700a7148bc19e93b3e7c
tree3f0975f9688505affba3c9ecd7e20dd357f694fb
parent8b6b6958e25c551fa80596ae21a6b570117f67fa
Power PC  Fix V bit error in 128-bit BCD add and subtract instructions

The original code was using the bcdadd / bcdsub instruction on the operand
shadow bits to calculate the shadow bits for the result.  This introduced
non-zero bits shadow bits in the result.   The shadow bits for these
instructions should be set to all valid or all invalid.  If one of the
argument shadow bits was one, then all of the shadow bits of the result should
be one.  Otherwise the result shadow bits should be zero.

This patch fixes the above bug in memcheck/mc_translate.c

Fixing the above bug broke the v-bit test.  The issue is the v-bit tester
assumes the shadow bits for the operands of a given Iop can be set to one
for testing purposes.  The implementation of the bcdadd and bcdsub was passing
a constant value for the variable ps.  The ps value is an argument to the
instruction that specifies how to set the sign code of the result.  The
implementation of the instructions was changed to issue the instruction with
ps=0.  Then the result of the instruction is updated in the VEX code if ps=1.
This changed also results in cleaning up the vbit test code.

This patch also fixes the issues with the v-bit test program.

Valgrind commit 3218

Bugzilla 360035

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15871
memcheck/mc_translate.c
memcheck/tests/vbit-test/irops.c
memcheck/tests/vbit-test/main.c
memcheck/tests/vbit-test/ternary.c