Skip to content

Make issue-122805.rs big endian compatible - #126263

Merged
bors merged 1 commit into
rust-lang:masterfrom
nikic:s390x-codegen-test-fix
Jun 12, 2024
Merged

Make issue-122805.rs big endian compatible#126263
bors merged 1 commit into
rust-lang:masterfrom
nikic:s390x-codegen-test-fix

Conversation

@nikic

@nikicnikic commented Jun 11, 2024

Copy link
Copy Markdown
Contributor

Instead of not generating the function at all on big endian (which makes the CHECK lines fail), instead use to_le() on big endian, so that we essentially perform a bswap for both endiannesses.

@rustbot

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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

@rustbotrustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 11, 2024
@nikicnikic changed the title Ingore issue-122805.rs on big endianIgnore issue-122805.rs on big endianJun 11, 2024
@nikic
nikicforce-pushed the s390x-codegen-test-fix branch from f2d4afd to 562f184CompareJune 11, 2024 08:17
// OPT3WINX64-NEXT: store <8 x i16>
// CHECK-NEXT: ret void
#[no_mangle]
#[cfg(target_endian = "little")]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The code in this file is just checking we emit bswap, can't we instead make this something like

#[cfg(target_endian = "little")]let bswap = u16::to_be;#[cfg(target_endian = "big")]let bswap = u16::to_le;let addr16 = [bswap(value[0]),// etc.e];

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Nice idea, done!

Instead of not generating the function at all on big endian (which
makes the CHECK lines fail), instead use to_le() on big endian,
so that we essentially perform a bswap for both endiannesses.
@nikic
nikicforce-pushed the s390x-codegen-test-fix branch from 562f184 to 26fa5c2CompareJune 11, 2024 14:08
@nikicnikic changed the title Ignore issue-122805.rs on big endianMake issue-122805.rs big endian compatibleJun 11, 2024
@jieyouxu

Copy link
Copy Markdown
Member

Thanks! @bors r+ rollup

@bors

bors commented Jun 11, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit 26fa5c2 has been approved by jieyouxu

It is now in the queue for this repository.

@borsbors 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 Jun 11, 2024
@jieyouxu

Copy link
Copy Markdown
Member

r? @jieyouxu

jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 12, 2024
…eyouxu
Make issue-122805.rs big endian compatible
Instead of not generating the function at all on big endian (which makes the CHECK lines fail), instead use to_le() on big endian, so that we essentially perform a bswap for both endiannesses.
@jhprattjhpratt mentioned this pull request Jun 12, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 12, 2024
Rollup of 6 pull requests
Successful merges:
- rust-lang#123374 (DOC: Add FFI example for slice::from_raw_parts())
- rust-lang#126127 (Spell out other trait diagnostic)
- rust-lang#126228 (Provide correct parent for nested anon const)
- rust-lang#126249 (Simplify `[T; N]::try_map` signature)
- rust-lang#126256 (Add {{target}} substitution to compiletest)
- rust-lang#126263 (Make issue-122805.rs big endian compatible)
r? `@ghost`
`@rustbot` modify labels: rollup
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jun 12, 2024
…eyouxu
Make issue-122805.rs big endian compatible
Instead of not generating the function at all on big endian (which makes the CHECK lines fail), instead use to_le() on big endian, so that we essentially perform a bswap for both endiannesses.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 12, 2024
…kingjubilee
Rollup of 8 pull requests
Successful merges:
- rust-lang#123374 (DOC: Add FFI example for slice::from_raw_parts())
- rust-lang#126210 (docs(core): make more const_ptr doctests assert instead of printing)
- rust-lang#126228 (Provide correct parent for nested anon const)
- rust-lang#126242 (Simplify provider api to improve llvm ir)
- rust-lang#126249 (Simplify `[T; N]::try_map` signature)
- rust-lang#126256 (Add {{target}} substitution to compiletest)
- rust-lang#126263 (Make issue-122805.rs big endian compatible)
- rust-lang#126286 (Make `storage-live.rs` robust against rustc internal changes.)
r? `@ghost`
`@rustbot` modify labels: rollup
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jun 12, 2024
…eyouxu
Make issue-122805.rs big endian compatible
Instead of not generating the function at all on big endian (which makes the CHECK lines fail), instead use to_le() on big endian, so that we essentially perform a bswap for both endiannesses.
This was referenced Jun 12, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 12, 2024
…kingjubilee
Rollup of 16 pull requests
Successful merges:
- rust-lang#123374 (DOC: Add FFI example for slice::from_raw_parts())
- rust-lang#124514 (Recommend to never display zero disambiguators when demangling v0 symbols)
- rust-lang#125978 (Cleanup: HIR ty lowering: Consolidate the places that do assoc item probing & access checking)
- rust-lang#125980 (Nvptx remove direct passmode)
- rust-lang#126187 (For E0277 suggest adding `Result` return type for function when using QuestionMark `?` in the body.)
- rust-lang#126210 (docs(core): make more const_ptr doctests assert instead of printing)
- rust-lang#126249 (Simplify `[T; N]::try_map` signature)
- rust-lang#126256 (Add {{target}} substitution to compiletest)
- rust-lang#126263 (Make issue-122805.rs big endian compatible)
- rust-lang#126281 (set_env: State the conclusion upfront)
- rust-lang#126286 (Make `storage-live.rs` robust against rustc internal changes.)
- rust-lang#126287 (Update a cranelift patch file for formatting changes.)
- rust-lang#126301 (Use `tidy` to sort crate attributes for all compiler crates.)
- rust-lang#126305 (Make PathBuf less Ok with adding UTF-16 then `into_string`)
- rust-lang#126310 (Migrate run make prefer rlib)
- rust-lang#126314 (fix RELEASES: we do not support upcasting to auto traits)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 0ed474a into rust-lang:masterJun 12, 2024
@rustbotrustbot added this to the 1.81.0 milestone Jun 12, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 12, 2024
Rollup merge of rust-lang#126263 - nikic:s390x-codegen-test-fix, r=jieyouxu
Make issue-122805.rs big endian compatible
Instead of not generating the function at all on big endian (which makes the CHECK lines fail), instead use to_le() on big endian, so that we essentially perform a bswap for both endiannesses.
bjorn3 pushed a commit to bjorn3/rust that referenced this pull request Jun 30, 2024
…kingjubilee
Rollup of 16 pull requests
Successful merges:
- rust-lang#123374 (DOC: Add FFI example for slice::from_raw_parts())
- rust-lang#124514 (Recommend to never display zero disambiguators when demangling v0 symbols)
- rust-lang#125978 (Cleanup: HIR ty lowering: Consolidate the places that do assoc item probing & access checking)
- rust-lang#125980 (Nvptx remove direct passmode)
- rust-lang#126187 (For E0277 suggest adding `Result` return type for function when using QuestionMark `?` in the body.)
- rust-lang#126210 (docs(core): make more const_ptr doctests assert instead of printing)
- rust-lang#126249 (Simplify `[T; N]::try_map` signature)
- rust-lang#126256 (Add {{target}} substitution to compiletest)
- rust-lang#126263 (Make issue-122805.rs big endian compatible)
- rust-lang#126281 (set_env: State the conclusion upfront)
- rust-lang#126286 (Make `storage-live.rs` robust against rustc internal changes.)
- rust-lang#126287 (Update a cranelift patch file for formatting changes.)
- rust-lang#126301 (Use `tidy` to sort crate attributes for all compiler crates.)
- rust-lang#126305 (Make PathBuf less Ok with adding UTF-16 then `into_string`)
- rust-lang#126310 (Migrate run make prefer rlib)
- rust-lang#126314 (fix RELEASES: we do not support upcasting to auto traits)
r? `@ghost`
`@rustbot` modify labels: rollup
milkice233 pushed a commit to fedora-riscv/rust that referenced this pull request Feb 15, 2025
python3-rpm is added (temporarily) to work around
https://bugzilla.redhat.com/show_bug.cgi?id=2275274.
The binutils-gold dependency is needed for one test. Previously
binutils implicitly dependend on binutils-gold.
Backport rust-lang/rust#126263 to fix
one codegen test failure on s390x.
There are some additional test failures on ppc64le and s390x for
which I have filed rust-lang/rust#126260
and rust-lang/rust#126261.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@nikic@rustbot@jieyouxu@bors@workingjubilee@Mark-Simulacrum