Oscar Fuentes
d4427a6b63
Fixes the Atomic implementation if compiled by MSVC compiler.
...
sys::cas_flag should be long on this platform, InterlockedAdd() is
defined only for the Itanium architecture (according to MSDN).
Patch by Michael Beck!
llvm-svn: 90748
2009-12-07 05:29:59 +00:00
Chandler Carruth
766362c707
Move DataTypes.h to include/llvm/System, update all users. This breaks the last
...
direct inclusion edge from System to Support.
llvm-svn: 85086
2009-10-26 01:35:46 +00:00
Owen Anderson
5bda03a404
Add atomic multiply and divide operations, built on top of CompareAndSwap.
...
llvm-svn: 74004
2009-06-23 21:19:04 +00:00
Owen Anderson
c11dfb46c1
Revert my last series of commits related to Timer and 64-bit atomics. Not all the targets
...
we care about are capable of supporting it.
llvm-svn: 73993
2009-06-23 20:17:22 +00:00
Owen Anderson
c2d02066d0
Atomic ops that do arithmetic use signed arithmetic.
...
llvm-svn: 73980
2009-06-23 18:30:27 +00:00
Owen Anderson
1bea9b9158
Label the existing atomic functions as 32-bit specific, and add a 64-bit one that will be useful in
...
the near future.
llvm-svn: 73971
2009-06-23 18:01:04 +00:00
Owen Anderson
e0ff9fb130
Add an atomic add operation.
...
llvm-svn: 73964
2009-06-23 17:39:31 +00:00
Owen Anderson
3637fc65bd
Use atomic increment/decrement for reference counting of Type's.
...
llvm-svn: 73588
2009-06-17 00:28:49 +00:00
Owen Anderson
430f18d2db
Add an atomic increment and decrement implementation, which will be used for
...
thread-safe reference counting.
llvm-svn: 73587
2009-06-17 00:13:00 +00:00
Bill Wendling
d50f27458f
Untabify.
...
llvm-svn: 72603
2009-05-30 00:58:37 +00:00
Owen Anderson
81e8ddcfda
Use DataTypes.h instead of stdint.h.
...
llvm-svn: 72201
2009-05-21 00:48:13 +00:00
Owen Anderson
2753821fab
Move atomic operations' definitions out of line. While this seems kind of silly,
...
all kinds of problems caused by including windows.h and/or config.h in an LLVM header.
llvm-svn: 72174
2009-05-20 18:26:15 +00:00
Owen Anderson
438c3c3660
Compile fix for MSVC.
...
llvm-svn: 72167
2009-05-20 09:34:13 +00:00
Owen Anderson
d64df37f4c
We need to include config.h here so that the #defines are set properly.
...
llvm-svn: 72148
2009-05-20 00:31:29 +00:00
Owen Anderson
e1474eebee
Split the ENABLE_THREADS #define in two. Now ENABLE_THREADS indicates the ability to run multiple threads at once in the JIT, and requires only
...
mutex support. LLVM_MULTITHREADED indicates (or will indicate) the ability to run LLVM itself across multiple threads, and requires atomics support.
llvm-svn: 72140
2009-05-19 22:18:56 +00:00
Owen Anderson
de192dfaee
Make using an unsupported CAS size a hard error on Windows.
...
llvm-svn: 72088
2009-05-19 01:08:36 +00:00
Owen Anderson
421e290a35
Fix up the Windows portion of Atomic.h. This is untested, but it is my best understanding of what should work.
...
I'd be much obliged if someone on MSVC++ could try this out and let me know if it works.
llvm-svn: 72087
2009-05-19 01:07:40 +00:00
Owen Anderson
e4233e3349
Template CompareAndSwap function.
...
llvm-svn: 72086
2009-05-19 01:02:27 +00:00
Owen Anderson
4d289e72a2
Now that we have atomics support properly detected by configure,
...
use it to implement Atomic.h.
This expunges the code previously imported from libatomic_ops.
llvm-svn: 72077
2009-05-19 00:08:29 +00:00
Owen Anderson
a15fc9a761
Significantly improve Atomic.h by pulling in code from libatomic_ops by HP. This is a little outdated, but reasonably complete.
...
llvm-svn: 71973
2009-05-17 04:57:54 +00:00
Owen Anderson
61d036c993
Remove the volatile marker from the cas_flag typedef, fixing some warnings.
...
It's now the client's resposibility to add it in when needed
llvm-svn: 71959
2009-05-16 21:08:25 +00:00
Anton Korobeynikov
0df5f515ff
Unbreak mingw build
...
llvm-svn: 71856
2009-05-15 11:04:52 +00:00
Owen Anderson
1f8d845588
Improve compatibility with older versions of Windows.
...
llvm-svn: 71855
2009-05-15 10:40:23 +00:00
Owen Anderson
86ba469f0a
(Hopefully) unbreak Apple-style builds.
...
llvm-svn: 71849
2009-05-15 06:49:31 +00:00
Owen Anderson
278050e948
Don't #include OSAtomic.h unless we really need it.
...
llvm-svn: 71837
2009-05-15 05:13:57 +00:00
Owen Anderson
7ded7b9a62
Now with working on Leopard!
...
llvm-svn: 71819
2009-05-15 00:01:40 +00:00
Owen Anderson
a9f74b107a
Dropped this #include by accident.
...
llvm-svn: 71798
2009-05-14 21:33:57 +00:00
Owen Anderson
88d12ab881
Add CompareAndSwap.
...
llvm-svn: 71795
2009-05-14 21:24:15 +00:00
Owen Anderson
c778e8bf21
Add an Atomic.h to the System library, for providing a platform independent API
...
to low-level sync operations.
The only one present at the moment is MemoryFence(), and only for the platforms
for which I could easily discern the proper way to do it. If your favorite platform
isn't represented, patches are welcome!
llvm-svn: 71770
2009-05-14 05:54:36 +00:00