Skip to content

Fix MIPS tests#2079

Merged
folkertdev merged 1 commit intorust-lang:mainfrom
eduardosm:mips-tests
Apr 15, 2026
Merged

Fix MIPS tests#2079
folkertdev merged 1 commit intorust-lang:mainfrom
eduardosm:mips-tests

Conversation

@eduardosm
Copy link
Copy Markdown
Contributor

Tests failed to build due to use of legacy const generics syntax, out-of-bounds immediates and incorrect name of const generics in assert_instr

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 11, 2026

r? @sayantn

rustbot has assigned @sayantn.
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: @Amanieu, @folkertdev, @sayantn
  • @Amanieu, @folkertdev, @sayantn expanded to Amanieu, folkertdev, sayantn
  • Random selection from Amanieu, folkertdev, sayantn

@eduardosm eduardosm force-pushed the mips-tests branch 2 times, most recently from 1cb89c2 to d9ca05f Compare April 11, 2026 15:25
);

assert_eq!(r, mem::transmute(__msa_addvi_b(mem::transmute(a), 67)));
assert_eq!(r, mem::transmute(__msa_addvi_b::<3>(mem::transmute(a))));
Copy link
Copy Markdown
Contributor

@folkertdev folkertdev Apr 14, 2026

Choose a reason for hiding this comment

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

View changes since the review

what's happening here?

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.

ah 3 == 67 % 64, and this function uses static_assert_uimm_bits!(IMM5, 5);

@sayantn
Copy link
Copy Markdown
Contributor

sayantn commented Apr 14, 2026

For some reason I can't run the mips tests, ci/run-docker.sh mips64-unknown-linux-gnuabi64 runs into a few errors. E.g. the static_assert_simm_bits assertions all fail (even with this patch, and the failures don't make any sense, e.g it says 5 is not between -17 and 16)

@folkertdev
Copy link
Copy Markdown
Contributor

I think some of the assert logic might be buggy (across targets)?

https://godbolt.org/z/qP74MWvK1

in any case the bit_width version expresses what we mean more accurately.

@folkertdev
Copy link
Copy Markdown
Contributor

Ah, it's signed and that is weird because you need a bit for the sign. Definitely a poor error message in any case.

@eduardosm
Copy link
Copy Markdown
Contributor Author

I had checked assert_instr tests with cargo check --release, which does not check the static asserts. Then I ran tests with cargo test (debug mode), which does not compile assert_instr at all, so I missed those failures.

Many assert_instr are failing anyways, and I will not be fixing them for now.

Tests failed to build due to use of legacy const generics syntax, out-of-bounds immediates and incorrect name of const generics in `assert_instr`
@eduardosm
Copy link
Copy Markdown
Contributor Author

Windows job failing, unrelated I believe

  = note: C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\a\stdarch\stdarch\target\x86_64-pc-windows-gnu\debug\deps\stdarch_gen_arm-c2d4a4c482dd3e81.9ul22rteqt6x41b1oy83npkbi.1831grd.rcgu.o:9ul22rteqt6x41b1oy83npkbi:(.debug_gdb_scripts+0x0): multiple definition of `.weak.__rustc_debug_gdb_scripts_section__.default'; D:\a\stdarch\stdarch\target\x86_64-pc-windows-gnu\debug\deps\stdarch_gen_arm-c2d4a4c482dd3e81.1nzalzaaigcyndp95lkud74oo.1831grd.rcgu.o:1nzalzaaigcyndp95lkud74oo:(.debug_gdb_scripts+0x0): first defined here

@folkertdev
Copy link
Copy Markdown
Contributor

yes it's unrelated rust-lang/rust#155277

@folkertdev
Copy link
Copy Markdown
Contributor

Many assert_instr are failing anyways, and I will not be fixing them for now.

Fair enough. Did anything in particular cause you to look at this?

(the changes look fine to me, so I think we should just merge this when CI works again with the next nightly)

@eduardosm
Copy link
Copy Markdown
Contributor Author

eduardosm commented Apr 14, 2026

Did anything in particular cause you to look at this?

I was going to continue reducing the use of unsafe fn in simd_test functions (#1981, #1987, #1989, #2006), but I rather have tests compiling before making more changes.

@folkertdev folkertdev added this pull request to the merge queue Apr 15, 2026
@folkertdev
Copy link
Copy Markdown
Contributor

We removed the CI jobs for these targets, but probably should just still have them but make them not blocking for PRs? Then at least we know when they are broken and can occasionally fix them.

Merged via the queue into rust-lang:main with commit cf05573 Apr 15, 2026
138 of 152 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants