Changeset 7633 in vbox
- Timestamp:
- Mar 28, 2008 5:07:09 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 29137
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asm.h
r7182 r7633 3870 3870 DECLINLINE(void *) ASMMemIsAll8(void const *pv, size_t cb, uint8_t u8) 3871 3871 { 3872 /** @todo rewrite this in inline assembly .*/3872 /** @todo rewrite this in inline assembly? */ 3873 3873 uint8_t const *pb = (uint8_t const *)pv; 3874 3874 for (; cb; cb--, pb++) … … 3879 3879 #endif 3880 3880 3881 3882 /** 3883 * Checks if a memory block is filled with the specified 32-bit value. 3884 * 3885 * This is a sort of inverted memchr. 3886 * 3887 * @returns Pointer to the first value which doesn't equal u32. 3888 * @returns NULL if all equal to u32. 3889 * 3890 * @param pv Pointer to the memory block. 3891 * @param cb Number of bytes in the block. This MUST be aligned on 32-bit! 3892 * @param u32 The value it's supposed to be filled with. 3893 */ 3894 #if RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN 3895 DECLASM(uint32_t *) ASMMemIsAllU32(void const *pv, size_t cb, uint32_t u32); 3896 #else 3897 DECLINLINE(uint32_t *) ASMMemIsAllU32(void const *pv, size_t cb, uint32_t u32) 3898 { 3899 /** @todo rewrite this in inline assembly? */ 3900 uint32_t const *pu32 = (uint32_t const *)pv; 3901 for (; cb; cb -= 4, pu32++) 3902 if (RT_UNLIKELY(*pu32 != u32)) 3903 return (uint32_t *)pu32; 3904 return NULL; 3905 } 3906 #endif 3881 3907 3882 3908
Note:
See TracChangeset
for help on using the changeset viewer.