Changeset 58712 in vbox
- Timestamp:
- Nov 16, 2015 10:51:00 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 104140
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asm.h
r58706 r58712 187 187 #elif RT_INLINE_ASM_USES_INTRIN 188 188 # define ASMCompilerBarrier() do { _ReadWriteBarrier(); } while (0) 189 #elif defined(__WATCOMC__) 190 void ASMCompilerBarrier(void); 189 191 #else /* 2003 should have _ReadWriteBarrier() but I guess we're at 2002 level then... */ 190 192 DECLINLINE(void) ASMCompilerBarrier(void) … … 4478 4480 */ 4479 4481 #if RT_INLINE_ASM_EXTERNAL 4480 DECLASM(int ) ASMBitFirstClear(const volatile void *pvBitmap, uint32_t cBits);4481 #else 4482 DECLINLINE(int ) ASMBitFirstClear(const volatile void *pvBitmap, uint32_t cBits)4482 DECLASM(int32_t) ASMBitFirstClear(const volatile void *pvBitmap, uint32_t cBits); 4483 #else 4484 DECLINLINE(int32_t) ASMBitFirstClear(const volatile void *pvBitmap, uint32_t cBits) 4483 4485 { 4484 4486 if (cBits) … … 4633 4635 */ 4634 4636 #if RT_INLINE_ASM_EXTERNAL 4635 DECLASM(int ) ASMBitFirstSet(const volatile void *pvBitmap, uint32_t cBits);4636 #else 4637 DECLINLINE(int ) ASMBitFirstSet(const volatile void *pvBitmap, uint32_t cBits)4637 DECLASM(int32_t) ASMBitFirstSet(const volatile void *pvBitmap, uint32_t cBits); 4638 #else 4639 DECLINLINE(int32_t) ASMBitFirstSet(const volatile void *pvBitmap, uint32_t cBits) 4638 4640 { 4639 4641 if (cBits) … … 4988 4990 * @param cShift How many bits to rotate by. 4989 4991 */ 4992 #ifdef __WATCOMC__ 4993 DECLASM(uint32_t) ASMRotateLeftU32(uint32_t u32, unsigned cShift); 4994 #else 4990 4995 DECLINLINE(uint32_t) ASMRotateLeftU32(uint32_t u32, uint32_t cShift) 4991 4996 { 4992 # if RT_INLINE_ASM_USES_INTRIN4997 # if RT_INLINE_ASM_USES_INTRIN 4993 4998 return _rotl(u32, cShift); 4994 # elif RT_INLINE_ASM_GNU_STYLE && (defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86))4999 # elif RT_INLINE_ASM_GNU_STYLE && (defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)) 4995 5000 __asm__ __volatile__("roll %b1, %0" : "=g" (u32) : "Ic" (cShift), "0" (u32)); 4996 5001 return u32; 4997 # else5002 # else 4998 5003 cShift &= 31; 4999 5004 return (u32 << cShift) | (u32 >> (32 - cShift)); 5000 #endif 5001 } 5005 # endif 5006 } 5007 #endif 5002 5008 5003 5009 … … 5009 5015 * @param cShift How many bits to rotate by. 5010 5016 */ 5017 #ifdef __WATCOMC__ 5018 DECLASM(uint32_t) ASMRotateRightU32(uint32_t u32, unsigned cShift); 5019 #else 5011 5020 DECLINLINE(uint32_t) ASMRotateRightU32(uint32_t u32, uint32_t cShift) 5012 5021 { 5013 # if RT_INLINE_ASM_USES_INTRIN5022 # if RT_INLINE_ASM_USES_INTRIN 5014 5023 return _rotr(u32, cShift); 5015 # elif RT_INLINE_ASM_GNU_STYLE && (defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86))5024 # elif RT_INLINE_ASM_GNU_STYLE && (defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)) 5016 5025 __asm__ __volatile__("rorl %b1, %0" : "=g" (u32) : "Ic" (cShift), "0" (u32)); 5017 5026 return u32; 5018 # else5027 # else 5019 5028 cShift &= 31; 5020 5029 return (u32 >> cShift) | (u32 << (32 - cShift)); 5021 #endif 5022 } 5030 # endif 5031 } 5032 #endif 5023 5033 5024 5034 … … 5099 5109 5100 5110 5111 /* 5112 * Include #pragma aux definitions for Watcom C/C++. 5113 */ 5114 #if defined(__WATCOMC__) && ARCH_BITS == 16 && defined(RT_ARCH_X86) 5115 # include "asm-watcom-x86-16.h" 5116 #elif defined(__WATCOMC__) && ARCH_BITS == 32 && defined(RT_ARCH_X86) 5117 # include "asm-watcom-x86-32.h" 5118 #endif 5119 5120 5101 5121 /** @} */ 5102 5122
Note:
See TracChangeset
for help on using the changeset viewer.