https://bugs.llvm.org/show_bug.cgi?id=32986
Bug ID: 32986
Summary: Incorrect ROR_C implementation.
Product: lldb
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: lldb-dev@lists.llvm.org
Reporter: and...@inversepath.com
CC: llvm-b...@lists.llvm.org
Hi.
It appears that the ROR_C function, within the common utilities for the
ARM/Thumb Instruction Set Architecture, is incorrectly implemented.
>From lldb/source/Plugins/Process/Utility/ARMUtils.h:
static inline uint32_t ROR_C(const uint32_t value, const uint32_t amount,
uint32_t &carry_out, bool *success) {
...
carry_out = Bit32(value, 31);
...
However according to the ARMv6-M Architecture Reference Manual (page A2-34)
ROR_C is implemented as follows in relation to the carry_out:
...
m = shift MOD N;
result = LSR(x,m) OR LSL(x,N-m);
carry_out = result<N-1>;
...
Therefore I believe that the ROR_C function in ARMUtils.h should use the
result, rather than the value, when setting carry_out:
carry_out = Bit32(result, 31);
A comparable fix was effective in passing tests in another project I
contributed:
https://github.com/abarisani/ARMv6m_Simulator/commit/36e73fb1924edada7d75b15dcf51aa4683f0d729
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev