Path: blob/master/src/hotspot/os_cpu/linux_aarch64/atomic_linux_aarch64.S
41145 views
// Copyright (c) 2021, Red Hat Inc. All rights reserved.1// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2//3// This code is free software; you can redistribute it and/or modify it4// under the terms of the GNU General Public License version 2 only, as5// published by the Free Software Foundation.6//7// This code is distributed in the hope that it will be useful, but WITHOUT8// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or9// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License10// version 2 for more details (a copy is included in the LICENSE file that11// accompanied this code).12//13// You should have received a copy of the GNU General Public License version14// 2 along with this work; if not, write to the Free Software Foundation,15// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.16//17// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA18// or visit www.oracle.com if you need additional information or have any19// questions.20212223.text2425.globl aarch64_atomic_fetch_add_8_default_impl26.align 527aarch64_atomic_fetch_add_8_default_impl:28prfm pstl1strm, [x0]290: ldaxr x2, [x0]30add x8, x2, x131stlxr w9, x8, [x0]32cbnz w9, 0b33dmb ish34mov x0, x235ret3637.globl aarch64_atomic_fetch_add_4_default_impl38.align 539aarch64_atomic_fetch_add_4_default_impl:40prfm pstl1strm, [x0]410: ldaxr w2, [x0]42add w8, w2, w143stlxr w9, w8, [x0]44cbnz w9, 0b45dmb ish46mov w0, w247ret4849.globl aarch64_atomic_xchg_4_default_impl50.align 551aarch64_atomic_xchg_4_default_impl:52prfm pstl1strm, [x0]530: ldaxr w2, [x0]54stlxr w8, w1, [x0]55cbnz w8, 0b56dmb ish57mov w0, w258ret5960.globl aarch64_atomic_xchg_8_default_impl61.align 562aarch64_atomic_xchg_8_default_impl:63prfm pstl1strm, [x0]640: ldaxr x2, [x0]65stlxr w8, x1, [x0]66cbnz w8, 0b67dmb ish68mov x0, x269ret7071.globl aarch64_atomic_cmpxchg_1_default_impl72.align 573aarch64_atomic_cmpxchg_1_default_impl:74dmb ish75prfm pstl1strm, [x0]760: ldxrb w3, [x0]77eor w8, w3, w178tst x8, #0xff79b.ne 1f80stxrb w8, w2, [x0]81cbnz w8, 0b821: mov w0, w383dmb ish84ret8586.globl aarch64_atomic_cmpxchg_4_default_impl87.align 588aarch64_atomic_cmpxchg_4_default_impl:89dmb ish90prfm pstl1strm, [x0]910: ldxr w3, [x0]92cmp w3, w193b.ne 1f94stxr w8, w2, [x0]95cbnz w8, 0b961: mov w0, w397dmb ish98ret99100.globl aarch64_atomic_cmpxchg_8_default_impl101.align 5102aarch64_atomic_cmpxchg_8_default_impl:103dmb ish104prfm pstl1strm, [x0]1050: ldxr x3, [x0]106cmp x3, x1107b.ne 1f108stxr w8, x2, [x0]109cbnz w8, 0b1101: mov x0, x3111dmb ish112ret113114.globl aarch64_atomic_cmpxchg_1_relaxed_default_impl115.align 5116aarch64_atomic_cmpxchg_1_relaxed_default_impl:117prfm pstl1strm, [x0]1180: ldxrb w3, [x0]119eor w8, w3, w1120tst x8, #0xff121b.ne 1f122stxrb w8, w2, [x0]123cbnz w8, 0b1241: mov w0, w3125ret126127.globl aarch64_atomic_cmpxchg_4_relaxed_default_impl128.align 5129aarch64_atomic_cmpxchg_4_relaxed_default_impl:130prfm pstl1strm, [x0]1310: ldxr w3, [x0]132cmp w3, w1133b.ne 1f134stxr w8, w2, [x0]135cbnz w8, 0b1361: mov w0, w3137ret138139.globl aarch64_atomic_cmpxchg_8_relaxed_default_impl140.align 5141aarch64_atomic_cmpxchg_8_relaxed_default_impl:142prfm pstl1strm, [x0]1430: ldxr x3, [x0]144cmp x3, x1145b.ne 1f146stxr w8, x2, [x0]147cbnz w8, 0b1481: mov x0, x3149ret150151152