| 156 | } |
| 157 | |
| 158 | int determine_ptr_alignment(uint64_t ptrval) { |
| 159 | if(ptrval == 0) |
| 160 | return 0; |
| 161 | |
| 162 | #if defined(__GNUC__) && !defined(__llvm__) && !defined(__INTEL_COMPILER) && \ |
| 163 | !defined(__NVCOMPILER) |
| 164 | // gcc supports __builtin_ctz, but versions prior to 10 |
| 165 | // do not support __has_builtin |
| 166 | #define ACPP_HAS_BUILTIN_CTZ |
| 167 | #else |
| 168 | #if __has_builtin(__builtin_ctzll) |
| 169 | #define ACPP_HAS_BUILTIN_CTZ |
| 170 | #endif |
| 171 | #endif |
| 172 | |
| 173 | #ifdef ACPP_HAS_BUILTIN_CTZ |
| 174 | uint64_t alignment = 1ull << __builtin_ctzll(ptrval); |
| 175 | return alignment >= 32 ? 32 : 0; |
| 176 | #else |
| 177 | return 0; |
| 178 | #endif |
| 179 | } |
| 180 | |
| 181 | } |
| 182 |
no outgoing calls
no test coverage detected