diff options
author | Sandipan Das <sandipan@linux.vnet.ibm.com> | 2017-10-10 12:15:30 +0530 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-10-10 20:16:32 +1100 |
commit | b0490a04e736356e427e227902b17f9927a56caf (patch) | |
tree | dc96af57600fdc47d874e933103265e4dff79233 /init | |
parent | e36a82ee4c514a2f4f8fa30c780ad059282f5d64 (diff) | |
download | op-kernel-dev-b0490a04e736356e427e227902b17f9927a56caf.zip op-kernel-dev-b0490a04e736356e427e227902b17f9927a56caf.tar.gz |
powerpc/lib/sstep: Fix count leading zeros instructions
According to the GCC documentation, the behaviour of __builtin_clz()
and __builtin_clzl() is undefined if the value of the input argument
is zero. Without handling this special case, these builtins have been
used for emulating the following instructions:
* Count Leading Zeros Word (cntlzw[.])
* Count Leading Zeros Doubleword (cntlzd[.])
This fixes the emulated behaviour of these instructions by adding an
additional check for this special case.
Fixes: 3cdfcbfd32b9d ("powerpc: Change analyse_instr so it doesn't modify *regs")
Signed-off-by: Sandipan Das <sandipan@linux.vnet.ibm.com>
Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'init')
0 files changed, 0 insertions, 0 deletions