Skip to content

Partially stabilize LoongArch target features #135015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

heiher
Copy link
Contributor

@heiher heiher commented Jan 2, 2025

Stabilization PR for the LoongArch target features. This PR stabilizes some of the target features tracked by #44839.

Specifically, this PR stabilizes the following target features:

  • f
  • d
  • frecipe
  • lasx
  • lbt
  • lsx
  • lvz

Docs PR: rust-lang/reference#1707

r? @Amanieu

@rustbot rustbot added 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 2, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 2, 2025

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

cc @rust-lang/rust-analyzer

@heiher heiher force-pushed the stabilize-loongarch-target-features branch from cb6584c to 29c94f5 Compare January 2, 2025 07:35
@jieyouxu jieyouxu added the O-loongarch Target: LoongArch (LA32R, LA32S, LA64) label Jan 2, 2025
@rust-log-analyzer

This comment has been minimized.

@RalfJung
Copy link
Member

RalfJung commented Jan 2, 2025

If "d" and "f" work anything like the RISC-V features of the same name, they should not be stabilized yet. We need to figure out #116344 and #131799 for LoongArch first.

Does any of the other features ever have any effect on calling conventions or ABI?

@jieyouxu jieyouxu added the A-target-feature Area: Enabling/disabling target features like AVX, Neon, etc. label Jan 2, 2025
@heiher
Copy link
Contributor Author

heiher commented Jan 2, 2025

If "d" and "f" work anything like the RISC-V features of the same name, they should not be stabilized yet. We need to figure out #116344 and #131799 for LoongArch first.

Does any of the other features ever have any effect on calling conventions or ABI?

Thank you! Other than f and d, there are no other target features affecting the calling convention and ABI.

@heiher heiher changed the title Stabilize LoongArch target features Partially stabilize LoongArch target features Jan 2, 2025
@heiher heiher force-pushed the stabilize-loongarch-target-features branch from 29c94f5 to 4c59f0d Compare January 2, 2025 14:16
@ehuss
Copy link
Contributor

ehuss commented Jan 2, 2025

This will need a PR for documentation at https://github.com/rust-lang/reference/blob/master/src/attributes/codegen.md, and a lang (+whoever?) FCP.

Comment on lines 773 to 774
("relax", STABLE, &[]),
("ual", STABLE, &[]),
Copy link
Member

Choose a reason for hiding this comment

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

  • relax refers to linker relaxation support and may not be appropriate to expose as a target feature.
  • ual refers to support for unaligned memory access, similar to strict-align on ARM targets. It's probably fine to stabilize as-is, but we may want to double-check with other targets if we want to have a consistent feature name between all of them (alternatively it's also fine to make the feature target-specific).

Copy link
Member

Choose a reason for hiding this comment

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

Also to be clear, ual can only affect how unaligned accesses are codegen'd, and nothing else. See this recent discussion on Zulip.

If we have target feature docs somewhere, they should clarify hat unaligned accesses are still UB except when performed via {read,write}_unaligned.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with skipping these two target features and stabilizing them at a more appropriate time.

@Amanieu
Copy link
Member

Amanieu commented Jan 2, 2025

r? lang

@rustbot rustbot added the T-lang Relevant to the language team, which will review and decide on the PR/issue. label Jan 2, 2025
@rustbot rustbot assigned joshtriplett and unassigned Amanieu Jan 2, 2025
@heiher
Copy link
Contributor Author

heiher commented Jan 3, 2025

This will need a PR for documentation at https://github.com/rust-lang/reference/blob/master/src/attributes/codegen.md, and a lang (+whoever?) FCP.

PR: rust-lang/reference#1707

@heiher heiher force-pushed the stabilize-loongarch-target-features branch from 4c59f0d to 71e17a0 Compare January 3, 2025 07:10
@bors
Copy link
Collaborator

bors commented Jan 6, 2025

☔ The latest upstream changes (presumably #134794) made this pull request unmergeable. Please resolve the merge conflicts.

@heiher heiher force-pushed the stabilize-loongarch-target-features branch from 71e17a0 to 49b6947 Compare January 6, 2025 06:56
@traviscross traviscross added the I-lang-nominated Nominated for discussion during a lang team meeting. label Jan 7, 2025
@bors
Copy link
Collaborator

bors commented Mar 15, 2025

☔ The latest upstream changes (presumably #138523) made this pull request unmergeable. Please resolve the merge conflicts.

@heiher heiher force-pushed the stabilize-loongarch-target-features branch from 49b6947 to f4c604d Compare March 18, 2025 09:48
@heiher heiher requested a review from Amanieu March 18, 2025 11:07
@heiher heiher force-pushed the stabilize-loongarch-target-features branch from f4c604d to 7cbc101 Compare March 19, 2025 07:20
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 3, 2025
Rollup merge of rust-lang#140395 - RalfJung:target-feature-tests, r=petrochenkov

organize and extend forbidden target feature tests

In particular this adds some loongarch tests for rust-lang#135015, Cc `@heiher`

Seems like the tests change so much git does not detect the renames; a commit-by-commit review should help.

try-job: `x86_64-gnu-llvm-20-*`
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels May 8, 2025
@rfcbot
Copy link
Collaborator

rfcbot commented May 8, 2025

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@Amanieu
Copy link
Member

Amanieu commented May 8, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented May 8, 2025

📌 Commit 1f2536f has been approved by Amanieu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 8, 2025
jhpratt added a commit to jhpratt/rust that referenced this pull request May 9, 2025
…features, r=Amanieu

Partially stabilize LoongArch target features

Stabilization PR for the LoongArch target features. This PR stabilizes some of the target features tracked by rust-lang#44839.

Specifically, this PR stabilizes the following target features:

* f
* d
* frecipe
* lasx
* lbt
* lsx
* lvz

Docs PR: rust-lang/reference#1707

r? `@Amanieu`
@jhpratt
Copy link
Member

jhpratt commented May 9, 2025

@bors r-

#140835 (comment)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 9, 2025
@heiher heiher force-pushed the stabilize-loongarch-target-features branch from 1f2536f to 4a662c2 Compare May 9, 2025 03:26
@heiher
Copy link
Contributor Author

heiher commented May 9, 2025

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 9, 2025
@tgross35
Copy link
Contributor

tgross35 commented May 9, 2025

@bors r=Amanieu

@bors
Copy link
Collaborator

bors commented May 9, 2025

📌 Commit 4a662c2 has been approved by Amanieu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 9, 2025
@bors
Copy link
Collaborator

bors commented May 9, 2025

⌛ Testing commit 4a662c2 with merge 5437b87...

bors added a commit to rust-lang-ci/rust that referenced this pull request May 9, 2025
…atures, r=Amanieu

Partially stabilize LoongArch target features

Stabilization PR for the LoongArch target features. This PR stabilizes some of the target features tracked by rust-lang#44839.

Specifically, this PR stabilizes the following target features:

* f
* d
* frecipe
* lasx
* lbt
* lsx
* lvz

Docs PR: rust-lang/reference#1707

r? `@Amanieu`
@pietroalbini
Copy link
Member

@bors retry
Yield priority to the stable release.

Zalathar added a commit to Zalathar/rust that referenced this pull request May 10, 2025
…features, r=Amanieu

Partially stabilize LoongArch target features

Stabilization PR for the LoongArch target features. This PR stabilizes some of the target features tracked by rust-lang#44839.

Specifically, this PR stabilizes the following target features:

* f
* d
* frecipe
* lasx
* lbt
* lsx
* lvz

Docs PR: rust-lang/reference#1707

r? `@Amanieu`
bors added a commit to rust-lang-ci/rust that referenced this pull request May 10, 2025
Rollup of 10 pull requests

Successful merges:

 - rust-lang#129334 (Implement (part of) ACP 429: add `DerefMut` to `Lazy[Cell/Lock]`)
 - rust-lang#135015 (Partially stabilize LoongArch target features)
 - rust-lang#138736 (Sanitizers target modificators)
 - rust-lang#139562 (rustdoc: add a handle that makes sidebar resizing more obvious)
 - rust-lang#140151 (remove intrinsics::drop_in_place)
 - rust-lang#140660 (remove 'unordered' atomic intrinsics)
 - rust-lang#140783 (Update documentation of OnceLock::get_or_init.)
 - rust-lang#140789 (Update hermit-abi to 0.5.1)
 - rust-lang#140792 (Use intrinsics for `{f16,f32,f64,f128}::{minimum,maximum}` operations)
 - rust-lang#140862 (Enable non-leaf Frame Pointers for Arm64EC Windows)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-target-feature Area: Enabling/disabling target features like AVX, Neon, etc. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. I-lang-radar Items that are on lang's radar and will need eventual work or consideration. O-loongarch Target: LoongArch (LA32R, LA32S, LA64) relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-lang Relevant to the language team, which will review and decide on the PR/issue. to-announce Announce this issue on triage meeting
Projects
None yet
Development

Successfully merging this pull request may close these issues.