Skip to content

std: Combine is_mips64_feature_detected into is_mips_feature_detected and enable on MIPS release 6 - #165007

Open
tgross35 wants to merge 2 commits into
rust-lang:mainfrom
tgross35:mips-feature
Open

tgross35 wants to merge 2 commits into
rust-lang:mainfrom
tgross35:mips-feature

Conversation

@tgross35

@tgross35 tgross35 commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

All other architecture families currently use a single macro for both
32- and 64-bit versions. Do the same for MIPS.

Tracking issue: #111188

r? libs

We have four MIPS-like arches, not just the two.
…ted`

All other architecture families currently use a single macro for both
32- and 64-bit versions. Do the same for MIPS.
@rustbot

rustbot commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

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

cc @Amanieu, @folkertdev, @sayantn

Some changes occurred in std_detect

cc @Amanieu, @folkertdev, @sayantn

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 26, 2026
@tgross35

Copy link
Copy Markdown
Member Author

Mips maintainers @Gelbpunkt @LukasWoodtli @chenx97 @709924470 @Cyanoxygen @Fearyncess could you confirm that this makes sense? The macro currently isn't very useful, but as long as most of the features are the same across the four arch variants then we may as well do the same thing as other arches.

@Gelbpunkt

Gelbpunkt commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

I believe this makes sense, yes. Most target features that may be listed here in the future should apply to both 32-bit and 64-bit MIPS. I believe r6 would make almost all optional features (like MSA) obsolete since they're implied, but I don't think that is worth splitting up (edit: and I guess softfloat targets may be a thing in the future).

@chenx97 chenx97 left a comment •

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.

Looks like this target_arch comes from target triples, so the full list should be

echo mips{,64}{,el} mipsisa{32,64}r6{,el}

View changes since this review

"loongarch32" | "loongarch64" => "is_loongarch_feature_detected",
"s390x" => "is_s390x_feature_detected",
"mips64" | "mips64el" => "is_mips64_feature_detected",
"mips" | "mips32r6" | "mips64" | "mips64el" => "is_mips_feature_detected",

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.

Get ready for some target triple madness

mips mipsel mips64 mips64el mipsisa32r6 mipsisa32r6el mipsisa64r6 mipsisa64r6el

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

rust-lang/stdarch#2261 should make this less crazy

This branch has not been deployed

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

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library 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