Changeset a35b458 in mainline for uspace/lib/c/include/bitops.h
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/bitops.h
r3061bc1 ra35b458 66 66 { 67 67 unsigned int n = 0; 68 68 69 69 if (arg >> 16) { 70 70 arg >>= 16; 71 71 n += 16; 72 72 } 73 73 74 74 if (arg >> 8) { 75 75 arg >>= 8; 76 76 n += 8; 77 77 } 78 78 79 79 if (arg >> 4) { 80 80 arg >>= 4; 81 81 n += 4; 82 82 } 83 83 84 84 if (arg >> 2) { 85 85 arg >>= 2; 86 86 n += 2; 87 87 } 88 88 89 89 if (arg >> 1) { 90 90 arg >>= 1; 91 91 n += 1; 92 92 } 93 93 94 94 return n; 95 95 } … … 98 98 { 99 99 unsigned int n = 0; 100 100 101 101 if (arg >> 32) { 102 102 arg >>= 32; 103 103 n += 32; 104 104 } 105 105 106 106 return (n + fnzb32((uint32_t) arg)); 107 107 }
Note:
See TracChangeset
for help on using the changeset viewer.