Opened 14 years ago
Closed 14 years ago
#2885 closed Patches (fixed)
[smart_ptr] g++/MIPS support for lockless sp_counted_base
Reported by: | Owned by: | Peter Dimov | |
---|---|---|---|
Milestone: | Boost 1.39.0 | Component: | smart_ptr |
Version: | Boost 1.38.0 | Severity: | Optimization |
Keywords: | Cc: |
Description
Submitting a patch for your consideration. It contains an implementation of a lockless sp_counted_base for g++/MIPS platforms. This code has been used extensively for the last two years without issues.
Attachments (2)
Change History (12)
by , 14 years ago
Attachment: | boost_1_38_0.sp_counted_base_mips.patch added |
---|
comment:1 by , 14 years ago
Status: | new → assigned |
---|
comment:3 by , 14 years ago
No good reason. ;)
This inline assembly was originally written for atomic subtraction rather than atomic decrement, thus the extra input parameter to the asm block. I believe GNU's as converts "subu %0, %1, 1" to "addiu %0, %1, -1" on the fly however I'm okay with changing this to addiu.
Would you like to me to reattach the patch?
As far as g++/MIPS support for __sync
, the newest g++/MIPS toolchain I have access to is 4.1.2 and they are not implemented there.
comment:4 by , 14 years ago
Would you like to me to reattach the patch?
Yes please.
Actually, just attach sp_counted_base_gcc_mips.hpp. The headers have been moved for 1.39 so the patch will not apply cleanly anyway.
Are you interested in fixing spinlock.hpp as well?
by , 14 years ago
Attachment: | sp_counted_base_gcc_mips.hpp added |
---|
comment:5 by , 14 years ago
Reattached.
We don't use user-mode spinlocks - we don't have the priority schemes in place to make it safe - so I can't help you there. Sorry.
comment:6 by , 14 years ago
comment:7 by , 14 years ago
I've applied your patch to the SVN trunk; thanks again. If everything looks (and tests) OK for you, I'll merge the changes to the release branch so that they surface in 1.39.
comment:8 by , 14 years ago
Tried the build from SVN trunk. The #include
of sp_typeinfo.hpp
needs minor fixup:
-#include "sp_typeinfo.hpp" +#include <boost/detail/sp_typeinfo.hpp>
Compiles fine after that change.
comment:10 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Thanks.
Is there a reason you use subu with a temp register instead of addiu with -1 in atomic_decrement?