http://bugs.winehq.org/show_bug.cgi?id=18787
--- Comment #2 from Patrick Baggett baggett.patrick@gmail.com 2009-06-05 13:50:53 --- No, I haven't tested it, but given the trivial nature of the functions (3-5 instructions), it is sufficient to simply check the instructions generated. Using objdump I find that they all have correct assembly language code. Any x86 programmer may verify the code generated below:
00000060 <interlocked_cmpxchg>: 60: 8b 44 24 0c mov 0xc(%esp),%eax 64: 8b 4c 24 08 mov 0x8(%esp),%ecx 68: 8b 54 24 04 mov 0x4(%esp),%edx 6c: f0 0f b1 0a lock cmpxchg %ecx,(%edx) 70: c3 ret
0000007c <interlocked_cmpxchg_ptr>: 7c: 8b 44 24 0c mov 0xc(%esp),%eax 80: 8b 4c 24 08 mov 0x8(%esp),%ecx 84: 8b 54 24 04 mov 0x4(%esp),%edx 88: f0 0f b1 0a lock cmpxchg %ecx,(%edx) 8c: c3 ret
00000098 <interlocked_cmpxchg64>: 98: 53 push %ebx 99: 56 push %esi 9a: 8b 74 24 0c mov 0xc(%esp),%esi 9e: 8b 5c 24 10 mov 0x10(%esp),%ebx a2: 8b 4c 24 14 mov 0x14(%esp),%ecx a6: 8b 44 24 18 mov 0x18(%esp),%eax aa: 8b 54 24 1c mov 0x1c(%esp),%edx ae: f0 0f c7 0e lock cmpxchg8b (%esi) b2: 5e pop %esi b3: 5b pop %ebx b4: c3 ret
000000c0 <interlocked_xchg>: c0: 8b 44 24 08 mov 0x8(%esp),%eax c4: 8b 54 24 04 mov 0x4(%esp),%edx c8: f0 87 02 lock xchg %eax,(%edx) cb: c3 ret
000000d8 <interlocked_xchg_ptr>: d8: 8b 44 24 08 mov 0x8(%esp),%eax dc: 8b 54 24 04 mov 0x4(%esp),%edx e0: f0 87 02 lock xchg %eax,(%edx) e3: c3 ret
000000f0 <interlocked_xchg_add>: f0: 8b 44 24 08 mov 0x8(%esp),%eax f4: 8b 54 24 04 mov 0x4(%esp),%edx f8: f0 0f c1 02 lock xadd %eax,(%edx) fc: c3 ret