Add bool-special cases in tango.core.Atomic.

This commit is contained in:
Christian Kamm
2008-09-21 17:23:17 +02:00
parent 16c32afa18
commit 4f7f53fa04

View File

@@ -1,6 +1,6 @@
Index: object.di
===================================================================
--- object.di (revision 3936)
--- object.di (revision 3939)
+++ object.di (working copy)
@@ -150,6 +150,9 @@
void function() dtor;
@@ -14,7 +14,7 @@ Index: object.di
Index: lib/unittest.sh
===================================================================
--- lib/unittest.sh (revision 3936)
--- lib/unittest.sh (revision 3939)
+++ lib/unittest.sh (working copy)
@@ -18,8 +18,9 @@
--help: This message
@@ -71,7 +71,7 @@ Index: lib/unittest.sh
+fi
Index: lib/common/tango/core/BitManip.d
===================================================================
--- lib/common/tango/core/BitManip.d (revision 3936)
--- lib/common/tango/core/BitManip.d (revision 3939)
+++ lib/common/tango/core/BitManip.d (working copy)
@@ -171,6 +171,10 @@
*/
@@ -86,7 +86,7 @@ Index: lib/common/tango/core/BitManip.d
public import std.intrinsic;
Index: lib/common/tango/core/Thread.d
===================================================================
--- lib/common/tango/core/Thread.d (revision 3936)
--- lib/common/tango/core/Thread.d (revision 3939)
+++ lib/common/tango/core/Thread.d (working copy)
@@ -244,8 +244,29 @@
}
@@ -135,7 +135,7 @@ Index: lib/common/tango/core/Thread.d
popad;
Index: lib/gc/basic/gcx.d
===================================================================
--- lib/gc/basic/gcx.d (revision 3936)
--- lib/gc/basic/gcx.d (revision 3939)
+++ lib/gc/basic/gcx.d (working copy)
@@ -2178,6 +2178,28 @@
__builtin_unwind_init();
@@ -179,7 +179,7 @@ Index: lib/gc/basic/gcx.d
asm
Index: lib/gc/basic/gcbits.d
===================================================================
--- lib/gc/basic/gcbits.d (revision 3936)
--- lib/gc/basic/gcbits.d (revision 3939)
+++ lib/gc/basic/gcbits.d (working copy)
@@ -39,6 +39,10 @@
{
@@ -194,7 +194,7 @@ Index: lib/gc/basic/gcbits.d
version = Asm86;
Index: tango/text/convert/Layout.d
===================================================================
--- tango/text/convert/Layout.d (revision 3936)
--- tango/text/convert/Layout.d (revision 3939)
+++ tango/text/convert/Layout.d (working copy)
@@ -47,6 +47,12 @@
alias void* Arg;
@@ -231,7 +231,7 @@ Index: tango/text/convert/Layout.d
long[64] longargs = void;
Index: tango/core/Vararg.d
===================================================================
--- tango/core/Vararg.d (revision 3936)
--- tango/core/Vararg.d (revision 3939)
+++ tango/core/Vararg.d (working copy)
@@ -15,6 +15,10 @@
{
@@ -246,9 +246,9 @@ Index: tango/core/Vararg.d
/**
Index: tango/core/Atomic.d
===================================================================
--- tango/core/Atomic.d (revision 3936)
--- tango/core/Atomic.d (revision 3939)
+++ tango/core/Atomic.d (working copy)
@@ -270,6 +270,161 @@
@@ -270,6 +270,173 @@
////////////////////////////////////////////////////////////////////////////////
@@ -280,6 +280,10 @@ Index: tango/core/Atomic.d
+ {
+ return cast(T)llvm_atomic_load_add!(size_t)(cast(size_t*)&val, 0);
+ }
+ else static if (is(T == bool))
+ {
+ return llvm_atomic_load_add!(ubyte)(cast(ubyte*)&val, cast(ubyte)0) ? 1 : 0;
+ }
+ else
+ {
+ return llvm_atomic_load_add!(T)(&val, cast(T)0);
@@ -371,6 +375,10 @@ Index: tango/core/Atomic.d
+ {
+ return cast(T)llvm_atomic_load_add!(size_t)(cast(size_t*)&val, 1);
+ }
+ else static if (is(T == bool))
+ {
+ return llvm_atomic_load_add!(ubyte)(cast(ubyte*)&val, 1)?1:0;
+ }
+ else
+ {
+ return llvm_atomic_load_add!(T)(&val, cast(T)1);
@@ -398,6 +406,10 @@ Index: tango/core/Atomic.d
+ {
+ return cast(T)llvm_atomic_load_sub!(size_t)(cast(size_t*)&val, 1);
+ }
+ else static if (is(T == bool))
+ {
+ return llvm_atomic_load_sub!(ubyte)(cast(ubyte*)&val, 1)?1:0;
+ }
+ else
+ {
+ return llvm_atomic_load_sub!(T)(&val, cast(T)1);
@@ -412,7 +424,7 @@ Index: tango/core/Atomic.d
Index: tango/math/Math.d
===================================================================
--- tango/math/Math.d (revision 3936)
--- tango/math/Math.d (revision 3939)
+++ tango/math/Math.d (working copy)
@@ -76,6 +76,14 @@
version = DigitalMars_D_InlineAsm_X86;
@@ -561,7 +573,7 @@ Index: tango/math/Math.d
debug(UnitTest) {
Index: tango/math/internal/BignumX86.d
===================================================================
--- tango/math/internal/BignumX86.d (revision 3936)
--- tango/math/internal/BignumX86.d (revision 3939)
+++ tango/math/internal/BignumX86.d (working copy)
@@ -49,6 +49,8 @@
private:
@@ -574,7 +586,7 @@ Index: tango/math/internal/BignumX86.d
*
Index: tango/stdc/stdlib.d
===================================================================
--- tango/stdc/stdlib.d (revision 3936)
--- tango/stdc/stdlib.d (revision 3939)
+++ tango/stdc/stdlib.d (working copy)
@@ -94,6 +94,11 @@
{
@@ -590,7 +602,7 @@ Index: tango/stdc/stdlib.d
private import gcc.builtins;
Index: tango/stdc/stdarg.d
===================================================================
--- tango/stdc/stdarg.d (revision 3936)
--- tango/stdc/stdarg.d (revision 3939)
+++ tango/stdc/stdarg.d (working copy)
@@ -13,6 +13,10 @@
{