# HG changeset patch # User Christian Kamm # Date 1222010597 -7200 # Node ID 19cbc612380a9f7fcf139990c0ce961b4ff57def # Parent d97b017a8aef7e66da82da35bf05453ec4588787 Add bool-special cases in tango.core.Atomic. diff -r d97b017a8aef -r 19cbc612380a runtime/llvmdc.diff --- a/runtime/llvmdc.diff Sun Sep 21 17:18:35 2008 +0200 +++ b/runtime/llvmdc.diff Sun Sep 21 17:23:17 2008 +0200 @@ -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: 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 @@ +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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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/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 @@ + { + 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 @@ + { + 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 @@ + { + 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/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 @@ 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/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 @@ 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 @@ {