mirror of
https://github.com/TinyCC/tinycc.git
synced 2025-11-16 04:24:45 +00:00
2670 lines
71 KiB
ArmAsm
2670 lines
71 KiB
ArmAsm
/* ---------------------------------------------- */
|
|
/* This file is extracted from `gcc` v15.1.0 `libatomic.a`. */
|
|
/* This file is generated by https://github.com/kbkpbot/gen_atomic.git */
|
|
/* This file is generated at 2025-06-24 21:37. */
|
|
/* This file implements for i386/x86_64/arm/aarch64/riscv:
|
|
* __atomic_load_[1,2,4,8]
|
|
* __atomic_store_[1,2,4,8]
|
|
* __atomic_compare_exchange_[1,2,4,8]
|
|
* __atomic_test_and_set_[1,2,4,8]
|
|
* atomic_thread_fence
|
|
* atomic_signal_fence
|
|
* atomic_flag_test_and_set
|
|
* atomic_flag_test_and_set_explicit
|
|
* atomic_flag_clear
|
|
* atomic_flag_clear_explicit
|
|
*/
|
|
/* SPDX-License-Identifier: GPL-3.0-or-later WITH GCC-exception-3.1
|
|
* Copyright (C) 2012-2025 Free Software Foundation, Inc.
|
|
*/
|
|
#ifdef __leading_underscore
|
|
# define _(s) _##s
|
|
#else
|
|
# define _(s) s
|
|
#endif
|
|
|
|
|
|
/* ---------------------------------------------- */
|
|
#if defined __i386__
|
|
|
|
#define endbr32
|
|
|
|
.text
|
|
|
|
.global _(__atomic_load_1)
|
|
.type _(__atomic_load_1), %function
|
|
_(__atomic_load_1):
|
|
endbr32
|
|
mov 0x4(%esp),%eax
|
|
movzbl (%eax),%eax
|
|
ret
|
|
.size _(__atomic_load_1), .-_(__atomic_load_1)
|
|
|
|
.global _(__atomic_load_2)
|
|
.type _(__atomic_load_2), %function
|
|
_(__atomic_load_2):
|
|
endbr32
|
|
mov 0x4(%esp),%eax
|
|
movzwl (%eax),%eax
|
|
ret
|
|
.size _(__atomic_load_2), .-_(__atomic_load_2)
|
|
|
|
.global _(__atomic_load_4)
|
|
.type _(__atomic_load_4), %function
|
|
_(__atomic_load_4):
|
|
endbr32
|
|
mov 0x4(%esp),%eax
|
|
mov (%eax),%eax
|
|
ret
|
|
.size _(__atomic_load_4), .-_(__atomic_load_4)
|
|
|
|
.global _(__atomic_load_8)
|
|
.type _(__atomic_load_8), %function
|
|
_(__atomic_load_8):
|
|
endbr32
|
|
sub $0xc,%esp
|
|
mov 0x10(%esp),%eax
|
|
fildll (%eax)
|
|
fistpll (%esp)
|
|
mov (%esp),%eax
|
|
mov 0x4(%esp),%edx
|
|
add $0xc,%esp
|
|
ret
|
|
.size _(__atomic_load_8), .-_(__atomic_load_8)
|
|
|
|
.global _(__atomic_store_1)
|
|
.type _(__atomic_store_1), %function
|
|
_(__atomic_store_1):
|
|
endbr32
|
|
mov 0x4(%esp),%edx
|
|
mov 0x8(%esp),%eax
|
|
xchg %al,(%edx)
|
|
ret
|
|
.size _(__atomic_store_1), .-_(__atomic_store_1)
|
|
|
|
.global _(__atomic_store_2)
|
|
.type _(__atomic_store_2), %function
|
|
_(__atomic_store_2):
|
|
endbr32
|
|
mov 0x4(%esp),%edx
|
|
mov 0x8(%esp),%eax
|
|
xchg %ax,(%edx)
|
|
ret
|
|
.size _(__atomic_store_2), .-_(__atomic_store_2)
|
|
|
|
.global _(__atomic_store_4)
|
|
.type _(__atomic_store_4), %function
|
|
_(__atomic_store_4):
|
|
endbr32
|
|
mov 0x4(%esp),%edx
|
|
mov 0x8(%esp),%eax
|
|
xchg %eax,(%edx)
|
|
ret
|
|
.size _(__atomic_store_4), .-_(__atomic_store_4)
|
|
|
|
.global _(__atomic_store_8)
|
|
.type _(__atomic_store_8), %function
|
|
_(__atomic_store_8):
|
|
endbr32
|
|
push %ebx
|
|
sub $0x8,%esp
|
|
mov 0x18(%esp),%ebx
|
|
mov 0x14(%esp),%ecx
|
|
mov %ecx,(%esp)
|
|
mov %ebx,0x4(%esp)
|
|
fildll (%esp)
|
|
mov 0x10(%esp),%eax
|
|
fistpll (%eax)
|
|
lock orl $0x0,(%esp)
|
|
add $0x8,%esp
|
|
pop %ebx
|
|
ret
|
|
.size _(__atomic_store_8), .-_(__atomic_store_8)
|
|
|
|
.global _(__atomic_compare_exchange_1)
|
|
.type _(__atomic_compare_exchange_1), %function
|
|
_(__atomic_compare_exchange_1):
|
|
endbr32
|
|
push %ebx
|
|
mov 0xc(%esp),%ecx
|
|
mov 0x8(%esp),%edx
|
|
movzbl 0x10(%esp),%ebx
|
|
movzbl (%ecx),%eax
|
|
lock cmpxchg %bl,(%edx)
|
|
sete %dl
|
|
je .L___atomic_compare_exchange_1_020
|
|
mov %al,(%ecx)
|
|
.L___atomic_compare_exchange_1_020:
|
|
mov %edx,%eax
|
|
pop %ebx
|
|
ret
|
|
.size _(__atomic_compare_exchange_1), .-_(__atomic_compare_exchange_1)
|
|
|
|
.global _(__atomic_compare_exchange_2)
|
|
.type _(__atomic_compare_exchange_2), %function
|
|
_(__atomic_compare_exchange_2):
|
|
endbr32
|
|
push %ebx
|
|
mov 0xc(%esp),%ecx
|
|
mov 0x8(%esp),%edx
|
|
movzwl 0x10(%esp),%ebx
|
|
movzwl (%ecx),%eax
|
|
lock cmpxchg %bx,(%edx)
|
|
sete %dl
|
|
je .L___atomic_compare_exchange_2_022
|
|
mov %ax,(%ecx)
|
|
.L___atomic_compare_exchange_2_022:
|
|
mov %edx,%eax
|
|
pop %ebx
|
|
ret
|
|
.size _(__atomic_compare_exchange_2), .-_(__atomic_compare_exchange_2)
|
|
|
|
.global _(__atomic_compare_exchange_4)
|
|
.type _(__atomic_compare_exchange_4), %function
|
|
_(__atomic_compare_exchange_4):
|
|
endbr32
|
|
push %ebx
|
|
mov 0xc(%esp),%ecx
|
|
mov 0x8(%esp),%edx
|
|
mov 0x10(%esp),%ebx
|
|
mov (%ecx),%eax
|
|
lock cmpxchg %ebx,(%edx)
|
|
sete %dl
|
|
je .L___atomic_compare_exchange_4_01e
|
|
mov %eax,(%ecx)
|
|
.L___atomic_compare_exchange_4_01e:
|
|
mov %edx,%eax
|
|
pop %ebx
|
|
ret
|
|
.size _(__atomic_compare_exchange_4), .-_(__atomic_compare_exchange_4)
|
|
|
|
.global _(__atomic_compare_exchange_8)
|
|
.type _(__atomic_compare_exchange_8), %function
|
|
_(__atomic_compare_exchange_8):
|
|
endbr32
|
|
push %edi
|
|
push %esi
|
|
push %ebx
|
|
mov 0x14(%esp),%esi
|
|
mov 0x1c(%esp),%ecx
|
|
mov 0x10(%esp),%edi
|
|
mov (%esi),%eax
|
|
mov 0x4(%esi),%edx
|
|
mov 0x18(%esp),%ebx
|
|
lock cmpxchg8b (%edi)
|
|
sete %cl
|
|
je .L___atomic_compare_exchange_8_02a
|
|
mov %eax,(%esi)
|
|
mov %edx,0x4(%esi)
|
|
.L___atomic_compare_exchange_8_02a:
|
|
pop %ebx
|
|
mov %ecx,%eax
|
|
pop %esi
|
|
pop %edi
|
|
ret
|
|
.size _(__atomic_compare_exchange_8), .-_(__atomic_compare_exchange_8)
|
|
|
|
.global _(__atomic_test_and_set_1)
|
|
.type _(__atomic_test_and_set_1), %function
|
|
_(__atomic_test_and_set_1):
|
|
endbr32
|
|
mov 0x4(%esp),%edx
|
|
mov $0x1,%eax
|
|
xchg %al,(%edx)
|
|
ret
|
|
.size _(__atomic_test_and_set_1), .-_(__atomic_test_and_set_1)
|
|
|
|
.global _(__atomic_test_and_set_2)
|
|
.type _(__atomic_test_and_set_2), %function
|
|
_(__atomic_test_and_set_2):
|
|
endbr32
|
|
mov 0x4(%esp),%edx
|
|
mov $0x1,%eax
|
|
xchg %al,(%edx)
|
|
ret
|
|
.size _(__atomic_test_and_set_2), .-_(__atomic_test_and_set_2)
|
|
|
|
.global _(__atomic_test_and_set_4)
|
|
.type _(__atomic_test_and_set_4), %function
|
|
_(__atomic_test_and_set_4):
|
|
endbr32
|
|
mov 0x4(%esp),%edx
|
|
mov $0x1,%eax
|
|
xchg %al,(%edx)
|
|
ret
|
|
.size _(__atomic_test_and_set_4), .-_(__atomic_test_and_set_4)
|
|
|
|
.global _(__atomic_test_and_set_8)
|
|
.type _(__atomic_test_and_set_8), %function
|
|
_(__atomic_test_and_set_8):
|
|
endbr32
|
|
mov 0x4(%esp),%edx
|
|
mov $0x1,%eax
|
|
xchg %al,(%edx)
|
|
ret
|
|
.size _(__atomic_test_and_set_8), .-_(__atomic_test_and_set_8)
|
|
|
|
.global _(atomic_thread_fence)
|
|
.type _(atomic_thread_fence), %function
|
|
_(atomic_thread_fence):
|
|
endbr32
|
|
lock orl $0x0,(%esp)
|
|
ret
|
|
.size _(atomic_thread_fence), .-_(atomic_thread_fence)
|
|
|
|
.global _(atomic_signal_fence)
|
|
.type _(atomic_signal_fence), %function
|
|
_(atomic_signal_fence):
|
|
endbr32
|
|
ret
|
|
.size _(atomic_signal_fence), .-_(atomic_signal_fence)
|
|
|
|
.global _(atomic_flag_test_and_set)
|
|
.type _(atomic_flag_test_and_set), %function
|
|
_(atomic_flag_test_and_set):
|
|
endbr32
|
|
mov 0x4(%esp),%edx
|
|
mov $0x1,%eax
|
|
xchg %al,(%edx)
|
|
ret
|
|
.size _(atomic_flag_test_and_set), .-_(atomic_flag_test_and_set)
|
|
|
|
.global _(atomic_flag_test_and_set_explicit)
|
|
.type _(atomic_flag_test_and_set_explicit), %function
|
|
_(atomic_flag_test_and_set_explicit):
|
|
endbr32
|
|
mov 0x4(%esp),%edx
|
|
mov $0x1,%eax
|
|
xchg %al,(%edx)
|
|
ret
|
|
.size _(atomic_flag_test_and_set_explicit), .-_(atomic_flag_test_and_set_explicit)
|
|
|
|
.global _(atomic_flag_clear)
|
|
.type _(atomic_flag_clear), %function
|
|
_(atomic_flag_clear):
|
|
endbr32
|
|
mov 0x4(%esp),%edx
|
|
xor %eax,%eax
|
|
xchg %al,(%edx)
|
|
ret
|
|
.size _(atomic_flag_clear), .-_(atomic_flag_clear)
|
|
|
|
.global _(atomic_flag_clear_explicit)
|
|
.type _(atomic_flag_clear_explicit), %function
|
|
_(atomic_flag_clear_explicit):
|
|
endbr32
|
|
mov 0x4(%esp),%edx
|
|
xor %eax,%eax
|
|
xchg %al,(%edx)
|
|
ret
|
|
.size _(atomic_flag_clear_explicit), .-_(atomic_flag_clear_explicit)
|
|
|
|
#endif //__i386__
|
|
|
|
/* ---------------------------------------------- */
|
|
#if defined __x86_64__ && !defined _WIN32
|
|
|
|
#define endbr64
|
|
|
|
.text
|
|
|
|
.global _(__atomic_load_1)
|
|
.type _(__atomic_load_1), %function
|
|
_(__atomic_load_1):
|
|
endbr64
|
|
movzbl (%rdi),%eax
|
|
ret
|
|
.size _(__atomic_load_1), .-_(__atomic_load_1)
|
|
|
|
.global _(__atomic_load_2)
|
|
.type _(__atomic_load_2), %function
|
|
_(__atomic_load_2):
|
|
endbr64
|
|
movzwl (%rdi),%eax
|
|
ret
|
|
.size _(__atomic_load_2), .-_(__atomic_load_2)
|
|
|
|
.global _(__atomic_load_4)
|
|
.type _(__atomic_load_4), %function
|
|
_(__atomic_load_4):
|
|
endbr64
|
|
mov (%rdi),%eax
|
|
ret
|
|
.size _(__atomic_load_4), .-_(__atomic_load_4)
|
|
|
|
.global _(__atomic_load_8)
|
|
.type _(__atomic_load_8), %function
|
|
_(__atomic_load_8):
|
|
endbr64
|
|
mov (%rdi),%rax
|
|
ret
|
|
.size _(__atomic_load_8), .-_(__atomic_load_8)
|
|
|
|
.global _(__atomic_store_1)
|
|
.type _(__atomic_store_1), %function
|
|
_(__atomic_store_1):
|
|
endbr64
|
|
xchg %sil,(%rdi)
|
|
ret
|
|
.size _(__atomic_store_1), .-_(__atomic_store_1)
|
|
|
|
.global _(__atomic_store_2)
|
|
.type _(__atomic_store_2), %function
|
|
_(__atomic_store_2):
|
|
endbr64
|
|
xchg %si,(%rdi)
|
|
ret
|
|
.size _(__atomic_store_2), .-_(__atomic_store_2)
|
|
|
|
.global _(__atomic_store_4)
|
|
.type _(__atomic_store_4), %function
|
|
_(__atomic_store_4):
|
|
endbr64
|
|
xchg %esi,(%rdi)
|
|
ret
|
|
.size _(__atomic_store_4), .-_(__atomic_store_4)
|
|
|
|
.global _(__atomic_store_8)
|
|
.type _(__atomic_store_8), %function
|
|
_(__atomic_store_8):
|
|
endbr64
|
|
xchg %rsi,(%rdi)
|
|
ret
|
|
.size _(__atomic_store_8), .-_(__atomic_store_8)
|
|
|
|
.global _(__atomic_compare_exchange_1)
|
|
.type _(__atomic_compare_exchange_1), %function
|
|
_(__atomic_compare_exchange_1):
|
|
endbr64
|
|
movzbl (%rsi),%eax
|
|
lock cmpxchg %dl,(%rdi)
|
|
sete %dl
|
|
je .L___atomic_compare_exchange_1_012
|
|
mov %al,(%rsi)
|
|
.L___atomic_compare_exchange_1_012:
|
|
mov %edx,%eax
|
|
ret
|
|
.size _(__atomic_compare_exchange_1), .-_(__atomic_compare_exchange_1)
|
|
|
|
.global _(__atomic_compare_exchange_2)
|
|
.type _(__atomic_compare_exchange_2), %function
|
|
_(__atomic_compare_exchange_2):
|
|
endbr64
|
|
movzwl (%rsi),%eax
|
|
lock cmpxchg %dx,(%rdi)
|
|
sete %dl
|
|
je .L___atomic_compare_exchange_2_014
|
|
mov %ax,(%rsi)
|
|
.L___atomic_compare_exchange_2_014:
|
|
mov %edx,%eax
|
|
ret
|
|
.size _(__atomic_compare_exchange_2), .-_(__atomic_compare_exchange_2)
|
|
|
|
.global _(__atomic_compare_exchange_4)
|
|
.type _(__atomic_compare_exchange_4), %function
|
|
_(__atomic_compare_exchange_4):
|
|
endbr64
|
|
mov (%rsi),%eax
|
|
lock cmpxchg %edx,(%rdi)
|
|
sete %dl
|
|
je .L___atomic_compare_exchange_4_011
|
|
mov %eax,(%rsi)
|
|
.L___atomic_compare_exchange_4_011:
|
|
mov %edx,%eax
|
|
ret
|
|
.size _(__atomic_compare_exchange_4), .-_(__atomic_compare_exchange_4)
|
|
|
|
.global _(__atomic_compare_exchange_8)
|
|
.type _(__atomic_compare_exchange_8), %function
|
|
_(__atomic_compare_exchange_8):
|
|
endbr64
|
|
mov (%rsi),%rax
|
|
lock cmpxchg %rdx,(%rdi)
|
|
sete %dl
|
|
je .L___atomic_compare_exchange_8_014
|
|
mov %rax,(%rsi)
|
|
.L___atomic_compare_exchange_8_014:
|
|
mov %edx,%eax
|
|
ret
|
|
.size _(__atomic_compare_exchange_8), .-_(__atomic_compare_exchange_8)
|
|
|
|
.global _(__atomic_test_and_set_1)
|
|
.type _(__atomic_test_and_set_1), %function
|
|
_(__atomic_test_and_set_1):
|
|
endbr64
|
|
mov $0x1,%eax
|
|
xchg %al,(%rdi)
|
|
ret
|
|
.size _(__atomic_test_and_set_1), .-_(__atomic_test_and_set_1)
|
|
|
|
.global _(__atomic_test_and_set_2)
|
|
.type _(__atomic_test_and_set_2), %function
|
|
_(__atomic_test_and_set_2):
|
|
endbr64
|
|
mov $0x1,%eax
|
|
xchg %al,(%rdi)
|
|
ret
|
|
.size _(__atomic_test_and_set_2), .-_(__atomic_test_and_set_2)
|
|
|
|
.global _(__atomic_test_and_set_4)
|
|
.type _(__atomic_test_and_set_4), %function
|
|
_(__atomic_test_and_set_4):
|
|
endbr64
|
|
mov $0x1,%eax
|
|
xchg %al,(%rdi)
|
|
ret
|
|
.size _(__atomic_test_and_set_4), .-_(__atomic_test_and_set_4)
|
|
|
|
.global _(__atomic_test_and_set_8)
|
|
.type _(__atomic_test_and_set_8), %function
|
|
_(__atomic_test_and_set_8):
|
|
endbr64
|
|
mov $0x1,%eax
|
|
xchg %al,(%rdi)
|
|
ret
|
|
.size _(__atomic_test_and_set_8), .-_(__atomic_test_and_set_8)
|
|
|
|
.global _(atomic_thread_fence)
|
|
.type _(atomic_thread_fence), %function
|
|
_(atomic_thread_fence):
|
|
endbr64
|
|
lock orq $0x0,(%rsp)
|
|
ret
|
|
.size _(atomic_thread_fence), .-_(atomic_thread_fence)
|
|
|
|
.global _(atomic_signal_fence)
|
|
.type _(atomic_signal_fence), %function
|
|
_(atomic_signal_fence):
|
|
endbr64
|
|
ret
|
|
.size _(atomic_signal_fence), .-_(atomic_signal_fence)
|
|
|
|
.global _(atomic_flag_test_and_set)
|
|
.type _(atomic_flag_test_and_set), %function
|
|
_(atomic_flag_test_and_set):
|
|
endbr64
|
|
mov $0x1,%eax
|
|
xchg %al,(%rdi)
|
|
ret
|
|
.size _(atomic_flag_test_and_set), .-_(atomic_flag_test_and_set)
|
|
|
|
.global _(atomic_flag_test_and_set_explicit)
|
|
.type _(atomic_flag_test_and_set_explicit), %function
|
|
_(atomic_flag_test_and_set_explicit):
|
|
endbr64
|
|
mov $0x1,%eax
|
|
xchg %al,(%rdi)
|
|
ret
|
|
.size _(atomic_flag_test_and_set_explicit), .-_(atomic_flag_test_and_set_explicit)
|
|
|
|
.global _(atomic_flag_clear)
|
|
.type _(atomic_flag_clear), %function
|
|
_(atomic_flag_clear):
|
|
endbr64
|
|
xor %eax,%eax
|
|
xchg %al,(%rdi)
|
|
ret
|
|
.size _(atomic_flag_clear), .-_(atomic_flag_clear)
|
|
|
|
.global _(atomic_flag_clear_explicit)
|
|
.type _(atomic_flag_clear_explicit), %function
|
|
_(atomic_flag_clear_explicit):
|
|
endbr64
|
|
xor %eax,%eax
|
|
xchg %al,(%rdi)
|
|
ret
|
|
.size _(atomic_flag_clear_explicit), .-_(atomic_flag_clear_explicit)
|
|
|
|
#endif //__x86_64__ && !_WIN32
|
|
|
|
/* ---------------------------------------------- */
|
|
#if defined __x86_64__ && defined _WIN32
|
|
.text
|
|
|
|
.global _(__atomic_load_1)
|
|
.type _(__atomic_load_1), %function
|
|
_(__atomic_load_1):
|
|
movzbl (%rcx),%eax
|
|
ret
|
|
.size _(__atomic_load_1), .-_(__atomic_load_1)
|
|
|
|
.global _(__atomic_load_2)
|
|
.type _(__atomic_load_2), %function
|
|
_(__atomic_load_2):
|
|
movzwl (%rcx),%eax
|
|
ret
|
|
.size _(__atomic_load_2), .-_(__atomic_load_2)
|
|
|
|
.global _(__atomic_load_4)
|
|
.type _(__atomic_load_4), %function
|
|
_(__atomic_load_4):
|
|
mov (%rcx),%eax
|
|
ret
|
|
.size _(__atomic_load_4), .-_(__atomic_load_4)
|
|
|
|
.global _(__atomic_load_8)
|
|
.type _(__atomic_load_8), %function
|
|
_(__atomic_load_8):
|
|
mov (%rcx),%rax
|
|
ret
|
|
.size _(__atomic_load_8), .-_(__atomic_load_8)
|
|
|
|
.global _(__atomic_store_1)
|
|
.type _(__atomic_store_1), %function
|
|
_(__atomic_store_1):
|
|
xchg %dl,(%rcx)
|
|
ret
|
|
.size _(__atomic_store_1), .-_(__atomic_store_1)
|
|
|
|
.global _(__atomic_store_2)
|
|
.type _(__atomic_store_2), %function
|
|
_(__atomic_store_2):
|
|
xchg %dx,(%rcx)
|
|
ret
|
|
.size _(__atomic_store_2), .-_(__atomic_store_2)
|
|
|
|
.global _(__atomic_store_4)
|
|
.type _(__atomic_store_4), %function
|
|
_(__atomic_store_4):
|
|
xchg %edx,(%rcx)
|
|
ret
|
|
.size _(__atomic_store_4), .-_(__atomic_store_4)
|
|
|
|
.global _(__atomic_store_8)
|
|
.type _(__atomic_store_8), %function
|
|
_(__atomic_store_8):
|
|
xchg %rdx,(%rcx)
|
|
ret
|
|
.size _(__atomic_store_8), .-_(__atomic_store_8)
|
|
|
|
.global _(__atomic_compare_exchange_1)
|
|
.type _(__atomic_compare_exchange_1), %function
|
|
_(__atomic_compare_exchange_1):
|
|
movzbl (%rdx),%eax
|
|
lock cmpxchg %r8b,(%rcx)
|
|
sete %cl
|
|
je .L___atomic_compare_exchange_1_00f
|
|
mov %al,(%rdx)
|
|
.L___atomic_compare_exchange_1_00f:
|
|
mov %ecx,%eax
|
|
ret
|
|
.size _(__atomic_compare_exchange_1), .-_(__atomic_compare_exchange_1)
|
|
|
|
.global _(__atomic_compare_exchange_2)
|
|
.type _(__atomic_compare_exchange_2), %function
|
|
_(__atomic_compare_exchange_2):
|
|
movzwl (%rdx),%eax
|
|
lock cmpxchg %r8w,(%rcx)
|
|
sete %cl
|
|
je .L___atomic_compare_exchange_2_011
|
|
mov %ax,(%rdx)
|
|
.L___atomic_compare_exchange_2_011:
|
|
mov %ecx,%eax
|
|
ret
|
|
.size _(__atomic_compare_exchange_2), .-_(__atomic_compare_exchange_2)
|
|
|
|
.global _(__atomic_compare_exchange_4)
|
|
.type _(__atomic_compare_exchange_4), %function
|
|
_(__atomic_compare_exchange_4):
|
|
mov (%rdx),%eax
|
|
lock cmpxchg %r8d,(%rcx)
|
|
sete %cl
|
|
je .L___atomic_compare_exchange_4_00e
|
|
mov %eax,(%rdx)
|
|
.L___atomic_compare_exchange_4_00e:
|
|
mov %ecx,%eax
|
|
ret
|
|
.size _(__atomic_compare_exchange_4), .-_(__atomic_compare_exchange_4)
|
|
|
|
.global _(__atomic_compare_exchange_8)
|
|
.type _(__atomic_compare_exchange_8), %function
|
|
_(__atomic_compare_exchange_8):
|
|
mov (%rdx),%rax
|
|
lock cmpxchg %r8,(%rcx)
|
|
sete %cl
|
|
je .L___atomic_compare_exchange_8_010
|
|
mov %rax,(%rdx)
|
|
.L___atomic_compare_exchange_8_010:
|
|
mov %ecx,%eax
|
|
ret
|
|
.size _(__atomic_compare_exchange_8), .-_(__atomic_compare_exchange_8)
|
|
|
|
.global _(__atomic_test_and_set_1)
|
|
.type _(__atomic_test_and_set_1), %function
|
|
_(__atomic_test_and_set_1):
|
|
mov $0x1,%eax
|
|
xchg %al,(%rcx)
|
|
ret
|
|
.size _(__atomic_test_and_set_1), .-_(__atomic_test_and_set_1)
|
|
|
|
.global _(__atomic_test_and_set_2)
|
|
.type _(__atomic_test_and_set_2), %function
|
|
_(__atomic_test_and_set_2):
|
|
mov $0x1,%eax
|
|
xchg %al,(%rcx)
|
|
ret
|
|
.size _(__atomic_test_and_set_2), .-_(__atomic_test_and_set_2)
|
|
|
|
.global _(__atomic_test_and_set_4)
|
|
.type _(__atomic_test_and_set_4), %function
|
|
_(__atomic_test_and_set_4):
|
|
mov $0x1,%eax
|
|
xchg %al,(%rcx)
|
|
ret
|
|
.size _(__atomic_test_and_set_4), .-_(__atomic_test_and_set_4)
|
|
|
|
.global _(__atomic_test_and_set_8)
|
|
.type _(__atomic_test_and_set_8), %function
|
|
_(__atomic_test_and_set_8):
|
|
mov $0x1,%eax
|
|
xchg %al,(%rcx)
|
|
ret
|
|
.size _(__atomic_test_and_set_8), .-_(__atomic_test_and_set_8)
|
|
|
|
.global _(atomic_thread_fence)
|
|
.type _(atomic_thread_fence), %function
|
|
_(atomic_thread_fence):
|
|
lock orq $0x0,(%rsp)
|
|
ret
|
|
.size _(atomic_thread_fence), .-_(atomic_thread_fence)
|
|
|
|
.global _(atomic_signal_fence)
|
|
.type _(atomic_signal_fence), %function
|
|
_(atomic_signal_fence):
|
|
ret
|
|
.size _(atomic_signal_fence), .-_(atomic_signal_fence)
|
|
|
|
.global _(atomic_flag_test_and_set)
|
|
.type _(atomic_flag_test_and_set), %function
|
|
_(atomic_flag_test_and_set):
|
|
mov $0x1,%eax
|
|
xchg %al,(%rcx)
|
|
ret
|
|
.size _(atomic_flag_test_and_set), .-_(atomic_flag_test_and_set)
|
|
|
|
.global _(atomic_flag_test_and_set_explicit)
|
|
.type _(atomic_flag_test_and_set_explicit), %function
|
|
_(atomic_flag_test_and_set_explicit):
|
|
mov $0x1,%eax
|
|
xchg %al,(%rcx)
|
|
ret
|
|
.size _(atomic_flag_test_and_set_explicit), .-_(atomic_flag_test_and_set_explicit)
|
|
|
|
.global _(atomic_flag_clear)
|
|
.type _(atomic_flag_clear), %function
|
|
_(atomic_flag_clear):
|
|
xor %eax,%eax
|
|
xchg %al,(%rcx)
|
|
ret
|
|
.size _(atomic_flag_clear), .-_(atomic_flag_clear)
|
|
|
|
.global _(atomic_flag_clear_explicit)
|
|
.type _(atomic_flag_clear_explicit), %function
|
|
_(atomic_flag_clear_explicit):
|
|
xor %eax,%eax
|
|
xchg %al,(%rcx)
|
|
ret
|
|
.size _(atomic_flag_clear_explicit), .-_(atomic_flag_clear_explicit)
|
|
|
|
#endif //__x86_64__ && _WIN32
|
|
|
|
/* ---------------------------------------------- */
|
|
#if defined __arm__
|
|
.text
|
|
#ifndef __TINYC__
|
|
.arch armv6k
|
|
.syntax unified
|
|
#endif
|
|
|
|
.global _(__atomic_load_1)
|
|
.type _(__atomic_load_1), %function
|
|
_(__atomic_load_1):
|
|
#ifdef __TINYC__
|
|
.int 0xe3510000
|
|
.int 0x1a000002
|
|
.int 0xe5d00000
|
|
.int 0xe6ef0070
|
|
.int 0xe12fff1e
|
|
.int 0xee070fba
|
|
.int 0xe5d00000
|
|
.int 0xee070fba
|
|
.int 0xe6ef0070
|
|
.int 0xe12fff1e
|
|
#else
|
|
cmp r1, #0
|
|
bne .L___atomic_load_1_014
|
|
ldrb r0, [r0]
|
|
uxtb r0, r0
|
|
bx lr
|
|
.L___atomic_load_1_014:
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
ldrb r0, [r0]
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
uxtb r0, r0
|
|
bx lr
|
|
.size _(__atomic_load_1), .-_(__atomic_load_1)
|
|
|
|
#endif
|
|
.global _(__atomic_load_2)
|
|
.type _(__atomic_load_2), %function
|
|
_(__atomic_load_2):
|
|
#ifdef __TINYC__
|
|
.int 0xe3510000
|
|
.int 0x1a000002
|
|
.int 0xe1d000b0
|
|
.int 0xe6ff0070
|
|
.int 0xe12fff1e
|
|
.int 0xee070fba
|
|
.int 0xe1d000b0
|
|
.int 0xee070fba
|
|
.int 0xe6ff0070
|
|
.int 0xe12fff1e
|
|
#else
|
|
cmp r1, #0
|
|
bne .L___atomic_load_2_03c
|
|
ldrh r0, [r0]
|
|
uxth r0, r0
|
|
bx lr
|
|
.L___atomic_load_2_03c:
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
ldrh r0, [r0]
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
uxth r0, r0
|
|
bx lr
|
|
.size _(__atomic_load_2), .-_(__atomic_load_2)
|
|
|
|
#endif
|
|
.global _(__atomic_load_4)
|
|
.type _(__atomic_load_4), %function
|
|
_(__atomic_load_4):
|
|
#ifdef __TINYC__
|
|
.int 0xe3510000
|
|
.int 0x1a000001
|
|
.int 0xe5900000
|
|
.int 0xe12fff1e
|
|
.int 0xee070fba
|
|
.int 0xe5900000
|
|
.int 0xee070fba
|
|
.int 0xe12fff1e
|
|
#else
|
|
cmp r1, #0
|
|
bne .L___atomic_load_4_060
|
|
ldr r0, [r0]
|
|
bx lr
|
|
.L___atomic_load_4_060:
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
ldr r0, [r0]
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
bx lr
|
|
.size _(__atomic_load_4), .-_(__atomic_load_4)
|
|
|
|
#endif
|
|
.global _(__atomic_load_8)
|
|
.type _(__atomic_load_8), %function
|
|
_(__atomic_load_8):
|
|
#ifdef __TINYC__
|
|
.int 0xe3510000
|
|
.int 0x1a000001
|
|
.int 0xe1b00f9f
|
|
.int 0xe12fff1e
|
|
.int 0xee070fba
|
|
.int 0xe1b00f9f
|
|
.int 0xee070fba
|
|
.int 0xe12fff1e
|
|
#else
|
|
cmp r1, #0
|
|
bne .L___atomic_load_8_080
|
|
ldrexd r0, [r0]
|
|
bx lr
|
|
.L___atomic_load_8_080:
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
ldrexd r0, [r0]
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
bx lr
|
|
.size _(__atomic_load_8), .-_(__atomic_load_8)
|
|
|
|
#endif
|
|
.global _(__atomic_store_1)
|
|
.type _(__atomic_store_1), %function
|
|
_(__atomic_store_1):
|
|
#ifdef __TINYC__
|
|
.int 0xe3520000
|
|
.int 0x1a000001
|
|
.int 0xe5c01000
|
|
.int 0xe12fff1e
|
|
.int 0xee070fba
|
|
.int 0xe5c01000
|
|
.int 0xee070fba
|
|
.int 0xe12fff1e
|
|
#else
|
|
cmp r2, #0
|
|
bne .L___atomic_store_1_0a0
|
|
strb r1, [r0]
|
|
bx lr
|
|
.L___atomic_store_1_0a0:
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
strb r1, [r0]
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
bx lr
|
|
.size _(__atomic_store_1), .-_(__atomic_store_1)
|
|
|
|
#endif
|
|
.global _(__atomic_store_2)
|
|
.type _(__atomic_store_2), %function
|
|
_(__atomic_store_2):
|
|
#ifdef __TINYC__
|
|
.int 0xe3520000
|
|
.int 0x1a000001
|
|
.int 0xe1c010b0
|
|
.int 0xe12fff1e
|
|
.int 0xee070fba
|
|
.int 0xe1c010b0
|
|
.int 0xee070fba
|
|
.int 0xe12fff1e
|
|
#else
|
|
cmp r2, #0
|
|
bne .L___atomic_store_2_0c0
|
|
strh r1, [r0]
|
|
bx lr
|
|
.L___atomic_store_2_0c0:
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
strh r1, [r0]
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
bx lr
|
|
.size _(__atomic_store_2), .-_(__atomic_store_2)
|
|
|
|
#endif
|
|
.global _(__atomic_store_4)
|
|
.type _(__atomic_store_4), %function
|
|
_(__atomic_store_4):
|
|
#ifdef __TINYC__
|
|
.int 0xe3520000
|
|
.int 0x1a000001
|
|
.int 0xe5801000
|
|
.int 0xe12fff1e
|
|
.int 0xee070fba
|
|
.int 0xe5801000
|
|
.int 0xee070fba
|
|
.int 0xe12fff1e
|
|
#else
|
|
cmp r2, #0
|
|
bne .L___atomic_store_4_0e0
|
|
str r1, [r0]
|
|
bx lr
|
|
.L___atomic_store_4_0e0:
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
str r1, [r0]
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
bx lr
|
|
.size _(__atomic_store_4), .-_(__atomic_store_4)
|
|
|
|
#endif
|
|
.global _(__atomic_store_8)
|
|
.type _(__atomic_store_8), %function
|
|
_(__atomic_store_8):
|
|
#ifdef __TINYC__
|
|
.int 0xe92d0030
|
|
.int 0xe1a04002
|
|
.int 0xe59d1008
|
|
.int 0xe1a05003
|
|
.int 0xe3510000
|
|
.int 0x1a000005
|
|
.int 0xe1b02f9f
|
|
.int 0xe1a01f94
|
|
.int 0xe3510000
|
|
.int 0x1afffffb
|
|
.int 0xe8bd0030
|
|
.int 0xe12fff1e
|
|
.int 0xee070fba
|
|
.int 0xe1b02f9f
|
|
.int 0xe1a01f94
|
|
.int 0xe3510000
|
|
.int 0x1afffffb
|
|
.int 0xee070fba
|
|
.int 0xe8bd0030
|
|
.int 0xe12fff1e
|
|
#else
|
|
push {r4, r5}
|
|
mov r4, r2
|
|
ldr r1, [sp, #8]
|
|
mov r5, r3
|
|
cmp r1, #0
|
|
bne .L___atomic_store_8_120
|
|
.L___atomic_store_8_108:
|
|
ldrexd r2, [r0]
|
|
strexd r1, r4, [r0]
|
|
cmp r1, #0
|
|
bne .L___atomic_store_8_108
|
|
pop {r4, r5}
|
|
bx lr
|
|
.L___atomic_store_8_120:
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
.L___atomic_store_8_124:
|
|
ldrexd r2, [r0]
|
|
strexd r1, r4, [r0]
|
|
cmp r1, #0
|
|
bne .L___atomic_store_8_124
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
pop {r4, r5}
|
|
bx lr
|
|
.size _(__atomic_store_8), .-_(__atomic_store_8)
|
|
|
|
#endif
|
|
.global _(__atomic_compare_exchange_1)
|
|
.type _(__atomic_compare_exchange_1), %function
|
|
_(__atomic_compare_exchange_1):
|
|
#ifdef __TINYC__
|
|
.int 0xe52de004
|
|
.int 0xe3530000
|
|
.int 0x1a00000a
|
|
.int 0xe5d13000
|
|
.int 0xe1d0cf9f
|
|
.int 0xe15c0003
|
|
.int 0x1a000002
|
|
.int 0xe1c0ef92
|
|
.int 0xe35e0000
|
|
.int 0x1afffff9
|
|
.int 0x03a00001
|
|
.int 0x13a00000
|
|
.int 0x15c1c000
|
|
.int 0xe49df004
|
|
.int 0xe5d13000
|
|
.int 0xee070fba
|
|
.int 0xe1d0cf9f
|
|
.int 0xe15c0003
|
|
.int 0x1afffff6
|
|
.int 0xe1c0ef92
|
|
.int 0xe35e0000
|
|
.int 0x1afffff9
|
|
.int 0xee070fba
|
|
.int 0xeafffff1
|
|
#else
|
|
push {lr} @ (str lr, [sp, #-4]!)
|
|
cmp r3, #0
|
|
bne .L___atomic_compare_exchange_1_178
|
|
ldrb r3, [r1]
|
|
.L___atomic_compare_exchange_1_150:
|
|
ldrexb ip, [r0]
|
|
cmp ip, r3
|
|
bne .L___atomic_compare_exchange_1_168
|
|
strexb lr, r2, [r0]
|
|
cmp lr, #0
|
|
bne .L___atomic_compare_exchange_1_150
|
|
.L___atomic_compare_exchange_1_168:
|
|
moveq r0, #1
|
|
movne r0, #0
|
|
strbne ip, [r1]
|
|
pop {pc} @ (ldr pc, [sp], #4)
|
|
.L___atomic_compare_exchange_1_178:
|
|
ldrb r3, [r1]
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
.L___atomic_compare_exchange_1_180:
|
|
ldrexb ip, [r0]
|
|
cmp ip, r3
|
|
bne .L___atomic_compare_exchange_1_168
|
|
strexb lr, r2, [r0]
|
|
cmp lr, #0
|
|
bne .L___atomic_compare_exchange_1_180
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
b .L___atomic_compare_exchange_1_168
|
|
.size _(__atomic_compare_exchange_1), .-_(__atomic_compare_exchange_1)
|
|
|
|
#endif
|
|
.global _(__atomic_compare_exchange_2)
|
|
.type _(__atomic_compare_exchange_2), %function
|
|
_(__atomic_compare_exchange_2):
|
|
#ifdef __TINYC__
|
|
.int 0xe52de004
|
|
.int 0xe3530000
|
|
.int 0x1a00000a
|
|
.int 0xe1d130b0
|
|
.int 0xe1f0cf9f
|
|
.int 0xe15c0003
|
|
.int 0x1a000002
|
|
.int 0xe1e0ef92
|
|
.int 0xe35e0000
|
|
.int 0x1afffff9
|
|
.int 0x03a00001
|
|
.int 0x13a00000
|
|
.int 0x11c1c0b0
|
|
.int 0xe49df004
|
|
.int 0xe1d130b0
|
|
.int 0xee070fba
|
|
.int 0xe1f0cf9f
|
|
.int 0xe15c0003
|
|
.int 0x1afffff6
|
|
.int 0xe1e0ef92
|
|
.int 0xe35e0000
|
|
.int 0x1afffff9
|
|
.int 0xee070fba
|
|
.int 0xeafffff1
|
|
#else
|
|
push {lr} @ (str lr, [sp, #-4]!)
|
|
cmp r3, #0
|
|
bne .L___atomic_compare_exchange_2_1d8
|
|
ldrh r3, [r1]
|
|
.L___atomic_compare_exchange_2_1b0:
|
|
ldrexh ip, [r0]
|
|
cmp ip, r3
|
|
bne .L___atomic_compare_exchange_2_1c8
|
|
strexh lr, r2, [r0]
|
|
cmp lr, #0
|
|
bne .L___atomic_compare_exchange_2_1b0
|
|
.L___atomic_compare_exchange_2_1c8:
|
|
moveq r0, #1
|
|
movne r0, #0
|
|
strhne ip, [r1]
|
|
pop {pc} @ (ldr pc, [sp], #4)
|
|
.L___atomic_compare_exchange_2_1d8:
|
|
ldrh r3, [r1]
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
.L___atomic_compare_exchange_2_1e0:
|
|
ldrexh ip, [r0]
|
|
cmp ip, r3
|
|
bne .L___atomic_compare_exchange_2_1c8
|
|
strexh lr, r2, [r0]
|
|
cmp lr, #0
|
|
bne .L___atomic_compare_exchange_2_1e0
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
b .L___atomic_compare_exchange_2_1c8
|
|
.size _(__atomic_compare_exchange_2), .-_(__atomic_compare_exchange_2)
|
|
|
|
#endif
|
|
.global _(__atomic_compare_exchange_4)
|
|
.type _(__atomic_compare_exchange_4), %function
|
|
_(__atomic_compare_exchange_4):
|
|
#ifdef __TINYC__
|
|
.int 0xe52d4004
|
|
.int 0xe3530000
|
|
.int 0x1a00000b
|
|
.int 0xe5913000
|
|
.int 0xe1904f9f
|
|
.int 0xe1540003
|
|
.int 0x1a000002
|
|
.int 0xe180cf92
|
|
.int 0xe35c0000
|
|
.int 0x1afffff9
|
|
.int 0x03a00001
|
|
.int 0x13a00000
|
|
.int 0x15814000
|
|
.int 0xe49d4004
|
|
.int 0xe12fff1e
|
|
.int 0xe5913000
|
|
.int 0xee070fba
|
|
.int 0xe1904f9f
|
|
.int 0xe1540003
|
|
.int 0x1afffff5
|
|
.int 0xe180cf92
|
|
.int 0xe35c0000
|
|
.int 0x1afffff9
|
|
.int 0xee070fba
|
|
.int 0xeafffff0
|
|
#else
|
|
push {r4} @ (str r4, [sp, #-4]!)
|
|
cmp r3, #0
|
|
bne .L___atomic_compare_exchange_4_23c
|
|
ldr r3, [r1]
|
|
.L___atomic_compare_exchange_4_210:
|
|
ldrex r4, [r0]
|
|
cmp r4, r3
|
|
bne .L___atomic_compare_exchange_4_228
|
|
strex ip, r2, [r0]
|
|
cmp ip, #0
|
|
bne .L___atomic_compare_exchange_4_210
|
|
.L___atomic_compare_exchange_4_228:
|
|
moveq r0, #1
|
|
movne r0, #0
|
|
strne r4, [r1]
|
|
pop {r4} @ (ldr r4, [sp], #4)
|
|
bx lr
|
|
.L___atomic_compare_exchange_4_23c:
|
|
ldr r3, [r1]
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
.L___atomic_compare_exchange_4_244:
|
|
ldrex r4, [r0]
|
|
cmp r4, r3
|
|
bne .L___atomic_compare_exchange_4_228
|
|
strex ip, r2, [r0]
|
|
cmp ip, #0
|
|
bne .L___atomic_compare_exchange_4_244
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
b .L___atomic_compare_exchange_4_228
|
|
.size _(__atomic_compare_exchange_4), .-_(__atomic_compare_exchange_4)
|
|
|
|
#endif
|
|
.global _(__atomic_compare_exchange_8)
|
|
.type _(__atomic_compare_exchange_8), %function
|
|
_(__atomic_compare_exchange_8):
|
|
#ifdef __TINYC__
|
|
.int 0xe92d00f0
|
|
.int 0xe1a05003
|
|
.int 0xe59d3010
|
|
.int 0xe1a04002
|
|
.int 0xe3530000
|
|
.int 0x1a00000c
|
|
.int 0xe1c120d0
|
|
.int 0xe1b06f9f
|
|
.int 0xe1570003
|
|
.int 0x01560002
|
|
.int 0x1a000002
|
|
.int 0xe1a0cf94
|
|
.int 0xe35c0000
|
|
.int 0x1afffff8
|
|
.int 0x03a00001
|
|
.int 0x13a00000
|
|
.int 0x11c160f0
|
|
.int 0xe8bd00f0
|
|
.int 0xe12fff1e
|
|
.int 0xe1c120d0
|
|
.int 0xee070fba
|
|
.int 0xe1b06f9f
|
|
.int 0xe1570003
|
|
.int 0x01560002
|
|
.int 0x1afffff4
|
|
.int 0xe1a0cf94
|
|
.int 0xe35c0000
|
|
.int 0x1afffff8
|
|
.int 0xee070fba
|
|
.int 0xeaffffef
|
|
#else
|
|
push {r4, r5, r6, r7}
|
|
mov r5, r3
|
|
ldr r3, [sp, #16]
|
|
mov r4, r2
|
|
cmp r3, #0
|
|
bne .L___atomic_compare_exchange_8_2b0
|
|
ldrd r2, [r1]
|
|
.L___atomic_compare_exchange_8_280:
|
|
ldrexd r6, [r0]
|
|
cmp r7, r3
|
|
cmpeq r6, r2
|
|
bne .L___atomic_compare_exchange_8_29c
|
|
strexd ip, r4, [r0]
|
|
cmp ip, #0
|
|
bne .L___atomic_compare_exchange_8_280
|
|
.L___atomic_compare_exchange_8_29c:
|
|
moveq r0, #1
|
|
movne r0, #0
|
|
strdne r6, [r1]
|
|
pop {r4, r5, r6, r7}
|
|
bx lr
|
|
.L___atomic_compare_exchange_8_2b0:
|
|
ldrd r2, [r1]
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
.L___atomic_compare_exchange_8_2b8:
|
|
ldrexd r6, [r0]
|
|
cmp r7, r3
|
|
cmpeq r6, r2
|
|
bne .L___atomic_compare_exchange_8_29c
|
|
strexd ip, r4, [r0]
|
|
cmp ip, #0
|
|
bne .L___atomic_compare_exchange_8_2b8
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
b .L___atomic_compare_exchange_8_29c
|
|
.size _(__atomic_compare_exchange_8), .-_(__atomic_compare_exchange_8)
|
|
|
|
#endif
|
|
.global _(__atomic_test_and_set_1)
|
|
.type _(__atomic_test_and_set_1), %function
|
|
_(__atomic_test_and_set_1):
|
|
#ifdef __TINYC__
|
|
.int 0xe3a02001
|
|
.int 0xe3510000
|
|
.int 0x1a000005
|
|
.int 0xe1d03f9f
|
|
.int 0xe1c01f92
|
|
.int 0xe3510000
|
|
.int 0x1afffffb
|
|
.int 0xe6ef0073
|
|
.int 0xe12fff1e
|
|
.int 0xee070fba
|
|
.int 0xe1d03f9f
|
|
.int 0xe1c01f92
|
|
.int 0xe3510000
|
|
.int 0x1afffffb
|
|
.int 0xe6ef0073
|
|
.int 0xee070fba
|
|
.int 0xe12fff1e
|
|
#else
|
|
mov r2, #1
|
|
cmp r1, #0
|
|
bne .L___atomic_test_and_set_1_300
|
|
.L___atomic_test_and_set_1_2e8:
|
|
ldrexb r3, [r0]
|
|
strexb r1, r2, [r0]
|
|
cmp r1, #0
|
|
bne .L___atomic_test_and_set_1_2e8
|
|
uxtb r0, r3
|
|
bx lr
|
|
.L___atomic_test_and_set_1_300:
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
.L___atomic_test_and_set_1_304:
|
|
ldrexb r3, [r0]
|
|
strexb r1, r2, [r0]
|
|
cmp r1, #0
|
|
bne .L___atomic_test_and_set_1_304
|
|
uxtb r0, r3
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
bx lr
|
|
.size _(__atomic_test_and_set_1), .-_(__atomic_test_and_set_1)
|
|
|
|
#endif
|
|
.global _(__atomic_test_and_set_2)
|
|
.type _(__atomic_test_and_set_2), %function
|
|
_(__atomic_test_and_set_2):
|
|
#ifdef __TINYC__
|
|
.int 0xe3a02001
|
|
.int 0xe3510000
|
|
.int 0x1a000005
|
|
.int 0xe1d03f9f
|
|
.int 0xe1c01f92
|
|
.int 0xe3510000
|
|
.int 0x1afffffb
|
|
.int 0xe6ef0073
|
|
.int 0xe12fff1e
|
|
.int 0xee070fba
|
|
.int 0xe1d03f9f
|
|
.int 0xe1c01f92
|
|
.int 0xe3510000
|
|
.int 0x1afffffb
|
|
.int 0xe6ef0073
|
|
.int 0xee070fba
|
|
.int 0xe12fff1e
|
|
#else
|
|
mov r2, #1
|
|
cmp r1, #0
|
|
bne .L___atomic_test_and_set_2_344
|
|
.L___atomic_test_and_set_2_32c:
|
|
ldrexb r3, [r0]
|
|
strexb r1, r2, [r0]
|
|
cmp r1, #0
|
|
bne .L___atomic_test_and_set_2_32c
|
|
uxtb r0, r3
|
|
bx lr
|
|
.L___atomic_test_and_set_2_344:
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
.L___atomic_test_and_set_2_348:
|
|
ldrexb r3, [r0]
|
|
strexb r1, r2, [r0]
|
|
cmp r1, #0
|
|
bne .L___atomic_test_and_set_2_348
|
|
uxtb r0, r3
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
bx lr
|
|
.size _(__atomic_test_and_set_2), .-_(__atomic_test_and_set_2)
|
|
|
|
#endif
|
|
.global _(__atomic_test_and_set_4)
|
|
.type _(__atomic_test_and_set_4), %function
|
|
_(__atomic_test_and_set_4):
|
|
#ifdef __TINYC__
|
|
.int 0xe3a02001
|
|
.int 0xe3510000
|
|
.int 0x1a000005
|
|
.int 0xe1d03f9f
|
|
.int 0xe1c01f92
|
|
.int 0xe3510000
|
|
.int 0x1afffffb
|
|
.int 0xe6ef0073
|
|
.int 0xe12fff1e
|
|
.int 0xee070fba
|
|
.int 0xe1d03f9f
|
|
.int 0xe1c01f92
|
|
.int 0xe3510000
|
|
.int 0x1afffffb
|
|
.int 0xe6ef0073
|
|
.int 0xee070fba
|
|
.int 0xe12fff1e
|
|
#else
|
|
mov r2, #1
|
|
cmp r1, #0
|
|
bne .L___atomic_test_and_set_4_388
|
|
.L___atomic_test_and_set_4_370:
|
|
ldrexb r3, [r0]
|
|
strexb r1, r2, [r0]
|
|
cmp r1, #0
|
|
bne .L___atomic_test_and_set_4_370
|
|
uxtb r0, r3
|
|
bx lr
|
|
.L___atomic_test_and_set_4_388:
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
.L___atomic_test_and_set_4_38c:
|
|
ldrexb r3, [r0]
|
|
strexb r1, r2, [r0]
|
|
cmp r1, #0
|
|
bne .L___atomic_test_and_set_4_38c
|
|
uxtb r0, r3
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
bx lr
|
|
.size _(__atomic_test_and_set_4), .-_(__atomic_test_and_set_4)
|
|
|
|
#endif
|
|
.global _(__atomic_test_and_set_8)
|
|
.type _(__atomic_test_and_set_8), %function
|
|
_(__atomic_test_and_set_8):
|
|
#ifdef __TINYC__
|
|
.int 0xe3a02001
|
|
.int 0xe3510000
|
|
.int 0x1a000005
|
|
.int 0xe1d03f9f
|
|
.int 0xe1c01f92
|
|
.int 0xe3510000
|
|
.int 0x1afffffb
|
|
.int 0xe6ef0073
|
|
.int 0xe12fff1e
|
|
.int 0xee070fba
|
|
.int 0xe1d03f9f
|
|
.int 0xe1c01f92
|
|
.int 0xe3510000
|
|
.int 0x1afffffb
|
|
.int 0xe6ef0073
|
|
.int 0xee070fba
|
|
.int 0xe12fff1e
|
|
#else
|
|
mov r2, #1
|
|
cmp r1, #0
|
|
bne .L___atomic_test_and_set_8_3cc
|
|
.L___atomic_test_and_set_8_3b4:
|
|
ldrexb r3, [r0]
|
|
strexb r1, r2, [r0]
|
|
cmp r1, #0
|
|
bne .L___atomic_test_and_set_8_3b4
|
|
uxtb r0, r3
|
|
bx lr
|
|
.L___atomic_test_and_set_8_3cc:
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
.L___atomic_test_and_set_8_3d0:
|
|
ldrexb r3, [r0]
|
|
strexb r1, r2, [r0]
|
|
cmp r1, #0
|
|
bne .L___atomic_test_and_set_8_3d0
|
|
uxtb r0, r3
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
bx lr
|
|
.size _(__atomic_test_and_set_8), .-_(__atomic_test_and_set_8)
|
|
|
|
#endif
|
|
.global _(atomic_thread_fence)
|
|
.type _(atomic_thread_fence), %function
|
|
_(atomic_thread_fence):
|
|
#ifdef __TINYC__
|
|
.int 0xee070fba
|
|
.int 0xe12fff1e
|
|
#else
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
bx lr
|
|
.size _(atomic_thread_fence), .-_(atomic_thread_fence)
|
|
|
|
#endif
|
|
.global _(atomic_signal_fence)
|
|
.type _(atomic_signal_fence), %function
|
|
_(atomic_signal_fence):
|
|
#ifdef __TINYC__
|
|
.int 0xe12fff1e
|
|
#else
|
|
bx lr
|
|
.size _(atomic_signal_fence), .-_(atomic_signal_fence)
|
|
|
|
#endif
|
|
.global _(atomic_flag_test_and_set)
|
|
.type _(atomic_flag_test_and_set), %function
|
|
_(atomic_flag_test_and_set):
|
|
#ifdef __TINYC__
|
|
.int 0xe3a02001
|
|
.int 0xee070fba
|
|
.int 0xe1d03f9f
|
|
.int 0xe1c01f92
|
|
.int 0xe3510000
|
|
.int 0x1afffffb
|
|
.int 0xe6ef0073
|
|
.int 0xee070fba
|
|
.int 0xe12fff1e
|
|
#else
|
|
mov r2, #1
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
.L_atomic_flag_test_and_set_400:
|
|
ldrexb r3, [r0]
|
|
strexb r1, r2, [r0]
|
|
cmp r1, #0
|
|
bne .L_atomic_flag_test_and_set_400
|
|
uxtb r0, r3
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
bx lr
|
|
.size _(atomic_flag_test_and_set), .-_(atomic_flag_test_and_set)
|
|
|
|
#endif
|
|
.global _(atomic_flag_test_and_set_explicit)
|
|
.type _(atomic_flag_test_and_set_explicit), %function
|
|
_(atomic_flag_test_and_set_explicit):
|
|
#ifdef __TINYC__
|
|
.int 0xe3a02001
|
|
.int 0xee070fba
|
|
.int 0xe1d03f9f
|
|
.int 0xe1c01f92
|
|
.int 0xe3510000
|
|
.int 0x1afffffb
|
|
.int 0xe6ef0073
|
|
.int 0xee070fba
|
|
.int 0xe12fff1e
|
|
#else
|
|
mov r2, #1
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
.L_atomic_flag_test_and_set_explicit_424:
|
|
ldrexb r3, [r0]
|
|
strexb r1, r2, [r0]
|
|
cmp r1, #0
|
|
bne .L_atomic_flag_test_and_set_explicit_424
|
|
uxtb r0, r3
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
bx lr
|
|
.size _(atomic_flag_test_and_set_explicit), .-_(atomic_flag_test_and_set_explicit)
|
|
|
|
#endif
|
|
.global _(atomic_flag_clear)
|
|
.type _(atomic_flag_clear), %function
|
|
_(atomic_flag_clear):
|
|
#ifdef __TINYC__
|
|
.int 0xe3b03000
|
|
.int 0xee070fba
|
|
.int 0xe5c03000
|
|
.int 0xee070fba
|
|
.int 0xe12fff1e
|
|
#else
|
|
movs r3, #0
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
strb r3, [r0]
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
bx lr
|
|
.size _(atomic_flag_clear), .-_(atomic_flag_clear)
|
|
|
|
#endif
|
|
.global _(atomic_flag_clear_explicit)
|
|
.type _(atomic_flag_clear_explicit), %function
|
|
_(atomic_flag_clear_explicit):
|
|
#ifdef __TINYC__
|
|
.int 0xe3b03000
|
|
.int 0xee070fba
|
|
.int 0xe5c03000
|
|
.int 0xee070fba
|
|
.int 0xe12fff1e
|
|
#else
|
|
movs r3, #0
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
strb r3, [r0]
|
|
mcr p15, #0, r0, c7, c10, #5
|
|
bx lr
|
|
.size _(atomic_flag_clear_explicit), .-_(atomic_flag_clear_explicit)
|
|
|
|
#endif
|
|
#endif //__arm__
|
|
|
|
/* ---------------------------------------------- */
|
|
#if defined __aarch64__
|
|
.text
|
|
|
|
.global _(__atomic_load_1)
|
|
.type _(__atomic_load_1), %function
|
|
_(__atomic_load_1):
|
|
#ifdef __TINYC__
|
|
.int 0x35000081
|
|
.int 0x39400000
|
|
.int 0x12001c00
|
|
.int 0xd65f03c0
|
|
.int 0x08dffc00
|
|
.int 0x12001c00
|
|
.int 0xd65f03c0
|
|
#else
|
|
cbnz w1, .L___atomic_load_1_010
|
|
ldrb w0, [x0]
|
|
and w0, w0, #0xff
|
|
ret
|
|
.L___atomic_load_1_010:
|
|
ldarb w0, [x0]
|
|
and w0, w0, #0xff
|
|
ret
|
|
.size _(__atomic_load_1), .-_(__atomic_load_1)
|
|
|
|
#endif
|
|
.global _(__atomic_load_2)
|
|
.type _(__atomic_load_2), %function
|
|
_(__atomic_load_2):
|
|
#ifdef __TINYC__
|
|
.int 0x35000081
|
|
.int 0x79400000
|
|
.int 0x12003c00
|
|
.int 0xd65f03c0
|
|
.int 0x48dffc00
|
|
.int 0x12003c00
|
|
.int 0xd65f03c0
|
|
#else
|
|
cbnz w1, .L___atomic_load_2_010
|
|
ldrh w0, [x0]
|
|
and w0, w0, #0xffff
|
|
ret
|
|
.L___atomic_load_2_010:
|
|
ldarh w0, [x0]
|
|
and w0, w0, #0xffff
|
|
ret
|
|
.size _(__atomic_load_2), .-_(__atomic_load_2)
|
|
|
|
#endif
|
|
.global _(__atomic_load_4)
|
|
.type _(__atomic_load_4), %function
|
|
_(__atomic_load_4):
|
|
#ifdef __TINYC__
|
|
.int 0x35000061
|
|
.int 0xb9400000
|
|
.int 0xd65f03c0
|
|
.int 0x88dffc00
|
|
.int 0xd65f03c0
|
|
#else
|
|
cbnz w1, .L___atomic_load_4_00c
|
|
ldr w0, [x0]
|
|
ret
|
|
.L___atomic_load_4_00c:
|
|
ldar w0, [x0]
|
|
ret
|
|
.size _(__atomic_load_4), .-_(__atomic_load_4)
|
|
|
|
#endif
|
|
.global _(__atomic_load_8)
|
|
.type _(__atomic_load_8), %function
|
|
_(__atomic_load_8):
|
|
#ifdef __TINYC__
|
|
.int 0x35000061
|
|
.int 0xf9400000
|
|
.int 0xd65f03c0
|
|
.int 0xc8dffc00
|
|
.int 0xd65f03c0
|
|
#else
|
|
cbnz w1, .L___atomic_load_8_00c
|
|
ldr x0, [x0]
|
|
ret
|
|
.L___atomic_load_8_00c:
|
|
ldar x0, [x0]
|
|
ret
|
|
.size _(__atomic_load_8), .-_(__atomic_load_8)
|
|
|
|
#endif
|
|
.global _(__atomic_store_1)
|
|
.type _(__atomic_store_1), %function
|
|
_(__atomic_store_1):
|
|
#ifdef __TINYC__
|
|
.int 0x12001c21
|
|
.int 0x35000062
|
|
.int 0x39000001
|
|
.int 0xd65f03c0
|
|
.int 0x089ffc01
|
|
.int 0xd65f03c0
|
|
#else
|
|
and w1, w1, #0xff
|
|
cbnz w2, .L___atomic_store_1_010
|
|
strb w1, [x0]
|
|
ret
|
|
.L___atomic_store_1_010:
|
|
stlrb w1, [x0]
|
|
ret
|
|
.size _(__atomic_store_1), .-_(__atomic_store_1)
|
|
|
|
#endif
|
|
.global _(__atomic_store_2)
|
|
.type _(__atomic_store_2), %function
|
|
_(__atomic_store_2):
|
|
#ifdef __TINYC__
|
|
.int 0x12003c21
|
|
.int 0x35000062
|
|
.int 0x79000001
|
|
.int 0xd65f03c0
|
|
.int 0x489ffc01
|
|
.int 0xd65f03c0
|
|
#else
|
|
and w1, w1, #0xffff
|
|
cbnz w2, .L___atomic_store_2_010
|
|
strh w1, [x0]
|
|
ret
|
|
.L___atomic_store_2_010:
|
|
stlrh w1, [x0]
|
|
ret
|
|
.size _(__atomic_store_2), .-_(__atomic_store_2)
|
|
|
|
#endif
|
|
.global _(__atomic_store_4)
|
|
.type _(__atomic_store_4), %function
|
|
_(__atomic_store_4):
|
|
#ifdef __TINYC__
|
|
.int 0x35000062
|
|
.int 0xb9000001
|
|
.int 0xd65f03c0
|
|
.int 0x889ffc01
|
|
.int 0xd65f03c0
|
|
#else
|
|
cbnz w2, .L___atomic_store_4_00c
|
|
str w1, [x0]
|
|
ret
|
|
.L___atomic_store_4_00c:
|
|
stlr w1, [x0]
|
|
ret
|
|
.size _(__atomic_store_4), .-_(__atomic_store_4)
|
|
|
|
#endif
|
|
.global _(__atomic_store_8)
|
|
.type _(__atomic_store_8), %function
|
|
_(__atomic_store_8):
|
|
#ifdef __TINYC__
|
|
.int 0x35000062
|
|
.int 0xf9000001
|
|
.int 0xd65f03c0
|
|
.int 0xc89ffc01
|
|
.int 0xd65f03c0
|
|
#else
|
|
cbnz w2, .L___atomic_store_8_00c
|
|
str x1, [x0]
|
|
ret
|
|
.L___atomic_store_8_00c:
|
|
stlr x1, [x0]
|
|
ret
|
|
.size _(__atomic_store_8), .-_(__atomic_store_8)
|
|
|
|
#endif
|
|
.global _(__atomic_compare_exchange_1)
|
|
.type _(__atomic_compare_exchange_1), %function
|
|
_(__atomic_compare_exchange_1):
|
|
#ifdef __TINYC__
|
|
.int 0x12001c42
|
|
.int 0x35000143
|
|
.int 0x39400023
|
|
.int 0x085f7c04
|
|
.int 0x6b23009f
|
|
.int 0x54000061
|
|
.int 0x08057c02
|
|
.int 0x35ffff85
|
|
.int 0x1a9f17e0
|
|
.int 0x54000141
|
|
.int 0xd65f03c0
|
|
.int 0x39400023
|
|
.int 0x085ffc04
|
|
.int 0x6b23009f
|
|
.int 0x54000061
|
|
.int 0x0805fc02
|
|
.int 0x35ffff85
|
|
.int 0x1a9f17e0
|
|
.int 0x54ffff00
|
|
.int 0x39000024
|
|
.int 0xd65f03c0
|
|
#else
|
|
and w2, w2, #0xff
|
|
cbnz w3, .L___atomic_compare_exchange_1_02c
|
|
ldrb w3, [x1]
|
|
.L___atomic_compare_exchange_1_00c:
|
|
ldxrb w4, [x0]
|
|
cmp w4, w3, uxtb
|
|
b.ne .L___atomic_compare_exchange_1_020
|
|
stxrb w5, w2, [x0]
|
|
cbnz w5, .L___atomic_compare_exchange_1_00c
|
|
.L___atomic_compare_exchange_1_020:
|
|
cset w0, eq // eq = none
|
|
b.ne .L___atomic_compare_exchange_1_04c
|
|
.L___atomic_compare_exchange_1_028:
|
|
ret
|
|
.L___atomic_compare_exchange_1_02c:
|
|
ldrb w3, [x1]
|
|
.L___atomic_compare_exchange_1_030:
|
|
ldaxrb w4, [x0]
|
|
cmp w4, w3, uxtb
|
|
b.ne .L___atomic_compare_exchange_1_044
|
|
stlxrb w5, w2, [x0]
|
|
cbnz w5, .L___atomic_compare_exchange_1_030
|
|
.L___atomic_compare_exchange_1_044:
|
|
cset w0, eq // eq = none
|
|
b.eq .L___atomic_compare_exchange_1_028
|
|
.L___atomic_compare_exchange_1_04c:
|
|
strb w4, [x1]
|
|
ret
|
|
.size _(__atomic_compare_exchange_1), .-_(__atomic_compare_exchange_1)
|
|
|
|
#endif
|
|
.global _(__atomic_compare_exchange_2)
|
|
.type _(__atomic_compare_exchange_2), %function
|
|
_(__atomic_compare_exchange_2):
|
|
#ifdef __TINYC__
|
|
.int 0x12003c42
|
|
.int 0x35000143
|
|
.int 0x79400023
|
|
.int 0x485f7c04
|
|
.int 0x6b23209f
|
|
.int 0x54000061
|
|
.int 0x48057c02
|
|
.int 0x35ffff85
|
|
.int 0x1a9f17e0
|
|
.int 0x54000141
|
|
.int 0xd65f03c0
|
|
.int 0x79400023
|
|
.int 0x485ffc04
|
|
.int 0x6b23209f
|
|
.int 0x54000061
|
|
.int 0x4805fc02
|
|
.int 0x35ffff85
|
|
.int 0x1a9f17e0
|
|
.int 0x54ffff00
|
|
.int 0x79000024
|
|
.int 0xd65f03c0
|
|
#else
|
|
and w2, w2, #0xffff
|
|
cbnz w3, .L___atomic_compare_exchange_2_02c
|
|
ldrh w3, [x1]
|
|
.L___atomic_compare_exchange_2_00c:
|
|
ldxrh w4, [x0]
|
|
cmp w4, w3, uxth
|
|
b.ne .L___atomic_compare_exchange_2_020
|
|
stxrh w5, w2, [x0]
|
|
cbnz w5, .L___atomic_compare_exchange_2_00c
|
|
.L___atomic_compare_exchange_2_020:
|
|
cset w0, eq // eq = none
|
|
b.ne .L___atomic_compare_exchange_2_04c
|
|
.L___atomic_compare_exchange_2_028:
|
|
ret
|
|
.L___atomic_compare_exchange_2_02c:
|
|
ldrh w3, [x1]
|
|
.L___atomic_compare_exchange_2_030:
|
|
ldaxrh w4, [x0]
|
|
cmp w4, w3, uxth
|
|
b.ne .L___atomic_compare_exchange_2_044
|
|
stlxrh w5, w2, [x0]
|
|
cbnz w5, .L___atomic_compare_exchange_2_030
|
|
.L___atomic_compare_exchange_2_044:
|
|
cset w0, eq // eq = none
|
|
b.eq .L___atomic_compare_exchange_2_028
|
|
.L___atomic_compare_exchange_2_04c:
|
|
strh w4, [x1]
|
|
ret
|
|
.size _(__atomic_compare_exchange_2), .-_(__atomic_compare_exchange_2)
|
|
|
|
#endif
|
|
.global _(__atomic_compare_exchange_4)
|
|
.type _(__atomic_compare_exchange_4), %function
|
|
_(__atomic_compare_exchange_4):
|
|
#ifdef __TINYC__
|
|
.int 0x35000143
|
|
.int 0xb9400023
|
|
.int 0x885f7c04
|
|
.int 0x6b03009f
|
|
.int 0x54000061
|
|
.int 0x88057c02
|
|
.int 0x35ffff85
|
|
.int 0x1a9f17e0
|
|
.int 0x54000141
|
|
.int 0xd65f03c0
|
|
.int 0xb9400023
|
|
.int 0x885ffc04
|
|
.int 0x6b03009f
|
|
.int 0x54000061
|
|
.int 0x8805fc02
|
|
.int 0x35ffff85
|
|
.int 0x1a9f17e0
|
|
.int 0x54ffff00
|
|
.int 0xb9000024
|
|
.int 0xd65f03c0
|
|
#else
|
|
cbnz w3, .L___atomic_compare_exchange_4_028
|
|
ldr w3, [x1]
|
|
.L___atomic_compare_exchange_4_008:
|
|
ldxr w4, [x0]
|
|
cmp w4, w3
|
|
b.ne .L___atomic_compare_exchange_4_01c
|
|
stxr w5, w2, [x0]
|
|
cbnz w5, .L___atomic_compare_exchange_4_008
|
|
.L___atomic_compare_exchange_4_01c:
|
|
cset w0, eq // eq = none
|
|
b.ne .L___atomic_compare_exchange_4_048
|
|
.L___atomic_compare_exchange_4_024:
|
|
ret
|
|
.L___atomic_compare_exchange_4_028:
|
|
ldr w3, [x1]
|
|
.L___atomic_compare_exchange_4_02c:
|
|
ldaxr w4, [x0]
|
|
cmp w4, w3
|
|
b.ne .L___atomic_compare_exchange_4_040
|
|
stlxr w5, w2, [x0]
|
|
cbnz w5, .L___atomic_compare_exchange_4_02c
|
|
.L___atomic_compare_exchange_4_040:
|
|
cset w0, eq // eq = none
|
|
b.eq .L___atomic_compare_exchange_4_024
|
|
.L___atomic_compare_exchange_4_048:
|
|
str w4, [x1]
|
|
ret
|
|
.size _(__atomic_compare_exchange_4), .-_(__atomic_compare_exchange_4)
|
|
|
|
#endif
|
|
.global _(__atomic_compare_exchange_8)
|
|
.type _(__atomic_compare_exchange_8), %function
|
|
_(__atomic_compare_exchange_8):
|
|
#ifdef __TINYC__
|
|
.int 0x35000143
|
|
.int 0xf9400023
|
|
.int 0xc85f7c04
|
|
.int 0xeb03009f
|
|
.int 0x54000061
|
|
.int 0xc8057c02
|
|
.int 0x35ffff85
|
|
.int 0x1a9f17e0
|
|
.int 0x54000141
|
|
.int 0xd65f03c0
|
|
.int 0xf9400023
|
|
.int 0xc85ffc04
|
|
.int 0xeb03009f
|
|
.int 0x54000061
|
|
.int 0xc805fc02
|
|
.int 0x35ffff85
|
|
.int 0x1a9f17e0
|
|
.int 0x54ffff00
|
|
.int 0xf9000024
|
|
.int 0xd65f03c0
|
|
#else
|
|
cbnz w3, .L___atomic_compare_exchange_8_028
|
|
ldr x3, [x1]
|
|
.L___atomic_compare_exchange_8_008:
|
|
ldxr x4, [x0]
|
|
cmp x4, x3
|
|
b.ne .L___atomic_compare_exchange_8_01c
|
|
stxr w5, x2, [x0]
|
|
cbnz w5, .L___atomic_compare_exchange_8_008
|
|
.L___atomic_compare_exchange_8_01c:
|
|
cset w0, eq // eq = none
|
|
b.ne .L___atomic_compare_exchange_8_048
|
|
.L___atomic_compare_exchange_8_024:
|
|
ret
|
|
.L___atomic_compare_exchange_8_028:
|
|
ldr x3, [x1]
|
|
.L___atomic_compare_exchange_8_02c:
|
|
ldaxr x4, [x0]
|
|
cmp x4, x3
|
|
b.ne .L___atomic_compare_exchange_8_040
|
|
stlxr w5, x2, [x0]
|
|
cbnz w5, .L___atomic_compare_exchange_8_02c
|
|
.L___atomic_compare_exchange_8_040:
|
|
cset w0, eq // eq = none
|
|
b.eq .L___atomic_compare_exchange_8_024
|
|
.L___atomic_compare_exchange_8_048:
|
|
str x4, [x1]
|
|
ret
|
|
.size _(__atomic_compare_exchange_8), .-_(__atomic_compare_exchange_8)
|
|
|
|
#endif
|
|
.global _(__atomic_test_and_set_1)
|
|
.type _(__atomic_test_and_set_1), %function
|
|
_(__atomic_test_and_set_1):
|
|
#ifdef __TINYC__
|
|
.int 0x52800022
|
|
.int 0x350000c1
|
|
.int 0x085f7c01
|
|
.int 0x08037c02
|
|
.int 0x35ffffc3
|
|
.int 0x12001c20
|
|
.int 0xd65f03c0
|
|
.int 0x085ffc01
|
|
.int 0x0803fc02
|
|
.int 0x35ffffc3
|
|
.int 0x12001c20
|
|
.int 0xd65f03c0
|
|
#else
|
|
mov w2, #0x1 // #1
|
|
cbnz w1, .L___atomic_test_and_set_1_01c
|
|
.L___atomic_test_and_set_1_008:
|
|
ldxrb w1, [x0]
|
|
stxrb w3, w2, [x0]
|
|
cbnz w3, .L___atomic_test_and_set_1_008
|
|
and w0, w1, #0xff
|
|
ret
|
|
.L___atomic_test_and_set_1_01c:
|
|
ldaxrb w1, [x0]
|
|
stlxrb w3, w2, [x0]
|
|
cbnz w3, .L___atomic_test_and_set_1_01c
|
|
and w0, w1, #0xff
|
|
ret
|
|
.size _(__atomic_test_and_set_1), .-_(__atomic_test_and_set_1)
|
|
|
|
#endif
|
|
.global _(__atomic_test_and_set_2)
|
|
.type _(__atomic_test_and_set_2), %function
|
|
_(__atomic_test_and_set_2):
|
|
#ifdef __TINYC__
|
|
.int 0x52800022
|
|
.int 0x350000c1
|
|
.int 0x085f7c01
|
|
.int 0x08037c02
|
|
.int 0x35ffffc3
|
|
.int 0x12001c20
|
|
.int 0xd65f03c0
|
|
.int 0x085ffc01
|
|
.int 0x0803fc02
|
|
.int 0x35ffffc3
|
|
.int 0x12001c20
|
|
.int 0xd65f03c0
|
|
#else
|
|
mov w2, #0x1 // #1
|
|
cbnz w1, .L___atomic_test_and_set_2_01c
|
|
.L___atomic_test_and_set_2_008:
|
|
ldxrb w1, [x0]
|
|
stxrb w3, w2, [x0]
|
|
cbnz w3, .L___atomic_test_and_set_2_008
|
|
and w0, w1, #0xff
|
|
ret
|
|
.L___atomic_test_and_set_2_01c:
|
|
ldaxrb w1, [x0]
|
|
stlxrb w3, w2, [x0]
|
|
cbnz w3, .L___atomic_test_and_set_2_01c
|
|
and w0, w1, #0xff
|
|
ret
|
|
.size _(__atomic_test_and_set_2), .-_(__atomic_test_and_set_2)
|
|
|
|
#endif
|
|
.global _(__atomic_test_and_set_4)
|
|
.type _(__atomic_test_and_set_4), %function
|
|
_(__atomic_test_and_set_4):
|
|
#ifdef __TINYC__
|
|
.int 0x52800022
|
|
.int 0x350000c1
|
|
.int 0x085f7c01
|
|
.int 0x08037c02
|
|
.int 0x35ffffc3
|
|
.int 0x12001c20
|
|
.int 0xd65f03c0
|
|
.int 0x085ffc01
|
|
.int 0x0803fc02
|
|
.int 0x35ffffc3
|
|
.int 0x12001c20
|
|
.int 0xd65f03c0
|
|
#else
|
|
mov w2, #0x1 // #1
|
|
cbnz w1, .L___atomic_test_and_set_4_01c
|
|
.L___atomic_test_and_set_4_008:
|
|
ldxrb w1, [x0]
|
|
stxrb w3, w2, [x0]
|
|
cbnz w3, .L___atomic_test_and_set_4_008
|
|
and w0, w1, #0xff
|
|
ret
|
|
.L___atomic_test_and_set_4_01c:
|
|
ldaxrb w1, [x0]
|
|
stlxrb w3, w2, [x0]
|
|
cbnz w3, .L___atomic_test_and_set_4_01c
|
|
and w0, w1, #0xff
|
|
ret
|
|
.size _(__atomic_test_and_set_4), .-_(__atomic_test_and_set_4)
|
|
|
|
#endif
|
|
.global _(__atomic_test_and_set_8)
|
|
.type _(__atomic_test_and_set_8), %function
|
|
_(__atomic_test_and_set_8):
|
|
#ifdef __TINYC__
|
|
.int 0x52800022
|
|
.int 0x350000c1
|
|
.int 0x085f7c01
|
|
.int 0x08037c02
|
|
.int 0x35ffffc3
|
|
.int 0x12001c20
|
|
.int 0xd65f03c0
|
|
.int 0x085ffc01
|
|
.int 0x0803fc02
|
|
.int 0x35ffffc3
|
|
.int 0x12001c20
|
|
.int 0xd65f03c0
|
|
#else
|
|
mov w2, #0x1 // #1
|
|
cbnz w1, .L___atomic_test_and_set_8_01c
|
|
.L___atomic_test_and_set_8_008:
|
|
ldxrb w1, [x0]
|
|
stxrb w3, w2, [x0]
|
|
cbnz w3, .L___atomic_test_and_set_8_008
|
|
and w0, w1, #0xff
|
|
ret
|
|
.L___atomic_test_and_set_8_01c:
|
|
ldaxrb w1, [x0]
|
|
stlxrb w3, w2, [x0]
|
|
cbnz w3, .L___atomic_test_and_set_8_01c
|
|
and w0, w1, #0xff
|
|
ret
|
|
.size _(__atomic_test_and_set_8), .-_(__atomic_test_and_set_8)
|
|
|
|
#endif
|
|
.global _(atomic_thread_fence)
|
|
.type _(atomic_thread_fence), %function
|
|
_(atomic_thread_fence):
|
|
#ifdef __TINYC__
|
|
.int 0xd5033bbf
|
|
.int 0xd65f03c0
|
|
#else
|
|
dmb ish
|
|
ret
|
|
.size _(atomic_thread_fence), .-_(atomic_thread_fence)
|
|
|
|
#endif
|
|
.global _(atomic_signal_fence)
|
|
.type _(atomic_signal_fence), %function
|
|
_(atomic_signal_fence):
|
|
#ifdef __TINYC__
|
|
.int 0xd65f03c0
|
|
#else
|
|
ret
|
|
.size _(atomic_signal_fence), .-_(atomic_signal_fence)
|
|
|
|
#endif
|
|
.global _(atomic_flag_test_and_set)
|
|
.type _(atomic_flag_test_and_set), %function
|
|
_(atomic_flag_test_and_set):
|
|
#ifdef __TINYC__
|
|
.int 0xaa0003e1
|
|
.int 0x52800022
|
|
.int 0x085ffc20
|
|
.int 0x0803fc22
|
|
.int 0x35ffffc3
|
|
.int 0xd65f03c0
|
|
#else
|
|
mov x1, x0
|
|
mov w2, #0x1 // #1
|
|
.L_atomic_flag_test_and_set_008:
|
|
ldaxrb w0, [x1]
|
|
stlxrb w3, w2, [x1]
|
|
cbnz w3, .L_atomic_flag_test_and_set_008
|
|
ret
|
|
.size _(atomic_flag_test_and_set), .-_(atomic_flag_test_and_set)
|
|
|
|
#endif
|
|
.global _(atomic_flag_test_and_set_explicit)
|
|
.type _(atomic_flag_test_and_set_explicit), %function
|
|
_(atomic_flag_test_and_set_explicit):
|
|
#ifdef __TINYC__
|
|
.int 0xaa0003e1
|
|
.int 0x52800022
|
|
.int 0x085ffc20
|
|
.int 0x0803fc22
|
|
.int 0x35ffffc3
|
|
.int 0xd65f03c0
|
|
#else
|
|
mov x1, x0
|
|
mov w2, #0x1 // #1
|
|
.L_atomic_flag_test_and_set_explicit_020:
|
|
ldaxrb w0, [x1]
|
|
stlxrb w3, w2, [x1]
|
|
cbnz w3, .L_atomic_flag_test_and_set_explicit_020
|
|
ret
|
|
.size _(atomic_flag_test_and_set_explicit), .-_(atomic_flag_test_and_set_explicit)
|
|
|
|
#endif
|
|
.global _(atomic_flag_clear)
|
|
.type _(atomic_flag_clear), %function
|
|
_(atomic_flag_clear):
|
|
#ifdef __TINYC__
|
|
.int 0x089ffc1f
|
|
.int 0xd65f03c0
|
|
#else
|
|
stlrb wzr, [x0]
|
|
ret
|
|
.size _(atomic_flag_clear), .-_(atomic_flag_clear)
|
|
|
|
#endif
|
|
.global _(atomic_flag_clear_explicit)
|
|
.type _(atomic_flag_clear_explicit), %function
|
|
_(atomic_flag_clear_explicit):
|
|
#ifdef __TINYC__
|
|
.int 0x089ffc1f
|
|
.int 0xd65f03c0
|
|
#else
|
|
stlrb wzr, [x0]
|
|
ret
|
|
.size _(atomic_flag_clear_explicit), .-_(atomic_flag_clear_explicit)
|
|
|
|
#endif
|
|
#endif //__aarch64__
|
|
|
|
/* ---------------------------------------------- */
|
|
#if defined __riscv
|
|
.text
|
|
|
|
.global _(__atomic_load_1)
|
|
.type _(__atomic_load_1), %function
|
|
_(__atomic_load_1):
|
|
#ifdef __TINYC__
|
|
.int 0x0330000f
|
|
.int 0x00054503
|
|
.int 0x0330000f
|
|
.short 0x8082
|
|
#else
|
|
fence rw,rw
|
|
lbu a0,0(a0)
|
|
fence rw,rw
|
|
ret
|
|
.size _(__atomic_load_1), .-_(__atomic_load_1)
|
|
|
|
#endif
|
|
.global _(__atomic_load_2)
|
|
.type _(__atomic_load_2), %function
|
|
_(__atomic_load_2):
|
|
#ifdef __TINYC__
|
|
.int 0x0330000f
|
|
.int 0x00055503
|
|
.int 0x0330000f
|
|
.short 0x8082
|
|
#else
|
|
fence rw,rw
|
|
lhu a0,0(a0)
|
|
fence rw,rw
|
|
ret
|
|
.size _(__atomic_load_2), .-_(__atomic_load_2)
|
|
|
|
#endif
|
|
.global _(__atomic_load_4)
|
|
.type _(__atomic_load_4), %function
|
|
_(__atomic_load_4):
|
|
#ifdef __TINYC__
|
|
.int 0x0330000f
|
|
.short 0x4108
|
|
.int 0x0230000f
|
|
.short 0x2501
|
|
.short 0x8082
|
|
#else
|
|
fence rw,rw
|
|
lw a0,0(a0)
|
|
fence r,rw
|
|
sext.w a0,a0
|
|
ret
|
|
.size _(__atomic_load_4), .-_(__atomic_load_4)
|
|
|
|
#endif
|
|
.global _(__atomic_load_8)
|
|
.type _(__atomic_load_8), %function
|
|
_(__atomic_load_8):
|
|
#ifdef __TINYC__
|
|
.int 0x0330000f
|
|
.short 0x6108
|
|
.int 0x0230000f
|
|
.short 0x8082
|
|
#else
|
|
fence rw,rw
|
|
ld a0,0(a0)
|
|
fence r,rw
|
|
ret
|
|
.size _(__atomic_load_8), .-_(__atomic_load_8)
|
|
|
|
#endif
|
|
.global _(__atomic_store_1)
|
|
.type _(__atomic_store_1), %function
|
|
_(__atomic_store_1):
|
|
#ifdef __TINYC__
|
|
.int 0x0330000f
|
|
.int 0x00b50023
|
|
.int 0x0330000f
|
|
.short 0x8082
|
|
#else
|
|
fence rw,rw
|
|
sb a1,0(a0)
|
|
fence rw,rw
|
|
ret
|
|
.size _(__atomic_store_1), .-_(__atomic_store_1)
|
|
|
|
#endif
|
|
.global _(__atomic_store_2)
|
|
.type _(__atomic_store_2), %function
|
|
_(__atomic_store_2):
|
|
#ifdef __TINYC__
|
|
.int 0x0330000f
|
|
.int 0x00b51023
|
|
.int 0x0330000f
|
|
.short 0x8082
|
|
#else
|
|
fence rw,rw
|
|
sh a1,0(a0)
|
|
fence rw,rw
|
|
ret
|
|
.size _(__atomic_store_2), .-_(__atomic_store_2)
|
|
|
|
#endif
|
|
.global _(__atomic_store_4)
|
|
.type _(__atomic_store_4), %function
|
|
_(__atomic_store_4):
|
|
#ifdef __TINYC__
|
|
.int 0x0310000f
|
|
.short 0xc10c
|
|
.int 0x0330000f
|
|
.short 0x8082
|
|
#else
|
|
fence rw,w
|
|
sw a1,0(a0)
|
|
fence rw,rw
|
|
ret
|
|
.size _(__atomic_store_4), .-_(__atomic_store_4)
|
|
|
|
#endif
|
|
.global _(__atomic_store_8)
|
|
.type _(__atomic_store_8), %function
|
|
_(__atomic_store_8):
|
|
#ifdef __TINYC__
|
|
.int 0x0310000f
|
|
.short 0xe10c
|
|
.int 0x0330000f
|
|
.short 0x8082
|
|
#else
|
|
fence rw,w
|
|
sd a1,0(a0)
|
|
fence rw,rw
|
|
ret
|
|
.size _(__atomic_store_8), .-_(__atomic_store_8)
|
|
|
|
#endif
|
|
.global _(__atomic_compare_exchange_1)
|
|
.type _(__atomic_compare_exchange_1), %function
|
|
_(__atomic_compare_exchange_1):
|
|
#ifdef __TINYC__
|
|
.int 0x0005c683
|
|
.int 0x00357793
|
|
.int 0x0037979b
|
|
.int 0x0ff00713
|
|
.int 0x00f7173b
|
|
.int 0x00f698bb
|
|
.int 0x00f6163b
|
|
.short 0x9971
|
|
.int 0xfff74313
|
|
.int 0x00e8f8b3
|
|
.short 0x8e79
|
|
.int 0x1605282f
|
|
.int 0x00e87e33
|
|
.int 0x011e1a63
|
|
.int 0x00687e33
|
|
.int 0x00ce6e33
|
|
.int 0x1bc52e2f
|
|
.int 0xfe0e14e3
|
|
.int 0x40f8583b
|
|
.int 0x0188179b
|
|
.int 0x0186969b
|
|
.int 0x4187d79b
|
|
.int 0x4186d69b
|
|
.short 0x9f95
|
|
.int 0x0017b513
|
|
.short 0xc399
|
|
.int 0x01058023
|
|
.short 0x8905
|
|
.short 0x8082
|
|
#else
|
|
lbu a3,0(a1)
|
|
andi a5,a0,3
|
|
slliw a5,a5,0x3
|
|
li a4,255
|
|
sllw a4,a4,a5
|
|
sllw a7,a3,a5
|
|
sllw a2,a2,a5
|
|
andi a0,a0,-4
|
|
not t1,a4
|
|
and a7,a7,a4
|
|
and a2,a2,a4
|
|
.L___atomic_compare_exchange_1_028:
|
|
lr.w.aqrl a6,(a0)
|
|
and t3,a6,a4
|
|
bne t3,a7, .L___atomic_compare_exchange_1_044
|
|
and t3,a6,t1
|
|
or t3,t3,a2
|
|
sc.w.rl t3,t3,(a0)
|
|
bnez t3, .L___atomic_compare_exchange_1_028
|
|
.L___atomic_compare_exchange_1_044:
|
|
sraw a6,a6,a5
|
|
slliw a5,a6,0x18
|
|
slliw a3,a3,0x18
|
|
sraiw a5,a5,0x18
|
|
sraiw a3,a3,0x18
|
|
subw a5,a5,a3
|
|
seqz a0,a5
|
|
beqz a5, .L___atomic_compare_exchange_1_064
|
|
sb a6,0(a1)
|
|
.L___atomic_compare_exchange_1_064:
|
|
andi a0,a0,1
|
|
ret
|
|
.size _(__atomic_compare_exchange_1), .-_(__atomic_compare_exchange_1)
|
|
|
|
#endif
|
|
.global _(__atomic_compare_exchange_2)
|
|
.type _(__atomic_compare_exchange_2), %function
|
|
_(__atomic_compare_exchange_2):
|
|
#ifdef __TINYC__
|
|
.int 0x0005d683
|
|
.int 0x00357713
|
|
.short 0x67c1
|
|
.int 0x0037171b
|
|
.short 0x37fd
|
|
.int 0x00e797bb
|
|
.int 0x00e698bb
|
|
.int 0x00e6163b
|
|
.short 0x9971
|
|
.int 0xfff7c313
|
|
.int 0x00f8f8b3
|
|
.short 0x8e7d
|
|
.int 0x1605282f
|
|
.int 0x00f87e33
|
|
.int 0x011e1a63
|
|
.int 0x00687e33
|
|
.int 0x00ce6e33
|
|
.int 0x1bc52e2f
|
|
.int 0xfe0e14e3
|
|
.int 0x40e8583b
|
|
.int 0x0108179b
|
|
.int 0x0106969b
|
|
.int 0x4107d79b
|
|
.int 0x4106d69b
|
|
.short 0x9f95
|
|
.int 0x0017b513
|
|
.short 0xc399
|
|
.int 0x01059023
|
|
.short 0x8905
|
|
.short 0x8082
|
|
#else
|
|
lhu a3,0(a1)
|
|
andi a4,a0,3
|
|
lui a5,0x10
|
|
slliw a4,a4,0x3
|
|
addiw a5,a5,-1 # ffff <.LASF16+0xfec8>
|
|
sllw a5,a5,a4
|
|
sllw a7,a3,a4
|
|
sllw a2,a2,a4
|
|
andi a0,a0,-4
|
|
not t1,a5
|
|
and a7,a7,a5
|
|
and a2,a2,a5
|
|
.L___atomic_compare_exchange_2_028:
|
|
lr.w.aqrl a6,(a0)
|
|
and t3,a6,a5
|
|
bne t3,a7, .L___atomic_compare_exchange_2_044
|
|
and t3,a6,t1
|
|
or t3,t3,a2
|
|
sc.w.rl t3,t3,(a0)
|
|
bnez t3, .L___atomic_compare_exchange_2_028
|
|
.L___atomic_compare_exchange_2_044:
|
|
sraw a6,a6,a4
|
|
slliw a5,a6,0x10
|
|
slliw a3,a3,0x10
|
|
sraiw a5,a5,0x10
|
|
sraiw a3,a3,0x10
|
|
subw a5,a5,a3
|
|
seqz a0,a5
|
|
beqz a5, .L___atomic_compare_exchange_2_064
|
|
sh a6,0(a1)
|
|
.L___atomic_compare_exchange_2_064:
|
|
andi a0,a0,1
|
|
ret
|
|
.size _(__atomic_compare_exchange_2), .-_(__atomic_compare_exchange_2)
|
|
|
|
#endif
|
|
.global _(__atomic_compare_exchange_4)
|
|
.type _(__atomic_compare_exchange_4), %function
|
|
_(__atomic_compare_exchange_4):
|
|
#ifdef __TINYC__
|
|
.short 0x419c
|
|
.int 0x1605272f
|
|
.int 0x00f71563
|
|
.int 0x1ac526af
|
|
.short 0xfaf5
|
|
.int 0x40f707bb
|
|
.int 0x0017b513
|
|
.short 0xc391
|
|
.short 0xc198
|
|
.short 0x8905
|
|
.short 0x8082
|
|
#else
|
|
lw a5,0(a1)
|
|
.L___atomic_compare_exchange_4_002:
|
|
lr.w.aqrl a4,(a0)
|
|
bne a4,a5, .L___atomic_compare_exchange_4_010
|
|
sc.w.rl a3,a2,(a0)
|
|
bnez a3, .L___atomic_compare_exchange_4_002
|
|
.L___atomic_compare_exchange_4_010:
|
|
subw a5,a4,a5
|
|
seqz a0,a5
|
|
beqz a5, .L___atomic_compare_exchange_4_01c
|
|
sw a4,0(a1)
|
|
.L___atomic_compare_exchange_4_01c:
|
|
andi a0,a0,1
|
|
ret
|
|
.size _(__atomic_compare_exchange_4), .-_(__atomic_compare_exchange_4)
|
|
|
|
#endif
|
|
.global _(__atomic_compare_exchange_8)
|
|
.type _(__atomic_compare_exchange_8), %function
|
|
_(__atomic_compare_exchange_8):
|
|
#ifdef __TINYC__
|
|
.short 0x619c
|
|
.int 0x1605372f
|
|
.int 0x00f71563
|
|
.int 0x1ac536af
|
|
.short 0xfaf5
|
|
.int 0x40f707b3
|
|
.int 0x0017b513
|
|
.short 0xc391
|
|
.short 0xe198
|
|
.short 0x8905
|
|
.short 0x8082
|
|
#else
|
|
ld a5,0(a1)
|
|
.L___atomic_compare_exchange_8_002:
|
|
lr.d.aqrl a4,(a0)
|
|
bne a4,a5, .L___atomic_compare_exchange_8_010
|
|
sc.d.rl a3,a2,(a0)
|
|
bnez a3, .L___atomic_compare_exchange_8_002
|
|
.L___atomic_compare_exchange_8_010:
|
|
sub a5,a4,a5
|
|
seqz a0,a5
|
|
beqz a5, .L___atomic_compare_exchange_8_01c
|
|
sd a4,0(a1)
|
|
.L___atomic_compare_exchange_8_01c:
|
|
andi a0,a0,1
|
|
ret
|
|
.size _(__atomic_compare_exchange_8), .-_(__atomic_compare_exchange_8)
|
|
|
|
#endif
|
|
.global _(__atomic_test_and_set_1)
|
|
.type _(__atomic_test_and_set_1), %function
|
|
_(__atomic_test_and_set_1):
|
|
#ifdef __TINYC__
|
|
.int 0x00357793
|
|
.int 0x0037979b
|
|
.short 0x4685
|
|
.short 0x9971
|
|
.int 0x00f696bb
|
|
.int 0x46d5272f
|
|
.int 0x00f7553b
|
|
.int 0x0ff57513
|
|
.short 0x8082
|
|
#else
|
|
andi a5,a0,3
|
|
slliw a5,a5,0x3
|
|
li a3,1
|
|
andi a0,a0,-4
|
|
sllw a3,a3,a5
|
|
amoor.w.aqrl a4,a3,(a0)
|
|
srlw a0,a4,a5
|
|
zext.b a0,a0
|
|
ret
|
|
.size _(__atomic_test_and_set_1), .-_(__atomic_test_and_set_1)
|
|
|
|
#endif
|
|
.global _(__atomic_test_and_set_2)
|
|
.type _(__atomic_test_and_set_2), %function
|
|
_(__atomic_test_and_set_2):
|
|
#ifdef __TINYC__
|
|
.int 0x00357793
|
|
.int 0x0037979b
|
|
.short 0x4685
|
|
.short 0x9971
|
|
.int 0x00f696bb
|
|
.int 0x46d5272f
|
|
.int 0x00f7553b
|
|
.int 0x0ff57513
|
|
.short 0x8082
|
|
#else
|
|
andi a5,a0,3
|
|
slliw a5,a5,0x3
|
|
li a3,1
|
|
andi a0,a0,-4
|
|
sllw a3,a3,a5
|
|
amoor.w.aqrl a4,a3,(a0)
|
|
srlw a0,a4,a5
|
|
zext.b a0,a0
|
|
ret
|
|
.size _(__atomic_test_and_set_2), .-_(__atomic_test_and_set_2)
|
|
|
|
#endif
|
|
.global _(__atomic_test_and_set_4)
|
|
.type _(__atomic_test_and_set_4), %function
|
|
_(__atomic_test_and_set_4):
|
|
#ifdef __TINYC__
|
|
.int 0x00357793
|
|
.int 0x0037979b
|
|
.short 0x4685
|
|
.short 0x9971
|
|
.int 0x00f696bb
|
|
.int 0x46d5272f
|
|
.int 0x00f7553b
|
|
.int 0x0ff57513
|
|
.short 0x8082
|
|
#else
|
|
andi a5,a0,3
|
|
slliw a5,a5,0x3
|
|
li a3,1
|
|
andi a0,a0,-4
|
|
sllw a3,a3,a5
|
|
amoor.w.aqrl a4,a3,(a0)
|
|
srlw a0,a4,a5
|
|
zext.b a0,a0
|
|
ret
|
|
.size _(__atomic_test_and_set_4), .-_(__atomic_test_and_set_4)
|
|
|
|
#endif
|
|
.global _(__atomic_test_and_set_8)
|
|
.type _(__atomic_test_and_set_8), %function
|
|
_(__atomic_test_and_set_8):
|
|
#ifdef __TINYC__
|
|
.int 0x00357793
|
|
.int 0x0037979b
|
|
.short 0x4685
|
|
.short 0x9971
|
|
.int 0x00f696bb
|
|
.int 0x46d5272f
|
|
.int 0x00f7553b
|
|
.int 0x0ff57513
|
|
.short 0x8082
|
|
#else
|
|
andi a5,a0,3
|
|
slliw a5,a5,0x3
|
|
li a3,1
|
|
andi a0,a0,-4
|
|
sllw a3,a3,a5
|
|
amoor.w.aqrl a4,a3,(a0)
|
|
srlw a0,a4,a5
|
|
zext.b a0,a0
|
|
ret
|
|
.size _(__atomic_test_and_set_8), .-_(__atomic_test_and_set_8)
|
|
|
|
#endif
|
|
.global _(atomic_thread_fence)
|
|
.type _(atomic_thread_fence), %function
|
|
_(atomic_thread_fence):
|
|
#ifdef __TINYC__
|
|
.int 0x0330000f
|
|
.short 0x8082
|
|
#else
|
|
fence rw,rw
|
|
ret
|
|
.size _(atomic_thread_fence), .-_(atomic_thread_fence)
|
|
|
|
#endif
|
|
.global _(atomic_signal_fence)
|
|
.type _(atomic_signal_fence), %function
|
|
_(atomic_signal_fence):
|
|
#ifdef __TINYC__
|
|
.short 0x8082
|
|
#else
|
|
ret
|
|
.size _(atomic_signal_fence), .-_(atomic_signal_fence)
|
|
|
|
#endif
|
|
.global _(atomic_flag_test_and_set)
|
|
.type _(atomic_flag_test_and_set), %function
|
|
_(atomic_flag_test_and_set):
|
|
#ifdef __TINYC__
|
|
.int 0x00357793
|
|
.int 0x0037979b
|
|
.short 0x4685
|
|
.short 0x9971
|
|
.int 0x00f696bb
|
|
.int 0x46d5272f
|
|
.int 0x00f7553b
|
|
.int 0x0ff57513
|
|
.short 0x8082
|
|
#else
|
|
andi a5,a0,3
|
|
slliw a5,a5,0x3
|
|
li a3,1
|
|
andi a0,a0,-4
|
|
sllw a3,a3,a5
|
|
amoor.w.aqrl a4,a3,(a0)
|
|
srlw a0,a4,a5
|
|
zext.b a0,a0
|
|
ret
|
|
.size _(atomic_flag_test_and_set), .-_(atomic_flag_test_and_set)
|
|
|
|
#endif
|
|
.global _(atomic_flag_test_and_set_explicit)
|
|
.type _(atomic_flag_test_and_set_explicit), %function
|
|
_(atomic_flag_test_and_set_explicit):
|
|
#ifdef __TINYC__
|
|
.int 0x00357793
|
|
.int 0x0037979b
|
|
.short 0x4685
|
|
.short 0x9971
|
|
.int 0x00f696bb
|
|
.int 0x46d5272f
|
|
.int 0x00f7553b
|
|
.int 0x0ff57513
|
|
.short 0x8082
|
|
#else
|
|
andi a5,a0,3
|
|
slliw a5,a5,0x3
|
|
li a3,1
|
|
andi a0,a0,-4
|
|
sllw a3,a3,a5
|
|
amoor.w.aqrl a4,a3,(a0)
|
|
srlw a0,a4,a5
|
|
zext.b a0,a0
|
|
ret
|
|
.size _(atomic_flag_test_and_set_explicit), .-_(atomic_flag_test_and_set_explicit)
|
|
|
|
#endif
|
|
.global _(atomic_flag_clear)
|
|
.type _(atomic_flag_clear), %function
|
|
_(atomic_flag_clear):
|
|
#ifdef __TINYC__
|
|
.int 0x0330000f
|
|
.int 0x00050023
|
|
.int 0x0330000f
|
|
.short 0x8082
|
|
#else
|
|
fence rw,rw
|
|
sb zero,0(a0)
|
|
fence rw,rw
|
|
ret
|
|
.size _(atomic_flag_clear), .-_(atomic_flag_clear)
|
|
|
|
#endif
|
|
.global _(atomic_flag_clear_explicit)
|
|
.type _(atomic_flag_clear_explicit), %function
|
|
_(atomic_flag_clear_explicit):
|
|
#ifdef __TINYC__
|
|
.int 0x0330000f
|
|
.int 0x00050023
|
|
.int 0x0330000f
|
|
.short 0x8082
|
|
#else
|
|
fence rw,rw
|
|
sb zero,0(a0)
|
|
fence rw,rw
|
|
ret
|
|
.size _(atomic_flag_clear_explicit), .-_(atomic_flag_clear_explicit)
|
|
|
|
#endif
|
|
#endif //__riscv
|