6 Commits

Author SHA1 Message Date
Peter Lafreniere
614a578034
[M68k] Add support for bitwise NOT instruction (#88049)
Currently the bitwise NOT instruction is not recognized. Add support for
using NOT on data registers. This is a partial implementation that puts
NOT at the same level of support as NEG currently enjoys.

Using not rather than eori cuts the length of the encoded instruction
in half or in thirds, leading to a reduction of 4-10 cycles per
instruction, on the original 68000.

This change includes tests for both bitwise and arithmetic negation.
2024-04-09 09:07:26 -07:00
Fangrui Song
cd0d11be7a [M68k] Convert tests to opaque pointers (NFC) 2024-02-06 12:53:16 -08:00
Jay Foad
0f10850e51 [CodeGen] Add machine verification to some tests
This is to catch errors in an upcoming patch.
2023-07-24 11:04:10 +01:00
Min-Yih Hsu
ed372d194f [M68k] Add support for lowering atomic fence
Ideally we want to lower ATOMIC_FENCE into `__sync_synchronize`.
However, libgcc doesn't implement that builtin as GCC simply generates an
inline assembly barrier whenever there needs to be a fence.

We use a similar way to lower ATOMIC_FENCE.

Differential Revision: https://reviews.llvm.org/D146996
2023-04-01 19:57:04 -07:00
Min-Yih Hsu
a85b37d0ca [M68k] Add support for lowering ATOMIC_SWAP
Lower to calling __sync_lock_test_and_set_* for target < M68020.
2023-03-27 10:58:52 -07:00
Sheng
e086b24d15 [M68k] Add support for atomic instructions
This adds support for atomic_load, atomic_store, atomic_cmpxchg
and atomic_rmw

Fixes #48236

Reviewed by: myhsu, efriedma

Differential Revision: https://reviews.llvm.org/D136525
2022-11-09 18:37:03 +08:00