40 #endif |
40 #endif |
41 #ifdef TARGET_COMPILER_xlc |
41 #ifdef TARGET_COMPILER_xlc |
42 # include "utilities/globalDefinitions_xlc.hpp" |
42 # include "utilities/globalDefinitions_xlc.hpp" |
43 #endif |
43 #endif |
44 |
44 |
|
45 #ifndef NOINLINE |
|
46 #define NOINLINE |
|
47 #endif |
|
48 #ifndef ALWAYSINLINE |
|
49 #define ALWAYSINLINE inline |
|
50 #endif |
45 #ifndef PRAGMA_DIAG_PUSH |
51 #ifndef PRAGMA_DIAG_PUSH |
46 #define PRAGMA_DIAG_PUSH |
52 #define PRAGMA_DIAG_PUSH |
47 #endif |
53 #endif |
48 #ifndef PRAGMA_DIAG_POP |
54 #ifndef PRAGMA_DIAG_POP |
49 #define PRAGMA_DIAG_POP |
55 #define PRAGMA_DIAG_POP |
1082 const jlong NoLongBits = 0; // no bits set in a long |
1088 const jlong NoLongBits = 0; // no bits set in a long |
1083 const intptr_t OneBit = 1; // only right_most bit set in a word |
1089 const intptr_t OneBit = 1; // only right_most bit set in a word |
1084 |
1090 |
1085 // get a word with the n.th or the right-most or left-most n bits set |
1091 // get a word with the n.th or the right-most or left-most n bits set |
1086 // (note: #define used only so that they can be used in enum constant definitions) |
1092 // (note: #define used only so that they can be used in enum constant definitions) |
1087 #define nth_bit(n) (n >= BitsPerWord ? 0 : OneBit << (n)) |
1093 #define nth_bit(n) (((n) >= BitsPerWord) ? 0 : (OneBit << (n))) |
1088 #define right_n_bits(n) (nth_bit(n) - 1) |
1094 #define right_n_bits(n) (nth_bit(n) - 1) |
1089 #define left_n_bits(n) (right_n_bits(n) << (n >= BitsPerWord ? 0 : (BitsPerWord - n))) |
1095 #define left_n_bits(n) (right_n_bits(n) << (((n) >= BitsPerWord) ? 0 : (BitsPerWord - (n)))) |
1090 |
1096 |
1091 // bit-operations using a mask m |
1097 // bit-operations using a mask m |
1092 inline void set_bits (intptr_t& x, intptr_t m) { x |= m; } |
1098 inline void set_bits (intptr_t& x, intptr_t m) { x |= m; } |
1093 inline void clear_bits (intptr_t& x, intptr_t m) { x &= ~m; } |
1099 inline void clear_bits (intptr_t& x, intptr_t m) { x &= ~m; } |
1094 inline intptr_t mask_bits (intptr_t x, intptr_t m) { return x & m; } |
1100 inline intptr_t mask_bits (intptr_t x, intptr_t m) { return x & m; } |