Skip to content

Implement atomic operations for M68k #48236

Closed
@glaubitz

Description

@glaubitz
Bugzilla Link 48892
Version trunk
OS Linux
Blocks #48135
CC @glaubitz,@mshockwave

Extended Description

The M68k is not implementing any atomic operations yet which include load and store operations and compare_and_swap.

Load operations:

  • atomic_load_8 - using MOV8rm
  • atomic_load_16 - using MOV16rm
  • atomic_load_32 - using MOV32rm

Store operations:

  • atomic_store_8 - using MOV8mr
  • atomic_store_16 - using MOV16mr
  • atomic_store_32 - using MOV32mr

Compare-and-swap:

  • atomic_cmp_swap_32 - using CAS
  • atomic_cmp_swap_64 - using CAS2

Without support for atomic operations, compiling some C++ code currently fails with:

glaubitz@epyc:..openscad-2019.05/src> /local_scratch/glaubitz/M680x0-mono-repo/build/bin/clang -target m68k-linux-gnu localscope.cc -o localscope.o -I /usr/m68k-linux-gnu/include/c++/10/m68k-linux-gnu/ -I /usr/m68k-linux-gnu/include/ -I /usr/include/glib-2.0 -I /usr/lib/m68k-linux-gnu/glib-2.0/include/
fatal error: error in backend: Cannot select: 0x55f0fc5b1ea8: i8,ch = AtomicLoad<(dereferenceable load acquire 1 from `i8* bitcast (i64* @&#8203;_ZGVZN5boost6system6detail15to_std_categoryERKNS0_14error_categoryEE4map_ to i8*)`, align 4)> 0x55f0fc31e988, 0x55f0fc5ae8c8
  0x55f0fc5ae8c8: i32 = M680x0ISD::WrapperPC TargetGlobalAddress:i32<i64* @&#8203;_ZGVZN5boost6system6detail15to_std_categoryERKNS0_14error_categoryEE4map_> 0
    0x55f0fc5aec70: i32 = TargetGlobalAddress<i64* @&#8203;_ZGVZN5boost6system6detail15to_std_categoryERKNS0_14error_categoryEE4map_> 0
In function: _ZN5boost6system6detail15to_std_categoryERKNS0_14error_categoryE
clang-12: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 12.0.0 ([email protected]:M680x0/M680x0-mono-repo.git c5834ffbda019df8c94c669c658d804cb9c19af3)
Target: m68k-unknown-linux-gnu
Thread model: posix
InstalledDir: /local_scratch/glaubitz/M680x0-mono-repo/build/bin
clang-12: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-12: note: diagnostic msg: /tmp/localscope-405c82.cpp
clang-12: note: diagnostic msg: /tmp/localscope-405c82.sh
clang-12: note: diagnostic msg: 

********************
glaubitz@epyc:..openscad-2019.05/src>

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions