
On Tue, 30 Mar 2010, Khiszinsky, Maxim wrote:
Steven Watanabe wrote:
The problem is that the compiler (in some cases) generates case-based code when 'order' parameter is constant for caller
Have you actually observed this? On which compilers?
MS Visual C++ 2008, GCC 4.3
I can't second this. Sure, if you turn optimization off, code looks ridiculous. Both gcc (tested with various versions ranging from 3.3 to 4.4) and msvc (visual studio express) optimize the switch/case with constant operand into nothingness. Whether templating helps is somewhat besiders the point if the C++0x interface for atomic operations is specified to use parameters. I would however be very interested in sparc and ia64 atomic operations, would you be interested in implementing (or lending me a hand) them for boost.atomic? Best regards, Helge