2012-01-20 18:45:26 +01:00
|
|
|
--- src/lib/libast/features/aso
|
2012-02-06 13:36:57 +01:00
|
|
|
+++ 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{
|
2012-01-20 18:45:26 +01:00
|
|
|
+ #include <stdint.h>
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
- unsigned int i = 0;
|
|
|
|
- return __sync_fetch_and_add(&i,7);
|
2012-02-06 13:36:57 +01:00
|
|
|
+ uint32_t i = 0;
|
2012-01-20 18:45:26 +01:00
|
|
|
+ uint16_t j = 0;
|
2012-02-06 13:36:57 +01:00
|
|
|
+ uint8_t l = 0;
|
|
|
|
+ return __sync_fetch_and_add(&i,7)+__sync_fetch_and_add(&j,7)+__sync_fetch_and_add(&l,7);
|
2012-01-20 18:45:26 +01:00
|
|
|
}
|
|
|
|
}end && {
|
|
|
|
#define _aso_cas8(p,o,n) __sync_val_compare_and_swap(p,o,n)
|
2012-02-06 13:36:57 +01:00
|
|
|
@@ -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))
|
2012-01-20 18:45:26 +01:00
|
|
|
}
|
|
|
|
elif aso note{ <atomic.h> atomic_cas_64 }end link{
|
|
|
|
+ #include <stdint.h>
|
|
|
|
#include <atomic.h>
|
|
|
|
int main()
|
|
|
|
{
|
2012-02-06 13:36:57 +01:00
|
|
|
@@ -53,6 +60,7 @@ elif aso note{ <atomic.h> atomic_cas_64
|
|
|
|
return atomic_cas_64(&i, 0, 1) != 0 || (atomic_add_32_nv(&j, 1) != 1;-1)
|
2012-01-20 18:45:26 +01:00
|
|
|
}
|
|
|
|
}end && {
|
|
|
|
+ #include <stdint.h>
|
|
|
|
#include <atomic.h>
|
|
|
|
#define _aso_cas8(p,o,n) atomic_cas_8(p,o,n)
|
2012-02-06 13:36:57 +01:00
|
|
|
#define _aso_inc8(p) (atomic_add_8_nv(p,1)-1)
|
|
|
|
@@ -73,6 +81,7 @@ elif aso note{ <atomic.h> atomic_cas_64
|
2012-01-20 18:45:26 +01:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
elif aso note{ <atomic.h> atomic_cas_32 }end link{
|
|
|
|
+ #include <stdint.h>
|
|
|
|
#include <atomic.h>
|
|
|
|
int main()
|
|
|
|
{
|
2012-02-06 13:36:57 +01:00
|
|
|
@@ -80,6 +89,7 @@ elif aso note{ <atomic.h> atomic_cas_32
|
|
|
|
return atomic_cas_32(&i, 0, 1) != 0 || (atomic_add_32_nv(&i, 1) != 1;-1)
|
2012-01-20 18:45:26 +01:00
|
|
|
}
|
|
|
|
}end && {
|
|
|
|
+ #include <stdint.h>
|
|
|
|
#include <atomic.h>
|
|
|
|
#define _aso_cas8(p,o,n) atomic_cas_8(p,o,n)
|
2012-02-06 13:36:57 +01:00
|
|
|
#define _aso_inc8(p) (atomic_add_8_nv(p,1)-1)
|
|
|
|
@@ -93,6 +103,7 @@ elif aso note{ <atomic.h> atomic_cas_32
|
2012-01-20 18:45:26 +01:00
|
|
|
#define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,(uint32_t)o,(uint32_t)n))
|
|
|
|
}
|
|
|
|
elif aso -latomic note{ <atomic.h> atomic_cas_64 with -latomic }end link{
|
|
|
|
+ #include <stdint.h>
|
|
|
|
#include <atomic.h>
|
|
|
|
int main()
|
|
|
|
{
|
2012-02-06 13:36:57 +01:00
|
|
|
@@ -101,6 +112,7 @@ elif aso -latomic note{ <atomic.h> atomi
|
|
|
|
return atomic_cas_64(&i, 0, 1) != 0 || (atomic_add_32_nv(&j, 1) != 1;-1)
|
2012-01-20 18:45:26 +01:00
|
|
|
}
|
|
|
|
}end && {
|
|
|
|
+ #include <stdint.h>
|
|
|
|
#include <atomic.h>
|
|
|
|
#define _REQ_atomic
|
|
|
|
#define _aso_cas8(p,o,n) atomic_cas_8(p,o,n)
|
2012-02-06 13:36:57 +01:00
|
|
|
@@ -122,6 +134,7 @@ elif aso -latomic note{ <atomic.h> atomi
|
2012-01-20 18:45:26 +01:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
elif aso note{ <atomic.h> atomic_cas_32 with -latomic }end link{
|
|
|
|
+ #include <stdint.h>
|
|
|
|
#include <atomic.h>
|
|
|
|
int main()
|
|
|
|
{
|
2012-02-06 13:36:57 +01:00
|
|
|
@@ -129,6 +142,7 @@ elif aso note{ <atomic.h> atomic_cas_32
|
|
|
|
return atomic_cas_32(&i, 0, 1) != 0 || (atomic_add_32_nv(&i, 1) != 1;-1)
|
2012-01-20 18:45:26 +01:00
|
|
|
}
|
|
|
|
}end && {
|
|
|
|
+ #include <stdint.h>
|
|
|
|
#include <atomic.h>
|
|
|
|
#define _REQ_atomic
|
|
|
|
#define _aso_cas8(p,o,n) atomic_cas_8(p,o,n)
|
2012-02-06 13:36:57 +01:00
|
|
|
@@ -143,6 +157,7 @@ elif aso note{ <atomic.h> atomic_cas_32
|
2012-01-20 18:45:26 +01:00
|
|
|
#define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,(uint32_t)o,(uint32_t)n))
|
|
|
|
}
|
|
|
|
elif aso note{ <atomic.h> cas64 }end link{
|
|
|
|
+ #include <stdint.h>
|
|
|
|
#include <atomic.h>
|
|
|
|
int main()
|
|
|
|
{
|
2012-02-06 13:36:57 +01:00
|
|
|
@@ -151,6 +166,7 @@ elif aso note{ <atomic.h> cas64 }end lin
|
|
|
|
return cas64(&i, 0, 1) != 0 || (atomic_add_32_nv(&j, 1) != 1;-1)
|
2012-01-20 18:45:26 +01:00
|
|
|
}
|
|
|
|
}end && {
|
|
|
|
+ #include <stdint.h>
|
|
|
|
#include <atomic.h>
|
|
|
|
#define _aso_cas8(p,o,n) cas8(p,o,n)
|
2012-02-06 13:36:57 +01:00
|
|
|
#define _aso_inc8(p) (atomic_add_8_nv(p,1)-1)
|
|
|
|
@@ -171,6 +187,7 @@ elif aso note{ <atomic.h> cas64 }end lin
|
2012-01-20 18:45:26 +01:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
elif aso note{ <atomic.h> cas32 }end link{
|
|
|
|
+ #include <stdint.h>
|
|
|
|
#include <atomic.h>
|
|
|
|
int main()
|
|
|
|
{
|
2012-02-06 13:36:57 +01:00
|
|
|
@@ -178,6 +195,7 @@ elif aso note{ <atomic.h> cas32 }end lin
|
|
|
|
return cas32(&i, 0, 1) != 0 || (atomic_add_32_nv(&i, 1) != 1;-1)
|
2012-01-20 18:45:26 +01:00
|
|
|
}
|
|
|
|
}end && {
|
|
|
|
+ #include <stdint.h>
|
|
|
|
#include <atomic.h>
|
|
|
|
#define _aso_cas8(p,o,n) cas8(p,o,n)
|
2012-02-06 13:36:57 +01:00
|
|
|
#define _aso_inc8(p) (atomic_add_8_nv(p,1)-1)
|