Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/common/lib/libc/arch/arm/atomic



Module Name:    src
Committed By:   skrll
Date:           Wed Jul 28 07:32:20 UTC 2021

Modified Files:
        src/common/lib/libc/arch/arm/atomic: atomic_add_16.S atomic_add_32.S
            atomic_add_64.S atomic_add_8.S atomic_and_16.S atomic_and_32.S
            atomic_and_64.S atomic_and_8.S atomic_cas_16.S atomic_cas_32.S
            atomic_cas_64.S atomic_cas_8.S atomic_dec_32.S atomic_dec_64.S
            atomic_inc_32.S atomic_inc_64.S atomic_nand_16.S atomic_nand_32.S
            atomic_nand_64.S atomic_nand_8.S atomic_op_asm.h atomic_or_16.S
            atomic_or_32.S atomic_or_64.S atomic_or_8.S atomic_sub_64.S
            atomic_swap.S atomic_swap_16.S atomic_swap_64.S atomic_xor_16.S
            atomic_xor_32.S atomic_xor_64.S atomic_xor_8.S membar_ops.S
            sync_bool_compare_and_swap_1.S sync_bool_compare_and_swap_2.S
            sync_bool_compare_and_swap_4.S sync_bool_compare_and_swap_8.S
            sync_fetch_and_add_8.S sync_fetch_and_and_8.S
            sync_fetch_and_nand_8.S sync_fetch_and_or_8.S
            sync_fetch_and_sub_8.S sync_fetch_and_xor_8.S

Log Message:
Remove memory barriers from the atomic_ops(3) atomic operations.  They're
not needed for correctness.

Add the correct memory barriers to the gcc legacy __sync built-in
functions for atomic memory access.  From the gcc documentation:

In most cases, these built-in functions are considered a full barrier.
That is, no memory operand is moved across the operation, either forward
or backward. Further, instructions are issued as necessary to prevent the
processor from speculating loads across the operation and from queuing
stores after the operation.

type __sync_lock_test_and_set (type *ptr, type value, ...)

   This built-in function is not a full barrier, but rather an acquire
   barrier. This means that references after the operation cannot move to
   (or be speculated to) before the operation, but previous memory stores
   may not be globally visible yet, and previous memory loads may not yet
   be satisfied.

void __sync_lock_release (type *ptr, ...)

   This built-in function is not a full barrier, but rather a release
   barrier. This means that all previous memory stores are globally
   visible, and all previous memory loads have been satisfied, but
   following memory reads are not prevented from being speculated to
   before the barrier.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/arm/atomic/atomic_add_16.S \
    src/common/lib/libc/arch/arm/atomic/atomic_add_8.S \
    src/common/lib/libc/arch/arm/atomic/atomic_and_16.S \
    src/common/lib/libc/arch/arm/atomic/atomic_and_8.S \
    src/common/lib/libc/arch/arm/atomic/atomic_nand_16.S \
    src/common/lib/libc/arch/arm/atomic/atomic_nand_32.S \
    src/common/lib/libc/arch/arm/atomic/atomic_nand_8.S \
    src/common/lib/libc/arch/arm/atomic/atomic_or_16.S \
    src/common/lib/libc/arch/arm/atomic/atomic_or_8.S \
    src/common/lib/libc/arch/arm/atomic/atomic_sub_64.S \
    src/common/lib/libc/arch/arm/atomic/atomic_xor_16.S \
    src/common/lib/libc/arch/arm/atomic/atomic_xor_32.S \
    src/common/lib/libc/arch/arm/atomic/atomic_xor_8.S \
    src/common/lib/libc/arch/arm/atomic/sync_bool_compare_and_swap_8.S
cvs rdiff -u -r1.9 -r1.10 src/common/lib/libc/arch/arm/atomic/atomic_add_32.S \
    src/common/lib/libc/arch/arm/atomic/atomic_and_32.S \
    src/common/lib/libc/arch/arm/atomic/atomic_or_32.S
cvs rdiff -u -r1.13 -r1.14 \
    src/common/lib/libc/arch/arm/atomic/atomic_add_64.S \
    src/common/lib/libc/arch/arm/atomic/atomic_or_64.S \
    src/common/lib/libc/arch/arm/atomic/atomic_swap_64.S
cvs rdiff -u -r1.12 -r1.13 \
    src/common/lib/libc/arch/arm/atomic/atomic_and_64.S
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/arm/atomic/atomic_cas_16.S
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/arm/atomic/atomic_cas_32.S
cvs rdiff -u -r1.11 -r1.12 \
    src/common/lib/libc/arch/arm/atomic/atomic_cas_64.S
cvs rdiff -u -r1.8 -r1.9 src/common/lib/libc/arch/arm/atomic/atomic_cas_8.S \
    src/common/lib/libc/arch/arm/atomic/atomic_dec_64.S \
    src/common/lib/libc/arch/arm/atomic/atomic_inc_32.S \
    src/common/lib/libc/arch/arm/atomic/atomic_op_asm.h \
    src/common/lib/libc/arch/arm/atomic/membar_ops.S
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/arch/arm/atomic/atomic_dec_32.S \
    src/common/lib/libc/arch/arm/atomic/atomic_nand_64.S \
    src/common/lib/libc/arch/arm/atomic/atomic_swap_16.S \
    src/common/lib/libc/arch/arm/atomic/atomic_xor_64.S
cvs rdiff -u -r1.10 -r1.11 \
    src/common/lib/libc/arch/arm/atomic/atomic_inc_64.S
cvs rdiff -u -r1.18 -r1.19 src/common/lib/libc/arch/arm/atomic/atomic_swap.S
cvs rdiff -u -r1.3 -r1.4 \
    src/common/lib/libc/arch/arm/atomic/sync_bool_compare_and_swap_1.S \
    src/common/lib/libc/arch/arm/atomic/sync_bool_compare_and_swap_2.S \
    src/common/lib/libc/arch/arm/atomic/sync_bool_compare_and_swap_4.S
cvs rdiff -u -r1.5 -r1.6 \
    src/common/lib/libc/arch/arm/atomic/sync_fetch_and_add_8.S \
    src/common/lib/libc/arch/arm/atomic/sync_fetch_and_and_8.S \
    src/common/lib/libc/arch/arm/atomic/sync_fetch_and_nand_8.S \
    src/common/lib/libc/arch/arm/atomic/sync_fetch_and_or_8.S \
    src/common/lib/libc/arch/arm/atomic/sync_fetch_and_sub_8.S \
    src/common/lib/libc/arch/arm/atomic/sync_fetch_and_xor_8.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index