src/hotspot/os_cpu/aix_ppc/atomic_aix_ppc.hpp
author eosterlund
Tue, 26 Sep 2017 14:05:27 +0200
changeset 47552 8a3599d60996
parent 47216 71c04702a3d5
child 47578 09c41c4913d9
permissions -rw-r--r--
8186838: Generalize Atomic::inc/dec with templates Reviewed-by: kbarrett, coleenp, dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
     1
/*
46523
cbcc0ebaa044 8166651: OrderAccess::load_acquire &etc should have const parameters
kbarrett
parents: 40655
diff changeset
     2
 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
35594
cc13089c6327 8147937: Adapt SAP copyrights to new company name.
goetz
parents: 35063
diff changeset
     3
 * Copyright (c) 2012, 2014 SAP SE. All rights reserved.
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
     5
 *
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
     8
 * published by the Free Software Foundation.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
     9
 *
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    14
 * accompanied this code).
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    15
 *
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    19
 *
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    22
 * questions.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    23
 *
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    24
 */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    25
40655
9f644073d3a0 8157907: Incorrect inclusion of atomic.hpp instead of atomic.inline.hpp
dholmes
parents: 39404
diff changeset
    26
#ifndef OS_CPU_AIX_OJDKPPC_VM_ATOMIC_AIX_PPC_HPP
9f644073d3a0 8157907: Incorrect inclusion of atomic.hpp instead of atomic.inline.hpp
dholmes
parents: 39404
diff changeset
    27
#define OS_CPU_AIX_OJDKPPC_VM_ATOMIC_AIX_PPC_HPP
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    28
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    29
#ifndef _LP64
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    30
#error "Atomic currently only impleneted for PPC64"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    31
#endif
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    32
46973
149e5319c938 8186734: AIX build broken after 8186166: Generalize Atomic::cmpxchg with templates
mdoerr
parents: 46958
diff changeset
    33
#include "utilities/debug.hpp"
149e5319c938 8186734: AIX build broken after 8186166: Generalize Atomic::cmpxchg with templates
mdoerr
parents: 46958
diff changeset
    34
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    35
// Implementation of class atomic
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    36
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    37
inline void Atomic::store    (jbyte    store_value, jbyte*    dest) { *dest = store_value; }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    38
inline void Atomic::store    (jshort   store_value, jshort*   dest) { *dest = store_value; }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    39
inline void Atomic::store    (jint     store_value, jint*     dest) { *dest = store_value; }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    40
inline void Atomic::store    (jlong    store_value, jlong*    dest) { *dest = store_value; }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    41
inline void Atomic::store_ptr(intptr_t store_value, intptr_t* dest) { *dest = store_value; }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    42
inline void Atomic::store_ptr(void*    store_value, void*     dest) { *(void**)dest = store_value; }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    43
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    44
inline void Atomic::store    (jbyte    store_value, volatile jbyte*    dest) { *dest = store_value; }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    45
inline void Atomic::store    (jshort   store_value, volatile jshort*   dest) { *dest = store_value; }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    46
inline void Atomic::store    (jint     store_value, volatile jint*     dest) { *dest = store_value; }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    47
inline void Atomic::store    (jlong    store_value, volatile jlong*    dest) { *dest = store_value; }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    48
inline void Atomic::store_ptr(intptr_t store_value, volatile intptr_t* dest) { *dest = store_value; }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    49
inline void Atomic::store_ptr(void*    store_value, volatile void*     dest) { *(void* volatile *)dest = store_value; }
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    50
46523
cbcc0ebaa044 8166651: OrderAccess::load_acquire &etc should have const parameters
kbarrett
parents: 40655
diff changeset
    51
inline jlong Atomic::load(const volatile jlong* src) { return *src; }
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    52
22867
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    53
//
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    54
//   machine barrier instructions:
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    55
//
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    56
//   - ppc_sync            two-way memory barrier, aka fence
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    57
//   - ppc_lwsync          orders  Store|Store,
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    58
//                                  Load|Store,
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    59
//                                  Load|Load,
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    60
//                         but not Store|Load
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    61
//   - ppc_eieio           orders memory accesses for device memory (only)
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    62
//   - ppc_isync           invalidates speculatively executed instructions
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    63
//                         From the POWER ISA 2.06 documentation:
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    64
//                          "[...] an isync instruction prevents the execution of
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    65
//                         instructions following the isync until instructions
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    66
//                         preceding the isync have completed, [...]"
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    67
//                         From IBM's AIX assembler reference:
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    68
//                          "The isync [...] instructions causes the processor to
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    69
//                         refetch any instructions that might have been fetched
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    70
//                         prior to the isync instruction. The instruction isync
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    71
//                         causes the processor to wait for all previous instructions
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    72
//                         to complete. Then any instructions already fetched are
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    73
//                         discarded and instruction processing continues in the
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    74
//                         environment established by the previous instructions."
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    75
//
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    76
//   semantic barrier instructions:
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    77
//   (as defined in orderAccess.hpp)
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    78
//
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    79
//   - ppc_release         orders Store|Store,       (maps to ppc_lwsync)
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    80
//                                 Load|Store
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    81
//   - ppc_acquire         orders  Load|Store,       (maps to ppc_lwsync)
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    82
//                                 Load|Load
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    83
//   - ppc_fence           orders Store|Store,       (maps to ppc_sync)
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    84
//                                 Load|Store,
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    85
//                                 Load|Load,
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    86
//                                Store|Load
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    87
//
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    88
22867
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    89
#define strasm_sync                       "\n  sync    \n"
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    90
#define strasm_lwsync                     "\n  lwsync  \n"
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    91
#define strasm_isync                      "\n  isync   \n"
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    92
#define strasm_release                    strasm_lwsync
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    93
#define strasm_acquire                    strasm_lwsync
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    94
#define strasm_fence                      strasm_sync
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    95
#define strasm_nobarrier                  ""
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
    96
#define strasm_nobarrier_clobber_memory   ""
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    97
46993
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
    98
template<size_t byte_size>
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
    99
struct Atomic::PlatformAdd
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
   100
  : Atomic::AddAndFetch<Atomic::PlatformAdd<byte_size> >
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
   101
{
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
   102
  template<typename I, typename D>
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
   103
  D add_and_fetch(I add_value, D volatile* dest) const;
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
   104
};
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   105
46993
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
   106
template<>
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
   107
template<typename I, typename D>
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
   108
inline D Atomic::PlatformAdd<4>::add_and_fetch(I add_value, D volatile* dest) const {
47091
4cc46bb5057b 8186855: Multiple platforms broken after 8186476: Generalize Atomic::add with templates
glaubitz
parents: 46993
diff changeset
   109
  STATIC_ASSERT(4 == sizeof(I));
4cc46bb5057b 8186855: Multiple platforms broken after 8186476: Generalize Atomic::add with templates
glaubitz
parents: 46993
diff changeset
   110
  STATIC_ASSERT(4 == sizeof(D));
46993
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
   111
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
   112
  D result;
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   113
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   114
  __asm__ __volatile__ (
22867
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
   115
    strasm_lwsync
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   116
    "1: lwarx   %0,  0, %2    \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   117
    "   add     %0, %0, %1    \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   118
    "   stwcx.  %0,  0, %2    \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   119
    "   bne-    1b            \n"
22867
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
   120
    strasm_isync
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   121
    : /*%0*/"=&r" (result)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   122
    : /*%1*/"r" (add_value), /*%2*/"r" (dest)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   123
    : "cc", "memory" );
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   124
46993
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
   125
  return result;
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   126
}
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   127
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   128
46993
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
   129
template<>
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
   130
template<typename I, typename D>
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
   131
inline D Atomic::PlatformAdd<8>::add_and_fetch(I add_value, D volatile* dest) const {
47091
4cc46bb5057b 8186855: Multiple platforms broken after 8186476: Generalize Atomic::add with templates
glaubitz
parents: 46993
diff changeset
   132
  STATIC_ASSERT(8 == sizeof(I));
4cc46bb5057b 8186855: Multiple platforms broken after 8186476: Generalize Atomic::add with templates
glaubitz
parents: 46993
diff changeset
   133
  STATIC_ASSERT(8 == sizeof(D));
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   134
46993
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
   135
  D result;
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   136
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   137
  __asm__ __volatile__ (
22867
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
   138
    strasm_lwsync
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   139
    "1: ldarx   %0,  0, %2    \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   140
    "   add     %0, %0, %1    \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   141
    "   stdcx.  %0,  0, %2    \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   142
    "   bne-    1b            \n"
22867
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
   143
    strasm_isync
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   144
    : /*%0*/"=&r" (result)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   145
    : /*%1*/"r" (add_value), /*%2*/"r" (dest)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   146
    : "cc", "memory" );
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   147
46993
dd0f91c85ffc 8186476: Generalize Atomic::add with templates
eosterlund
parents: 46973
diff changeset
   148
  return result;
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   149
}
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   150
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   151
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   152
inline jint Atomic::xchg(jint exchange_value, volatile jint* dest) {
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   153
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   154
  // Note that xchg_ptr doesn't necessarily do an acquire
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   155
  // (see synchronizer.cpp).
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   156
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   157
  unsigned int old_value;
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   158
  const uint64_t zero = 0;
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   159
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   160
  __asm__ __volatile__ (
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   161
    /* lwsync */
22867
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
   162
    strasm_lwsync
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   163
    /* atomic loop */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   164
    "1:                                                 \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   165
    "   lwarx   %[old_value], %[dest], %[zero]          \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   166
    "   stwcx.  %[exchange_value], %[dest], %[zero]     \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   167
    "   bne-    1b                                      \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   168
    /* isync */
22867
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
   169
    strasm_sync
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   170
    /* exit */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   171
    "2:                                                 \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   172
    /* out */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   173
    : [old_value]       "=&r"   (old_value),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   174
                        "=m"    (*dest)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   175
    /* in */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   176
    : [dest]            "b"     (dest),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   177
      [zero]            "r"     (zero),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   178
      [exchange_value]  "r"     (exchange_value),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   179
                        "m"     (*dest)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   180
    /* clobber */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   181
    : "cc",
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   182
      "memory"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   183
    );
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   184
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   185
  return (jint) old_value;
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   186
}
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   187
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   188
inline intptr_t Atomic::xchg_ptr(intptr_t exchange_value, volatile intptr_t* dest) {
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   189
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   190
  // Note that xchg_ptr doesn't necessarily do an acquire
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   191
  // (see synchronizer.cpp).
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   192
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   193
  long old_value;
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   194
  const uint64_t zero = 0;
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   195
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   196
  __asm__ __volatile__ (
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   197
    /* lwsync */
22867
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
   198
    strasm_lwsync
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   199
    /* atomic loop */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   200
    "1:                                                 \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   201
    "   ldarx   %[old_value], %[dest], %[zero]          \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   202
    "   stdcx.  %[exchange_value], %[dest], %[zero]     \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   203
    "   bne-    1b                                      \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   204
    /* isync */
22867
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
   205
    strasm_sync
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   206
    /* exit */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   207
    "2:                                                 \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   208
    /* out */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   209
    : [old_value]       "=&r"   (old_value),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   210
                        "=m"    (*dest)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   211
    /* in */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   212
    : [dest]            "b"     (dest),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   213
      [zero]            "r"     (zero),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   214
      [exchange_value]  "r"     (exchange_value),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   215
                        "m"     (*dest)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   216
    /* clobber */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   217
    : "cc",
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   218
      "memory"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   219
    );
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   220
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   221
  return (intptr_t) old_value;
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   222
}
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   223
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   224
inline void* Atomic::xchg_ptr(void* exchange_value, volatile void* dest) {
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   225
  return (void*)xchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest);
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   226
}
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   227
39404
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   228
inline void cmpxchg_pre_membar(cmpxchg_memory_order order) {
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   229
  if (order != memory_order_relaxed) {
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   230
    __asm__ __volatile__ (
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   231
      /* fence */
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   232
      strasm_sync
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   233
      );
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   234
  }
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   235
}
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   236
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   237
inline void cmpxchg_post_membar(cmpxchg_memory_order order) {
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   238
  if (order != memory_order_relaxed) {
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   239
    __asm__ __volatile__ (
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   240
      /* fence */
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   241
      strasm_sync
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   242
      );
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   243
  }
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   244
}
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   245
46958
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   246
template<>
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   247
template<typename T>
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   248
inline T Atomic::PlatformCmpxchg<1>::operator()(T exchange_value,
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   249
                                                T volatile* dest,
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   250
                                                T compare_value,
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   251
                                                cmpxchg_memory_order order) const {
46973
149e5319c938 8186734: AIX build broken after 8186166: Generalize Atomic::cmpxchg with templates
mdoerr
parents: 46958
diff changeset
   252
  STATIC_ASSERT(1 == sizeof(T));
35063
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   253
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   254
  // Note that cmpxchg guarantees a two-way memory barrier across
39404
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   255
  // the cmpxchg, so it's really a a 'fence_cmpxchg_fence' if not
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   256
  // specified otherwise (see atomic.hpp).
35063
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   257
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   258
  // Using 32 bit internally.
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   259
  volatile int *dest_base = (volatile int*)((uintptr_t)dest & ~3);
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   260
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   261
#ifdef VM_LITTLE_ENDIAN
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   262
  const unsigned int shift_amount        = ((uintptr_t)dest & 3) * 8;
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   263
#else
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   264
  const unsigned int shift_amount        = ((~(uintptr_t)dest) & 3) * 8;
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   265
#endif
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   266
  const unsigned int masked_compare_val  = ((unsigned int)(unsigned char)compare_value),
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   267
                     masked_exchange_val = ((unsigned int)(unsigned char)exchange_value),
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   268
                     xor_value           = (masked_compare_val ^ masked_exchange_val) << shift_amount;
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   269
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   270
  unsigned int old_value, value32;
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   271
39404
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   272
  cmpxchg_pre_membar(order);
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   273
35063
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   274
  __asm__ __volatile__ (
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   275
    /* simple guard */
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   276
    "   lbz     %[old_value], 0(%[dest])                  \n"
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   277
    "   cmpw    %[masked_compare_val], %[old_value]       \n"
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   278
    "   bne-    2f                                        \n"
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   279
    /* atomic loop */
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   280
    "1:                                                   \n"
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   281
    "   lwarx   %[value32], 0, %[dest_base]               \n"
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   282
    /* extract byte and compare */
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   283
    "   srd     %[old_value], %[value32], %[shift_amount] \n"
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   284
    "   clrldi  %[old_value], %[old_value], 56            \n"
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   285
    "   cmpw    %[masked_compare_val], %[old_value]       \n"
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   286
    "   bne-    2f                                        \n"
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   287
    /* replace byte and try to store */
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   288
    "   xor     %[value32], %[xor_value], %[value32]      \n"
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   289
    "   stwcx.  %[value32], 0, %[dest_base]               \n"
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   290
    "   bne-    1b                                        \n"
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   291
    /* exit */
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   292
    "2:                                                   \n"
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   293
    /* out */
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   294
    : [old_value]           "=&r"   (old_value),
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   295
      [value32]             "=&r"   (value32),
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   296
                            "=m"    (*dest),
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   297
                            "=m"    (*dest_base)
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   298
    /* in */
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   299
    : [dest]                "b"     (dest),
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   300
      [dest_base]           "b"     (dest_base),
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   301
      [shift_amount]        "r"     (shift_amount),
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   302
      [masked_compare_val]  "r"     (masked_compare_val),
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   303
      [xor_value]           "r"     (xor_value),
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   304
                            "m"     (*dest),
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   305
                            "m"     (*dest_base)
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   306
    /* clobber */
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   307
    : "cc",
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   308
      "memory"
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   309
    );
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   310
39404
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   311
  cmpxchg_post_membar(order);
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   312
46958
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   313
  return PrimitiveConversions::cast<T>((unsigned char)old_value);
35063
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   314
}
cb24277be2e7 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents: 25715
diff changeset
   315
46958
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   316
template<>
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   317
template<typename T>
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   318
inline T Atomic::PlatformCmpxchg<4>::operator()(T exchange_value,
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   319
                                                T volatile* dest,
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   320
                                                T compare_value,
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   321
                                                cmpxchg_memory_order order) const {
46973
149e5319c938 8186734: AIX build broken after 8186166: Generalize Atomic::cmpxchg with templates
mdoerr
parents: 46958
diff changeset
   322
  STATIC_ASSERT(4 == sizeof(T));
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   323
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   324
  // Note that cmpxchg guarantees a two-way memory barrier across
39404
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   325
  // the cmpxchg, so it's really a a 'fence_cmpxchg_fence' if not
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   326
  // specified otherwise (see atomic.hpp).
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   327
46958
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   328
  T old_value;
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   329
  const uint64_t zero = 0;
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   330
39404
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   331
  cmpxchg_pre_membar(order);
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   332
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   333
  __asm__ __volatile__ (
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   334
    /* simple guard */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   335
    "   lwz     %[old_value], 0(%[dest])                \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   336
    "   cmpw    %[compare_value], %[old_value]          \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   337
    "   bne-    2f                                      \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   338
    /* atomic loop */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   339
    "1:                                                 \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   340
    "   lwarx   %[old_value], %[dest], %[zero]          \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   341
    "   cmpw    %[compare_value], %[old_value]          \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   342
    "   bne-    2f                                      \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   343
    "   stwcx.  %[exchange_value], %[dest], %[zero]     \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   344
    "   bne-    1b                                      \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   345
    /* exit */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   346
    "2:                                                 \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   347
    /* out */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   348
    : [old_value]       "=&r"   (old_value),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   349
                        "=m"    (*dest)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   350
    /* in */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   351
    : [dest]            "b"     (dest),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   352
      [zero]            "r"     (zero),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   353
      [compare_value]   "r"     (compare_value),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   354
      [exchange_value]  "r"     (exchange_value),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   355
                        "m"     (*dest)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   356
    /* clobber */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   357
    : "cc",
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   358
      "memory"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   359
    );
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   360
39404
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   361
  cmpxchg_post_membar(order);
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   362
46958
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   363
  return old_value;
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   364
}
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   365
46958
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   366
template<>
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   367
template<typename T>
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   368
inline T Atomic::PlatformCmpxchg<8>::operator()(T exchange_value,
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   369
                                                T volatile* dest,
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   370
                                                T compare_value,
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   371
                                                cmpxchg_memory_order order) const {
46973
149e5319c938 8186734: AIX build broken after 8186166: Generalize Atomic::cmpxchg with templates
mdoerr
parents: 46958
diff changeset
   372
  STATIC_ASSERT(8 == sizeof(T));
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   373
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   374
  // Note that cmpxchg guarantees a two-way memory barrier across
39404
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   375
  // the cmpxchg, so it's really a a 'fence_cmpxchg_fence' if not
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   376
  // specified otherwise (see atomic.hpp).
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   377
46958
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   378
  T old_value;
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   379
  const uint64_t zero = 0;
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   380
39404
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   381
  cmpxchg_pre_membar(order);
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   382
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   383
  __asm__ __volatile__ (
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   384
    /* simple guard */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   385
    "   ld      %[old_value], 0(%[dest])                \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   386
    "   cmpd    %[compare_value], %[old_value]          \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   387
    "   bne-    2f                                      \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   388
    /* atomic loop */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   389
    "1:                                                 \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   390
    "   ldarx   %[old_value], %[dest], %[zero]          \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   391
    "   cmpd    %[compare_value], %[old_value]          \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   392
    "   bne-    2f                                      \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   393
    "   stdcx.  %[exchange_value], %[dest], %[zero]     \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   394
    "   bne-    1b                                      \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   395
    /* exit */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   396
    "2:                                                 \n"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   397
    /* out */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   398
    : [old_value]       "=&r"   (old_value),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   399
                        "=m"    (*dest)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   400
    /* in */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   401
    : [dest]            "b"     (dest),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   402
      [zero]            "r"     (zero),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   403
      [compare_value]   "r"     (compare_value),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   404
      [exchange_value]  "r"     (exchange_value),
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   405
                        "m"     (*dest)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   406
    /* clobber */
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   407
    : "cc",
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   408
      "memory"
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   409
    );
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   410
39404
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   411
  cmpxchg_post_membar(order);
d0ad5220e91c 8155949: Support relaxed semantics in cmpxchg
mdoerr
parents: 35594
diff changeset
   412
46958
a13bd8c6b7a2 8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents: 46523
diff changeset
   413
  return old_value;
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   414
}
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   415
22867
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
   416
#undef strasm_sync
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
   417
#undef strasm_lwsync
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
   418
#undef strasm_isync
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
   419
#undef strasm_release
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
   420
#undef strasm_acquire
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
   421
#undef strasm_fence
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
   422
#undef strasm_nobarrier
309bcf262a19 8031319: PPC64: Some fixes in ppc and aix coding.
goetz
parents: 22831
diff changeset
   423
#undef strasm_nobarrier_clobber_memory
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
   424
40655
9f644073d3a0 8157907: Incorrect inclusion of atomic.hpp instead of atomic.inline.hpp
dholmes
parents: 39404
diff changeset
   425
#endif // OS_CPU_AIX_OJDKPPC_VM_ATOMIC_AIX_PPC_HPP