Skip to content
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

loongarch: Fix ELF header flags #112550

Merged
merged 1 commit into from
Jul 1, 2023
Merged

loongarch: Fix ELF header flags #112550

merged 1 commit into from
Jul 1, 2023

Conversation

heiher
Copy link
Contributor

@heiher heiher commented Jun 12, 2023

This patch changes the ELF header flags so that the ABI matches the floating-point features. It also updates the link to the new official documentation.

@rustbot
Copy link
Collaborator

rustbot commented Jun 12, 2023

r? @fee1-dead

(rustbot has picked a reviewer for you, use r? to override)

@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. labels Jun 12, 2023
@fee1-dead
Copy link
Member

r? compiler

@rustbot rustbot assigned cjgillot and unassigned fee1-dead Jun 12, 2023
@cjgillot
Copy link
Contributor

cc target maintainer @zhaixiaojuan

@heiher
Copy link
Contributor Author

heiher commented Jun 19, 2023

cc target maintainer @zhaixiaojuan

She (@zhaixiaojuan) has been completely preoccupied with other matters and is no longer responsible for Rust.

I invite @xen0n to co-review as he is highly proficient in LoongArch's ABI.

Thanks.

Copy link
Contributor

@xen0n xen0n left a comment

Choose a reason for hiding this comment

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

The change is essentially incorporating similar logic for RISC-V, so given the similarities of the two arches' ABIs they look good.

Regarding the coding style, for now there isn't a need for e_flags to be mutable, because the logic here is simpler in that it only checks the FP ABI. You can simply do this:

{
    let features = &sess.target.options.features;
    let e_flags = if features.contains("+d") {
        elf::EF_LARCH_ABI_DOUBLE_FLOAT
    } else if features.contains("+f") {
        elf::EF_LARCH_ABI_SINGLE_FLOAT
    } else {
        elf::EF_LARCH_ABI_SOFT_FLOAT
    };
    e_flags | elf::EF_LARCH_OBJABI_V1
}

But this is purely personal preference and the current form is okay too.

@heiher
Copy link
Contributor Author

heiher commented Jun 26, 2023

@cjgillot A gentle ping.

@cjgillot cjgillot 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-review Status: Awaiting review from the assignee but also interested parties. labels Jun 30, 2023
@heiher
Copy link
Contributor Author

heiher commented Jul 1, 2023

The change is essentially incorporating similar logic for RISC-V, so given the similarities of the two arches' ABIs they look good.
...
But this is purely personal preference and the current form is okay too.

Regarding this, I want to keep the current form. Thanks.

@heiher
Copy link
Contributor Author

heiher commented Jul 1, 2023

@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 Jul 1, 2023
@cjgillot
Copy link
Contributor

cjgillot commented Jul 1, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Jul 1, 2023

📌 Commit aa8e864 has been approved by cjgillot

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 Jul 1, 2023
@bors
Copy link
Contributor

bors commented Jul 1, 2023

⌛ Testing commit aa8e864 with merge 7905eff...

@bors
Copy link
Contributor

bors commented Jul 1, 2023

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing 7905eff to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 1, 2023
@bors bors merged commit 7905eff into rust-lang:master Jul 1, 2023
@rustbot rustbot added this to the 1.72.0 milestone Jul 1, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7905eff): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.9% [0.4%, 1.6%] 5
Regressions ❌
(secondary)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
-0.5% [-0.5%, -0.5%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.7% [-0.5%, 1.6%] 6

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.3% [3.2%, 3.4%] 2
Improvements ✅
(primary)
-0.5% [-0.6%, -0.4%] 2
Improvements ✅
(secondary)
-12.2% [-13.2%, -11.7%] 6
All ❌✅ (primary) -0.5% [-0.6%, -0.4%] 2

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 661.138s -> 661.475s (0.05%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

7 participants