Path: blob/master/src/hotspot/os_cpu/linux_aarch64/atomic_linux_aarch64.S
64440 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_4_release_default_impl115.align 5116aarch64_atomic_cmpxchg_4_release_default_impl:117prfm pstl1strm, [x0]1180: ldxr w3, [x0]119cmp w3, w1120b.ne 1f121stlxr w8, w2, [x0]122cbnz w8, 0b1231: mov w0, w3124ret125126.globl aarch64_atomic_cmpxchg_8_release_default_impl127.align 5128aarch64_atomic_cmpxchg_8_release_default_impl:129prfm pstl1strm, [x0]1300: ldxr x3, [x0]131cmp x3, x1132b.ne 1f133stlxr w8, x2, [x0]134cbnz w8, 0b1351: mov x0, x3136ret137138.globl aarch64_atomic_cmpxchg_4_seq_cst_default_impl139.align 5140aarch64_atomic_cmpxchg_4_seq_cst_default_impl:141prfm pstl1strm, [x0]1420: ldaxr w3, [x0]143cmp w3, w1144b.ne 1f145stlxr w8, w2, [x0]146cbnz w8, 0b1471: mov w0, w3148ret149150.globl aarch64_atomic_cmpxchg_8_seq_cst_default_impl151.align 5152aarch64_atomic_cmpxchg_8_seq_cst_default_impl:153prfm pstl1strm, [x0]1540: ldaxr x3, [x0]155cmp x3, x1156b.ne 1f157stlxr w8, x2, [x0]158cbnz w8, 0b1591: mov x0, x3160ret161162.globl aarch64_atomic_cmpxchg_1_relaxed_default_impl163.align 5164aarch64_atomic_cmpxchg_1_relaxed_default_impl:165prfm pstl1strm, [x0]1660: ldxrb w3, [x0]167eor w8, w3, w1168tst x8, #0xff169b.ne 1f170stxrb w8, w2, [x0]171cbnz w8, 0b1721: mov w0, w3173ret174175.globl aarch64_atomic_cmpxchg_4_relaxed_default_impl176.align 5177aarch64_atomic_cmpxchg_4_relaxed_default_impl:178prfm pstl1strm, [x0]1790: ldxr w3, [x0]180cmp w3, w1181b.ne 1f182stxr w8, w2, [x0]183cbnz w8, 0b1841: mov w0, w3185ret186187.globl aarch64_atomic_cmpxchg_8_relaxed_default_impl188.align 5189aarch64_atomic_cmpxchg_8_relaxed_default_impl:190prfm pstl1strm, [x0]1910: ldxr x3, [x0]192cmp x3, x1193b.ne 1f194stxr w8, x2, [x0]195cbnz w8, 0b1961: mov x0, x3197ret198199200