Changeset 7090 in vbox
- Timestamp:
- Feb 22, 2008 9:12:31 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asm.h
r6782 r7090 2028 2028 uint32_t u32 = (uint32_t)u64; 2029 2029 __asm__ __volatile__(/*"xchgl %%esi, %5\n\t"*/ 2030 "xchgl %%ebx, % 3\n\t"2030 "xchgl %%ebx, %2\n\t" 2031 2031 "1:\n\t" 2032 "lock; cmpxchg8b (%5)\n\t" 2032 "movl (%4), %%eax\n\t" 2033 "movl 4(%4), %%edx\n\t" 2034 "lock; cmpxchg8b (%4)\n\t" 2033 2035 "jnz 1b\n\t" 2034 "xchgl %%ebx, % 3\n\t"2036 "xchgl %%ebx, %2\n\t" 2035 2037 /*"xchgl %%esi, %5\n\t"*/ 2036 2038 : "=A" (u64), 2037 2039 "=m" (*pu64) 2038 : "0" (*pu64), 2039 "m" ( u32 ), 2040 : "m" ( u32 ), 2040 2041 "c" ( (uint32_t)(u64 >> 32) ), 2041 2042 "S" (pu64) ); 2042 2043 # else /* !PIC */ 2043 2044 __asm__ __volatile__("1:\n\t" 2044 "lock; cmpxchg8b %1\n\t" 2045 "movl (%4), %%eax\n\t" 2046 "movl 4(%4), %%edx\n\t" 2047 "lock; cmpxchg8b (%4)\n\t" 2045 2048 "jnz 1b\n\t" 2046 2049 : "=A" (u64), 2047 2050 "=m" (*pu64) 2048 : " 0" (*pu64),2049 " b" ( (uint32_t)u64),2050 " c" ( (uint32_t)(u64 >> 32) ));2051 : "b" ( (uint32_t)u64 ), 2052 "c" ( (uint32_t)(u64 >> 32) ), 2053 "S" (pu64) ); 2051 2054 # endif 2052 2055 # else … … 2056 2059 mov ecx, dword ptr [u64 + 4] 2057 2060 mov edi, pu64 2061 retry: 2058 2062 mov eax, dword ptr [edi] 2059 2063 mov edx, dword ptr [edi + 4] 2060 retry:2061 2064 lock cmpxchg8b [edi] 2062 2065 jnz retry … … 2126 2129 { 2127 2130 mov rbx, dword ptr [u128] 2128 mov rcx, dword ptr [u128 + 4]2131 mov rcx, dword ptr [u128 + 8] 2129 2132 mov rdi, pu128 2133 retry: 2130 2134 mov rax, dword ptr [rdi] 2131 mov rdx, dword ptr [rdi + 4] 2132 retry: 2135 mov rdx, dword ptr [rdi + 8] 2133 2136 lock cmpxchg16b [rdi] 2134 2137 jnz retry 2135 2138 mov dword ptr [u128], rax 2136 mov dword ptr [u128 + 4], rdx2139 mov dword ptr [u128 + 8], rdx 2137 2140 } 2138 2141 # endif
Note:
See TracChangeset
for help on using the changeset viewer.