--- src/lib/libast/features/aso +++ src/lib/libast/features/aso 2012-02-06 11:25:03.897933168 +0100 @@ -5,7 +5,10 @@ if aso note{ gcc 4.1+ 64 bit memory atom int main() { uint64_t i = 0; - return __sync_fetch_and_add(&i,7); + uint32_t j = 0; + uint16_t l = 0; + uint8_t m = 0; + return __sync_fetch_and_add(&i,7)+__sync_fetch_and_add(&j,7)+__sync_fetch_and_add(&l,7)+__sync_fetch_and_add(&m,7); } }end && { #define _aso_cas8(p,o,n) __sync_val_compare_and_swap(p,o,n) @@ -27,10 +30,13 @@ if aso note{ gcc 4.1+ 64 bit memory atom #endif } elif aso note{ gcc 4.1+ 32 bit memory atomic operations model }end link{ + #include int main() { - unsigned int i = 0; - return __sync_fetch_and_add(&i,7); + uint32_t i = 0; + uint16_t j = 0; + uint8_t l = 0; + return __sync_fetch_and_add(&i,7)+__sync_fetch_and_add(&j,7)+__sync_fetch_and_add(&l,7); } }end && { #define _aso_cas8(p,o,n) __sync_val_compare_and_swap(p,o,n) @@ -45,6 +51,7 @@ elif aso note{ gcc 4.1+ 32 bit memory at #define _aso_casptr(p,o,n) ((void*)__sync_val_compare_and_swap(p,(uint32_t)o,(uint32_t)n)) } elif aso note{ atomic_cas_64 }end link{ + #include #include int main() { @@ -53,6 +60,7 @@ elif aso note{ atomic_cas_64 return atomic_cas_64(&i, 0, 1) != 0 || (atomic_add_32_nv(&j, 1) != 1;-1) } }end && { + #include #include #define _aso_cas8(p,o,n) atomic_cas_8(p,o,n) #define _aso_inc8(p) (atomic_add_8_nv(p,1)-1) @@ -73,6 +81,7 @@ elif aso note{ atomic_cas_64 #endif } elif aso note{ atomic_cas_32 }end link{ + #include #include int main() { @@ -80,6 +89,7 @@ elif aso note{ atomic_cas_32 return atomic_cas_32(&i, 0, 1) != 0 || (atomic_add_32_nv(&i, 1) != 1;-1) } }end && { + #include #include #define _aso_cas8(p,o,n) atomic_cas_8(p,o,n) #define _aso_inc8(p) (atomic_add_8_nv(p,1)-1) @@ -93,6 +103,7 @@ elif aso note{ atomic_cas_32 #define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,(uint32_t)o,(uint32_t)n)) } elif aso -latomic note{ atomic_cas_64 with -latomic }end link{ + #include #include int main() { @@ -101,6 +112,7 @@ elif aso -latomic note{ atomi return atomic_cas_64(&i, 0, 1) != 0 || (atomic_add_32_nv(&j, 1) != 1;-1) } }end && { + #include #include #define _REQ_atomic #define _aso_cas8(p,o,n) atomic_cas_8(p,o,n) @@ -122,6 +134,7 @@ elif aso -latomic note{ atomi #endif } elif aso note{ atomic_cas_32 with -latomic }end link{ + #include #include int main() { @@ -129,6 +142,7 @@ elif aso note{ atomic_cas_32 return atomic_cas_32(&i, 0, 1) != 0 || (atomic_add_32_nv(&i, 1) != 1;-1) } }end && { + #include #include #define _REQ_atomic #define _aso_cas8(p,o,n) atomic_cas_8(p,o,n) @@ -143,6 +157,7 @@ elif aso note{ atomic_cas_32 #define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,(uint32_t)o,(uint32_t)n)) } elif aso note{ cas64 }end link{ + #include #include int main() { @@ -151,6 +166,7 @@ elif aso note{ cas64 }end lin return cas64(&i, 0, 1) != 0 || (atomic_add_32_nv(&j, 1) != 1;-1) } }end && { + #include #include #define _aso_cas8(p,o,n) cas8(p,o,n) #define _aso_inc8(p) (atomic_add_8_nv(p,1)-1) @@ -171,6 +187,7 @@ elif aso note{ cas64 }end lin #endif } elif aso note{ cas32 }end link{ + #include #include int main() { @@ -178,6 +195,7 @@ elif aso note{ cas32 }end lin return cas32(&i, 0, 1) != 0 || (atomic_add_32_nv(&i, 1) != 1;-1) } }end && { + #include #include #define _aso_cas8(p,o,n) cas8(p,o,n) #define _aso_inc8(p) (atomic_add_8_nv(p,1)-1)