Changeset 62836 in vbox for trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace
- Timestamp:
- Aug 1, 2016 4:50:21 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_subr.c
r62829 r62836 854 854 dt_popc(ulong_t x) 855 855 { 856 #ifdef VBOX 857 # if ARCH_BITS == 32 858 x = x - ((x >> 1) & UINT32_C(0x55555555)); 859 x = (x & UINT32_C(0x33333333)) + ((x >> 2) & UINT32_C(0x33333333)); 860 x = (x + (x >> 4)) & UINT32_C(0x0F0F0F0F); 861 x = x + (x >> 8); 862 x = x + (x >> 16); 863 return (x & 0x3F); 864 # elif ARCH_BITS == 64 865 x = x - ((x >> 1) & UINT64_C(0x5555555555555555)); 866 x = (x & UINT64_C(0x3333333333333333)) + ((x >> 2) & UINT64_C(0x3333333333333333)); 867 x = (x + (x >> 4)) & UINT64_C(0x0F0F0F0F0F0F0F0F); 868 x = x + (x >> 8); 869 x = x + (x >> 16); 870 x = x + (x >> 32); 871 return (x & 0x7F); 872 # else 873 # error "ARCH_BITS" 874 # endif 875 #else /* !VBOX */ 856 876 #ifdef _ILP32 857 877 x = x - ((x >> 1) & 0x55555555UL); … … 871 891 return (x & 0x7F); 872 892 #endif 893 #endif /* !VBOX */ 873 894 } 874 895
Note:
See TracChangeset
for help on using the changeset viewer.