Boost logo

Boost Users :

From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2005-08-22 08:34:31


Liam Routt wrote:

>I've now run the tests on my x86 system and on the PPC64, with
>differing results. The x86 one passes all the tests. The PPC64:
>
>=====
>...failed updating 5 targets...
>...skipped 5 targets...
>...updated 12 targets...
>=====
>
>The fails seem to be (I'm new at parsing this output):
>
>=====
>smart_ptr_test
>shared_ptr_basic_test
>shared_ptr_test
>weak_ptr_test
>shared_from_this_test
>=====
>
>In the smart_ptr_test and shared_ptr_test output I note a fair number of
>use_count() related error messages, which might indeed indicate that the
>shared_count is a problem area.
>
>I have saved the output and can provide it on request, but I didn't
>think that simply mailing it to the list was necessarily the right step
>to take. What *is* the right step to take next?
>
>
I believe that the shared count is 64-bit on PPC64 (since it is declared
long) but the atomic operations being used on it assume it's 32-bit,
since they were written for PPC32. If you send the log to me I might be
able to tell whether this is the case. May I suggest also that you try
applying the following (wholly untested) patch to
boost/detail/sp_counted_base_gcc_ppc.hpp and re-running the test:

--- sp_counted_base_gcc_ppc.hpp.orig 2005-08-22 14:31:10.315970200 +0100
+++ sp_counted_base_gcc_ppc.hpp 2005-08-22 14:30:47.512073200 +0100
@@ -41,9 +41,9 @@
     __asm__
     (
         "0:\n\t"
- "lwarx %1, 0, %2\n\t"
+ "ldarx %1, 0, %2\n\t"
         "addi %1, %1, 1\n\t"
- "stwcx. %1, 0, %2\n\t"
+ "stdcx. %1, 0, %2\n\t"
         "bne- 0b":

         "=m"( *pw ), "=&b"( tmp ):
@@ -62,9 +62,9 @@
     (
         "sync\n\t"
         "0:\n\t"
- "lwarx %1, 0, %2\n\t"
+ "ldarx %1, 0, %2\n\t"
         "addi %1, %1, -1\n\t"
- "stwcx. %1, 0, %2\n\t"
+ "stdcx. %1, 0, %2\n\t"
         "bne- 0b\n\t"
         "isync":

@@ -86,12 +86,12 @@
     __asm__
     (
         "0:\n\t"
- "lwarx %1, 0, %2\n\t"
- "cmpwi %1, 0\n\t"
+ "ldarx %1, 0, %2\n\t"
+ "cmpdi %1, 0\n\t"
         "beq 1f\n\t"
         "addi %1, %1, 1\n\t"
         "1:\n\t"
- "stwcx. %1, 0, %2\n\t"
+ "stdcx. %1, 0, %2\n\t"
         "bne- 0b":

         "=m"( *pw ), "=&b"( rv ):

Ben.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net