summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Utility/ARMUtils.h
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-01-24 19:46:32 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-01-24 19:46:32 +0000
commitd8c2a4829807f324d36dfa4a2350f3f7703a8986 (patch)
treeefa29dfadb6a3185503178cb8f1158204abc1787 /lldb/source/Plugins/Process/Utility/ARMUtils.h
parent78c9f78fc9f1f05cc01f73d671a117a481cdb877 (diff)
downloadbcm5719-llvm-d8c2a4829807f324d36dfa4a2350f3f7703a8986.tar.gz
bcm5719-llvm-d8c2a4829807f324d36dfa4a2350f3f7703a8986.zip
Add Encoding T2 & T3 of the PUSH instructions to the g_arm_opcodes table.
Plus add an extra field ARMInstrSize to the table entry type 'ARMOpcode'. llvm-svn: 124140
Diffstat (limited to 'lldb/source/Plugins/Process/Utility/ARMUtils.h')
-rw-r--r--lldb/source/Plugins/Process/Utility/ARMUtils.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/Utility/ARMUtils.h b/lldb/source/Plugins/Process/Utility/ARMUtils.h
index 5b10b31b2f3..137acb40d48 100644
--- a/lldb/source/Plugins/Process/Utility/ARMUtils.h
+++ b/lldb/source/Plugins/Process/Utility/ARMUtils.h
@@ -18,6 +18,18 @@ namespace lldb_private {
// not permitted for many Thumb register specifiers.
static inline bool BadReg(uint32_t n) { return n == 13 || n == 15; }
+// Returns an integer result equal to the number of bits of x that are ones.
+static inline uint32_t BitCount(uint32_t x)
+{
+ // c accumulates the total bits set in x
+ uint32_t c;
+ for (c = 0; x; ++c)
+ {
+ x &= x - 1; // clear the least significant bit set
+ }
+ return c;
+}
+
} // namespace lldb_private
#endif // lldb_ARMUtils_h_
OpenPOWER on IntegriCloud