1 |
jlec 12/05/29 18:52:21 |
2 |
|
3 |
Added: libatomic_ops-7.2_alpha6-x32.patch |
4 |
Log: |
5 |
Version Bump |
6 |
|
7 |
(Portage version: 2.2.0_alpha108/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 dev-libs/libatomic_ops/files/libatomic_ops-7.2_alpha6-x32.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libatomic_ops/files/libatomic_ops-7.2_alpha6-x32.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libatomic_ops/files/libatomic_ops-7.2_alpha6-x32.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: libatomic_ops-7.2_alpha6-x32.patch |
16 |
=================================================================== |
17 |
Adopted from |
18 |
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=e3a384578f677c05d812d99c2c92aa13670bd06a |
19 |
|
20 |
Upstream-Status: Pending |
21 |
|
22 |
Remove the `q' suffix on x86-64 atomic instructions. |
23 |
|
24 |
We don't need the `q' suffix on x86_64 atomic instructions for AO_t, |
25 |
which is defined as "unsigned long". "unsigned long" is 32bit for x32 |
26 |
and 64bit for x86-64. The register operand in x86-64 atomic instructions |
27 |
is sufficient to properly determine the register size. |
28 |
|
29 |
Received this patch from H.J. Lu <hjl.tools@×××××.com> |
30 |
Signed-Off-By: Nitin A Kamble <nitin.a.kamble@×××××.com> 2011/12/02 |
31 |
|
32 |
diff --git a/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h b/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h |
33 |
index 0f68c1e..3bcde88 100644 |
34 |
--- a/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h |
35 |
+++ b/libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h |
36 |
@@ -47,7 +47,7 @@ AO_fetch_and_add_full (volatile AO_t *p, AO_t incr) |
37 |
{ |
38 |
AO_t result; |
39 |
|
40 |
- __asm__ __volatile__ ("lock; xaddq %0, %1" : |
41 |
+ __asm__ __volatile__ ("lock; xadd %0, %1" : |
42 |
"=r" (result), "=m" (*p) : "0" (incr), "m" (*p) |
43 |
: "memory"); |
44 |
return result; |
45 |
@@ -93,7 +93,7 @@ AO_int_fetch_and_add_full (volatile unsigned int *p, unsigned int incr) |
46 |
AO_INLINE void |
47 |
AO_or_full (volatile AO_t *p, AO_t incr) |
48 |
{ |
49 |
- __asm__ __volatile__ ("lock; orq %1, %0" : |
50 |
+ __asm__ __volatile__ ("lock; or %1, %0" : |
51 |
"=m" (*p) : "r" (incr), "m" (*p) : "memory"); |
52 |
} |
53 |
#define AO_HAVE_or_full |
54 |
@@ -123,7 +123,7 @@ AO_compare_and_swap_full(volatile AO_t *addr, AO_t old, AO_t new_val) |
55 |
return (int)__sync_bool_compare_and_swap(addr, old, new_val); |
56 |
# else |
57 |
char result; |
58 |
- __asm__ __volatile__("lock; cmpxchgq %3, %0; setz %1" |
59 |
+ __asm__ __volatile__("lock; cmpxchg %3, %0; setz %1" |
60 |
: "=m" (*addr), "=a" (result) |
61 |
: "m" (*addr), "r" (new_val), "a" (old) : "memory"); |
62 |
return (int) result; |