Changeset 52454 in vbox for trunk/include/iprt
- Timestamp:
- Aug 22, 2014 7:12:23 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asm-math.h
r52443 r52454 324 324 * Multiple a 32-bit by a 32-bit integer and divide the result by a 32-bit integer 325 325 * using a 64 bit intermediate result. 326 * @note Don't use 64-bit C arithmetic here since some gcc compilers generate references to327 * __udivdi3 and __umoddi3 even if this inline function is not used.328 326 * 329 327 * @returns (u32A * u32B) / u32C. … … 334 332 * @remarks Architecture specific. 335 333 */ 336 #if RT_INLINE_ASM_EXTERNAL || !defined(__GNUC__) || (!defined(RT_ARCH_AMD64) && !defined(RT_ARCH_X86))334 #if RT_INLINE_ASM_EXTERNAL && (defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)) 337 335 DECLASM(uint32_t) ASMMultU32ByU32DivByU32(uint32_t u32A, uint32_t u32B, uint32_t u32C); 338 336 #else 339 337 DECLINLINE(uint32_t) ASMMultU32ByU32DivByU32(uint32_t u32A, uint32_t u32B, uint32_t u32C) 340 338 { 341 # if RT_INLINE_ASM_GNU_STYLE 339 # if RT_INLINE_ASM_GNU_STYLE && (defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)) 342 340 uint32_t u32Result, u32Spill; 343 __asm__ __volatile__("mul %2\n\t"344 "div %3\n\t"341 __asm__ __volatile__("mull %2\n\t" 342 "divl %3\n\t" 345 343 : "=&a" (u32Result), 346 344 "=&d" (u32Spill)
Note:
See TracChangeset
for help on using the changeset viewer.