Index: src/assembler.h |
=================================================================== |
--- src/assembler.h (revision 3798) |
+++ src/assembler.h (working copy) |
@@ -506,8 +506,10 @@ |
return -(1 << (n-1)) <= x && x < (1 << (n-1)); |
} |
+static inline bool is_int8(int x) { return is_intn(x, 8); } |
+static inline bool is_int16(int x) { return is_intn(x, 16); } |
+static inline bool is_int18(int x) { return is_intn(x, 18); } |
static inline bool is_int24(int x) { return is_intn(x, 24); } |
-static inline bool is_int8(int x) { return is_intn(x, 8); } |
static inline bool is_uintn(int x, int n) { |
return (x & -(1 << n)) == 0; |
@@ -519,10 +521,21 @@ |
static inline bool is_uint5(int x) { return is_uintn(x, 5); } |
static inline bool is_uint6(int x) { return is_uintn(x, 6); } |
static inline bool is_uint8(int x) { return is_uintn(x, 8); } |
+static inline bool is_uint10(int x) { return is_uintn(x, 10); } |
static inline bool is_uint12(int x) { return is_uintn(x, 12); } |
static inline bool is_uint16(int x) { return is_uintn(x, 16); } |
static inline bool is_uint24(int x) { return is_uintn(x, 24); } |
+static inline bool is_uint26(int x) { return is_uintn(x, 26); } |
+static inline bool is_uint28(int x) { return is_uintn(x, 28); } |
+static inline int NumberOfBitsSet(uint32_t x) { |
+ unsigned int num_bits_set; |
+ for (num_bits_set = 0; x; x >>= 1) { |
+ num_bits_set += x & 1; |
+ } |
+ return num_bits_set; |
+} |
+ |
} } // namespace v8::internal |
#endif // V8_ASSEMBLER_H_ |