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

fix division on SPARC #393

Merged
merged 1 commit into from
Nov 23, 2020
Merged

Conversation

AaronKutch
Copy link
Contributor

fixes #390. I decided to make an entire configuration path for all SPARC architectures, because SPARC does not have any widening multiplications which makes _delegate insanely slow. I manually tested the new u128_divide_sparc function, but plan on testing it later with the new test system in PR #384. This PR needs to be merged first because 32-bit SPARC will not build without this. I will rebase #384 afterwards to test u128_divide_sparc properly.

@AaronKutch
Copy link
Contributor Author

Is the CI broken?

Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

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

Thanks! I'm trying to fix CI in #394

src/int/udiv.rs Outdated
#[win64_128bit_abi_hack]
/// Returns `n / d`
pub extern "C" fn __udivti3(n: u128, d: u128) -> u128 {
u128_divide_sparc(n, d, &mut 0)
Copy link
Member

Choose a reason for hiding this comment

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

Could this #[cfg] happen inside the previous intrinsics! block to avoid duplicating the definition?

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 changed it to use #[cfg] inside the previous block, but I don't know if it is beneficial because of all the duplicated #[cfg] that is required to completely disable u128_div_rem

target_arch = "sparc64",
target_arch = "riscv32",
target_arch = "riscv64"
)))]
Copy link
Member

Choose a reason for hiding this comment

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

Instead of conditional definitions of this constant could it use || and cfg!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea

@alexcrichton alexcrichton merged commit c975b0e into rust-lang:master Nov 23, 2020
@alexcrichton
Copy link
Member

👍

AaronKutch added a commit to AaronKutch/compiler-builtins that referenced this pull request Nov 28, 2020
@AaronKutch AaronKutch deleted the sparc-division branch January 5, 2021 02:58
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.

Build failure with LLVM ERROR on sparc-unknown-linux-gnu
2 participants