Skip to content

Place __muloti4 in a separate object file #348

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ jobs:
rust: nightly
- target: i686-pc-windows-gnu
os: windows-latest
rust: nightly-i686-gnu
# FIXME: Use nigthly when https://github.com/rust-lang/rust/issues/70316 is resolved.
rust: nightly-2020-03-14-i686-gnu
- target: x86_64-pc-windows-gnu
os: windows-latest
rust: nightly-x86_64-gnu
Expand All @@ -106,7 +107,7 @@ jobs:
with:
submodules: true
- name: Install Rust (rustup)
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
run: rustup update ${{ matrix.rust }} --no-self-update --force && rustup default ${{ matrix.rust }}
shell: bash
- run: rustup target add ${{ matrix.target }}
- name: Download compiler-rt reference sources
Expand Down
7 changes: 4 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ mod c {
let target_env = env::var("CARGO_CFG_TARGET_ENV").unwrap();
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
let target_vendor = env::var("CARGO_CFG_TARGET_VENDOR").unwrap();
let target_pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap();
let mut consider_float_intrinsics = true;
let cfg = &mut cc::Build::new();

Expand Down Expand Up @@ -222,16 +223,16 @@ mod c {
sources.extend(&[("__ffsdi2", "ffsdi2.c")]);
}

// On iOS and 32-bit OSX these are all just empty intrinsics, no need to
// include them.
if target_os != "ios" && (target_vendor != "apple" || target_arch != "x86") {
// On targets without __int128 these are all just empty.
if target_pointer_width == "64" && target_env != "msvc" {
sources.extend(&[
("__absvti2", "absvti2.c"),
("__addvti3", "addvti3.c"),
("__clzti2", "clzti2.c"),
("__cmpti2", "cmpti2.c"),
("__ctzti2", "ctzti2.c"),
("__ffsti2", "ffsti2.c"),
("__muloti4", "muloti4.c"),
("__mulvti3", "mulvti3.c"),
("__negti2", "negti2.c"),
("__parityti2", "parityti2.c"),
Expand Down
1 change: 1 addition & 0 deletions src/int/mul.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ intrinsics! {
a.mulo(b, oflow)
}

#[maybe_use_optimized_c_shim]
#[unadjusted_on_win64]
pub extern "C" fn __muloti4(a: i128, b: i128, oflow: &mut i32) -> i128 {
a.mulo(b, oflow)
Expand Down