- Timestamp:
- Sep 7, 2015 4:39:39 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asm.h
r56291 r57647 4363 4363 int iEnd = iBitEnd & ~31; 4364 4364 if (iStart == iEnd) 4365 *pu32 |= ((1 << (iBitEnd - iBitStart)) - 1) << iBitStart;4365 *pu32 |= ((1 << (iBitEnd - iBitStart)) - 1) << (iBitStart & 31); 4366 4366 else 4367 4367 { -
trunk/src/VBox/Runtime/testcase/tstRTBitOperations.cpp
r57358 r57647 164 164 CHECK_GUARD(p); 165 165 166 /* set */166 /* bit set */ 167 167 MAP_CLEAR(p); 168 168 ASMBitSet(&p->au32[0], 0); … … 187 187 CHECK(!ASMAtomicBitTestAndSet(&p->au32[0], 80) && p->au32[2] == 0x00010001U); 188 188 189 /* clear */189 /* bit clear */ 190 190 MAP_SET(p); 191 191 ASMBitClear(&p->au32[0], 0); … … 209 209 CHECK(!ASMAtomicBitTestAndClear(&p->au32[0], 16) && p->au32[0] == ~0x40010001U); 210 210 CHECK(ASMAtomicBitTestAndClear(&p->au32[0], 80) && p->au32[2] == ~0x00010001U); 211 212 /* range set */ 213 MAP_CLEAR(p); 214 ASMBitSetRange(&p->au32[0], 0, 5); 215 ASMBitSetRange(&p->au32[0], 6, 44); 216 ASMBitSetRange(&p->au32[0], 64, 65); 217 CHECK(p->au32[0] == 0xFFFFFFDFU); 218 CHECK(p->au32[1] == 0x00000FFFU); 219 CHECK(p->au32[2] == 0x00000001U); 211 220 212 221 /* toggle */
Note:
See TracChangeset
for help on using the changeset viewer.