Skip to content

Add floating point inline ASM support for SPARC - #160949

Open
beetrees wants to merge 1 commit into
rust-lang:mainfrom
beetrees:f128-inline-asm-sparc
Open

Add floating point inline ASM support for SPARC#160949
beetrees wants to merge 1 commit into
rust-lang:mainfrom
beetrees:f128-inline-asm-sparc

Conversation

@beetrees

@beetrees beetrees commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

This PR adds support for floating point registers to SPARC inline ASM.

Ping target maintainers: @psumbera @kulikjak @jonathanpallant @mvolfik @he32 @0323pin @semarie

Tracking issues:
f16 inline ASM: #125398 (part of #116909)
SPARC inline ASM: #93335

@rustbot

rustbot commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

rustc_codegen_gcc is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_gcc instead.

cc @antoyo, @GuillaumeGomez

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 11, 2026
@rustbot

rustbot commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

r? @petrochenkov

rustbot has assigned @petrochenkov.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 19 candidates

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

---- [assembly] tests/assembly-llvm/asm/sparc-types.rs#sparc stdout ----
------rustc stdout------------------------------

------rustc stderr------------------------------
rustc-LLVM ERROR: SPARCv8 does not handle f128 in calls; pass indirectly

------------------------------------------

error in revision `sparc`: compilation failed!
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/assembly-llvm/asm/sparc-types.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--cfg" "sparc" "--check-cfg" "cfg(test,FALSE,sparc,sparcv8plus,sparc64)" "-O" "-Cdebug-assertions=no" "-Zcodegen-source-order" "--emit" "asm" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/assembly-llvm/asm/sparc-types.sparc/sparc-types.s" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Cpanic=abort" "-Cforce-unwind-tables=yes" "--target" "sparc-unknown-none-elf" "-Zmerge-functions=disabled" "--check-cfg=cfg(v9)" "--extern" "minicore=/checkout/obj/build/aarch64-unknown-linux-gnu/test/assembly-llvm/asm/sparc-types.sparc/libminicore.rlib"
stdout: none
--- stderr -------------------------------
rustc-LLVM ERROR: SPARCv8 does not handle f128 in calls; pass indirectly
------------------------------------------

---- [assembly] tests/assembly-llvm/asm/sparc-types.rs#sparc stdout end ----
---- [assembly] tests/assembly-llvm/asm/sparc-types.rs#sparcv8plus stdout ----
------rustc stdout------------------------------

------rustc stderr------------------------------
rustc-LLVM ERROR: SPARCv8 does not handle f128 in calls; pass indirectly

------------------------------------------

error in revision `sparcv8plus`: compilation failed!
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/assembly-llvm/asm/sparc-types.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--cfg" "sparcv8plus" "--check-cfg" "cfg(test,FALSE,sparc,sparcv8plus,sparc64)" "-O" "-Cdebug-assertions=no" "-Zcodegen-source-order" "--emit" "asm" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/assembly-llvm/asm/sparc-types.sparcv8plus/sparc-types.s" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Cpanic=abort" "-Cforce-unwind-tables=yes" "--target" "sparc-unknown-linux-gnu" "--cfg" "v9" "-Zmerge-functions=disabled" "--check-cfg=cfg(v9)" "--extern" "minicore=/checkout/obj/build/aarch64-unknown-linux-gnu/test/assembly-llvm/asm/sparc-types.sparcv8plus/libminicore.rlib"
stdout: none
--- stderr -------------------------------
rustc-LLVM ERROR: SPARCv8 does not handle f128 in calls; pass indirectly
------------------------------------------

---- [assembly] tests/assembly-llvm/asm/sparc-types.rs#sparcv8plus stdout end ----

failures:

@folkertdev

Copy link
Copy Markdown
Contributor

Sparc handles f128 starting from LLVM 22. We'll drop LLVM 21 support soon, so it's fine to restrict that test to LLVM 22 and higher with //@ min-llvm-version: 22.

// v9: !APP
// v9-NEXT: fmovd %f62, %f62
// v9-NEXT: !NO_APP
#[cfg(v9)]

@folkertdev folkertdev Aug 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably good to add tests/ui/asm/sparc/bad-reg.rs to check that this errors correctly.

View changes since the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants