Changeset 7817 in vbox
- Timestamp:
- Apr 9, 2008 7:37:23 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/stam.h
r7816 r7817 53 53 */ 54 54 #ifdef __GNUC__ 55 # if defined(RT_ARCH_X86) 56 /* This produces optimal assembler code for x86 but does not work for AMD64 ('A' means 'either rax or rdx') */ 57 # define STAM_GET_TS(u64) __asm__ __volatile__ ("rdtsc\n\t" : "=A" (u64)); 58 # elif defined(RT_ARCH_AMD64) 59 # define STAM_GET_TS(u64) \ 60 do { uint64_t low, high; \ 61 __asm__ __volatile__ ("rdtsc\n\t" : "=a"(low), "=d"(high)); \ 62 (u64) = ((high << 32) | low); \ 63 } while (0) 64 # endif 55 # define STAM_GET_TS(u64) \ 56 __asm__ __volatile__ ("rdtsc\n\t" : "=a" ( ((uint32_t *)&(u64))[0] ), "=d" ( ((uint32_t *)&(u64))[1])) 65 57 #elif _MSC_VER >= 1400 66 58 # pragma intrinsic(__rdtsc)
Note:
See TracChangeset
for help on using the changeset viewer.