lowRISC / lowRISC/riscv-llvm

state of atomic support

Open
#56 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
277
Forks
55
PR merge metrics
No merged PRs in 30d

Description

There are some patches for atomic support in the backend, but there are still some parts missing to build a rust memory allocator or rust's libstd.

```sh
LLVM ERROR: Cannot select: t32: i32,ch = AtomicCmpSwap t12, t4, t39, t26
t4: i32,ch = load t0, FrameIndex:i32<9>, undef:i32
t1: i32 = FrameIndex<9>
t3: i32 = undef
t39: i32,ch = load t0, FrameIndex:i32<8>, undef:i32
t5: i32 = FrameIndex<8>
t3: i32 = undef
t26: i32,ch = load t0, FrameIndex:i32<7>, undef:i32
t7: i32 = FrameIndex<7>
t3: i32 = undef
In function: _ZN4core4sync6atomic23atomic_compare_exchange17h1807facac1d33089E
```

```sh
LLVM ERROR: Cannot select: t22: i32,ch = AtomicCmpSwap t11, t8, Constant:i32<2>, Constant:i32<0>
t8: i32 = add nuw t2, Constant:i32<24>
t2: i32,ch = CopyFromReg t0, Register:i32 %0
t1: i32 = Register %0
t7: i32 = Constant<24>
t12: i32 = Constant<2>
t4: i32 = Constant<0>
In function: _ZN3std6thread4park17h5b16deb9482d0a5bE
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two reported LLVM ERROR cases involving AtomicCmpSwap, including the failures in Rust's atomic_compare_exchange and std::thread::park. Trace the missing atomic backend support exposed by those cases; done means these operations compile without the reported instruction-selection errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.