rust-lang / rust-lang/rust

Some `-Ctarget-feature`s must be restrained on RISCV

Open
#132,618 21 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-ABI A-floating-point C-bug E-needs-investigation O-riscv T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

View all comments

refs:

in discussion of the target modifiers RFC^1, Ralf asks this question:

That's actually fine on most targets, e.g. on x86 if you set the soft-float target feature then you can enable x87 and SSE and whatnot and keep using the soft-float ABI. Only aarch64 https://github.com/llvm/llvm-project/issues/110632 (from the targets I checked so far).

The interesting question is what happens on RISC-V when I disable the FP instructions on a target that usually uses the hardfloat ABI. Sadly, what LLVM usually does in that case is silently fall back to the softfloat ABI. But I haven't checked for RISC-V.

cc @beetrees

Contributor guide

Open the contributing guide

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 with RFC 3716 and the linked Rust issues and pull requests, especially the discussion of RISC-V floating-point features and ABI behavior. Determine which -Ctarget-feature combinations require restriction and what compiler behavior should be accepted; the issue is done when that behavior is resolved and verified.

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
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.