src/hotspot/os_cpu/aix_ppc/orderAccess_aix_ppc.hpp
author stefank
Mon, 25 Nov 2019 12:22:13 +0100
changeset 59247 56bf71d64d51
parent 54707 8390399b09f9
permissions -rw-r--r--
8234562: Move OrderAccess::release_store*/load_acquire to Atomic Reviewed-by: rehn, 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
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 51050
diff changeset
     2
 * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
54707
8390399b09f9 8223248: [AIX] Remove old xlC 10 workaround for load acquire
mdoerr
parents: 54323
diff changeset
     3
 * Copyright (c) 2012, 2019 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
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 51050
diff changeset
    26
#ifndef OS_CPU_AIX_PPC_ORDERACCESS_AIX_PPC_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 51050
diff changeset
    27
#define OS_CPU_AIX_PPC_ORDERACCESS_AIX_PPC_HPP
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    28
50429
83aec1d357d4 8204301: Make OrderAccess functions available to hpp rather than inline.hpp files
coleenp
parents: 49364
diff changeset
    29
// Included in orderAccess.hpp header file.
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    30
29456
cc1c5203e60d 7143664: Clean up OrderAccess implementations and usage
dholmes
parents: 25715
diff changeset
    31
// Compiler version last used for testing: xlc 12
cc1c5203e60d 7143664: Clean up OrderAccess implementations and usage
dholmes
parents: 25715
diff changeset
    32
// Please update this information when this file changes
cc1c5203e60d 7143664: Clean up OrderAccess implementations and usage
dholmes
parents: 25715
diff changeset
    33
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    34
// Implementation of class OrderAccess.
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    35
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
// Machine barrier instructions:
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    38
//
22861
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    39
// - sync            Two-way memory barrier, aka fence.
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    40
// - lwsync          orders  Store|Store,
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    41
//                            Load|Store,
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    42
//                            Load|Load,
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    43
//                   but not Store|Load
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    44
// - eieio           orders  Store|Store
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    45
// - isync           Invalidates speculatively executed instructions,
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    46
//                   but isync may complete before storage accesses
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    47
//                   associated with instructions preceding isync have
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    48
//                   been performed.
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    49
//
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    50
// Semantic barrier instructions:
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    51
// (as defined in orderAccess.hpp)
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    52
//
22861
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    53
// - release         orders Store|Store,       (maps to lwsync)
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    54
//                           Load|Store
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    55
// - acquire         orders  Load|Store,       (maps to lwsync)
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    56
//                           Load|Load
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    57
// - fence           orders Store|Store,       (maps to sync)
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    58
//                           Load|Store,
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    59
//                           Load|Load,
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    60
//                          Store|Load
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    61
//
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    62
22861
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    63
#define inlasm_sync()     __asm__ __volatile__ ("sync"   : : : "memory");
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    64
#define inlasm_lwsync()   __asm__ __volatile__ ("lwsync" : : : "memory");
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    65
#define inlasm_eieio()    __asm__ __volatile__ ("eieio"  : : : "memory");
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    66
#define inlasm_isync()    __asm__ __volatile__ ("isync"  : : : "memory");
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    67
29456
cc1c5203e60d 7143664: Clean up OrderAccess implementations and usage
dholmes
parents: 25715
diff changeset
    68
inline void OrderAccess::loadload()   { inlasm_lwsync(); }
cc1c5203e60d 7143664: Clean up OrderAccess implementations and usage
dholmes
parents: 25715
diff changeset
    69
inline void OrderAccess::storestore() { inlasm_lwsync(); }
cc1c5203e60d 7143664: Clean up OrderAccess implementations and usage
dholmes
parents: 25715
diff changeset
    70
inline void OrderAccess::loadstore()  { inlasm_lwsync(); }
cc1c5203e60d 7143664: Clean up OrderAccess implementations and usage
dholmes
parents: 25715
diff changeset
    71
inline void OrderAccess::storeload()  { inlasm_sync();   }
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    72
29456
cc1c5203e60d 7143664: Clean up OrderAccess implementations and usage
dholmes
parents: 25715
diff changeset
    73
inline void OrderAccess::acquire()    { inlasm_lwsync(); }
cc1c5203e60d 7143664: Clean up OrderAccess implementations and usage
dholmes
parents: 25715
diff changeset
    74
inline void OrderAccess::release()    { inlasm_lwsync(); }
cc1c5203e60d 7143664: Clean up OrderAccess implementations and usage
dholmes
parents: 25715
diff changeset
    75
inline void OrderAccess::fence()      { inlasm_sync();   }
54323
846bc643f4ef 8220351: Cross-modifying code
rehn
parents: 53244
diff changeset
    76
inline void OrderAccess::cross_modify_fence()
846bc643f4ef 8220351: Cross-modifying code
rehn
parents: 53244
diff changeset
    77
                                      { inlasm_isync();  }
22831
1e2ba1d62103 8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff changeset
    78
22861
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    79
#undef inlasm_sync
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    80
#undef inlasm_lwsync
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    81
#undef inlasm_eieio
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22831
diff changeset
    82
#undef inlasm_isync
29456
cc1c5203e60d 7143664: Clean up OrderAccess implementations and usage
dholmes
parents: 25715
diff changeset
    83
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 51050
diff changeset
    84
#endif // OS_CPU_AIX_PPC_ORDERACCESS_AIX_PPC_HPP