File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
llvm/include/llvm/Support Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -313,6 +313,34 @@ T reverseBits(T Val) {
313
313
return Val;
314
314
}
315
315
316
+ #if __has_builtin(__builtin_bitreverse8)
317
+ template <>
318
+ inline uint8_t reverseBits<uint8_t >(uint8_t Val) {
319
+ return __builtin_bitreverse8 (Val);
320
+ }
321
+ #endif
322
+
323
+ #if __has_builtin(__builtin_bitreverse16)
324
+ template <>
325
+ inline uint16_t reverseBits<uint16_t >(uint16_t Val) {
326
+ return __builtin_bitreverse16 (Val);
327
+ }
328
+ #endif
329
+
330
+ #if __has_builtin(__builtin_bitreverse32)
331
+ template <>
332
+ inline uint32_t reverseBits<uint32_t >(uint32_t Val) {
333
+ return __builtin_bitreverse32 (Val);
334
+ }
335
+ #endif
336
+
337
+ #if __has_builtin(__builtin_bitreverse64)
338
+ template <>
339
+ inline uint64_t reverseBits<uint64_t >(uint64_t Val) {
340
+ return __builtin_bitreverse64 (Val);
341
+ }
342
+ #endif
343
+
316
344
// NOTE: The following support functions use the _32/_64 extensions instead of
317
345
// type overloading so that signed and unsigned integers can be used without
318
346
// ambiguity.
You can’t perform that action at this time.
0 commit comments