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

i128 and u128 support #37900

Closed
wants to merge 36 commits into
base: master
from

Conversation

@est31
Contributor

est31 commented Nov 20, 2016

Adds support for 128-bit integers. Rebased version of #35954 , with additional improvements.

Thanks @nagisa for mentoring this PR!

Some of the problems that were resolved:

  • Confirm that intrinsics work on 32 bit platforms and fix them if needed

  • Wait for #37906 to get fixed, so that work on intrinsics can be completed (worked around by merging the PR on my local setup)

  • Investigate and fix linkcheck failure

[plugin-breaking-change]

cc #35118

@rust-highfive

This comment has been minimized.

Show comment
Hide comment
@rust-highfive

rust-highfive Nov 20, 2016

Collaborator

r? @aturon

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

Collaborator

rust-highfive commented Nov 20, 2016

r? @aturon

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

//! The 128-bit signed integer type.
//!
//! *[See also the `i128` primitive type](../../std/primitive.i128.html).*

This comment has been minimized.

@frewsxcv

frewsxcv Nov 20, 2016

Member

This should maybe be:

[See also the `i128` primitive type](../primitive.i128.html)
@frewsxcv

frewsxcv Nov 20, 2016

Member

This should maybe be:

[See also the `i128` primitive type](../primitive.i128.html)

This comment has been minimized.

@est31

est31 Nov 20, 2016

Contributor

@frewsxcv I think this wouldn't work. The other integer primitive types link via ../../std/primitive.$name.html as well, and I can't see generated doc files for them in libcore.

@est31

est31 Nov 20, 2016

Contributor

@frewsxcv I think this wouldn't work. The other integer primitive types link via ../../std/primitive.$name.html as well, and I can't see generated doc files for them in libcore.

This comment has been minimized.

@ollie27

ollie27 Nov 20, 2016

Contributor

I think the problem is that the primitive.i128.html isn't being generated at all so changing this won't help.

@ollie27

ollie27 Nov 20, 2016

Contributor

I think the problem is that the primitive.i128.html isn't being generated at all so changing this won't help.

This comment has been minimized.

@est31

est31 Nov 20, 2016

Contributor

@ollie27 yes, that is consistent with my observations, I can find primitive.i64.html at the linked path, but none for i128.

@est31

est31 Nov 20, 2016

Contributor

@ollie27 yes, that is consistent with my observations, I can find primitive.i64.html at the linked path, but none for i128.

@ollie27

This comment has been minimized.

Show comment
Hide comment
@ollie27

ollie27 Nov 20, 2016

Contributor

Investigate and fix linkcheck failure:

By the looks of it the files won't be generated. You'll need to add entries to src/libstd/primitive_docs.rs and update rustdoc a bit more. At least here and here will need to be updated.

Contributor

ollie27 commented Nov 20, 2016

Investigate and fix linkcheck failure:

By the looks of it the files won't be generated. You'll need to add entries to src/libstd/primitive_docs.rs and update rustdoc a bit more. At least here and here will need to be updated.

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 21, 2016

Contributor

☔️ The latest upstream changes (presumably #37824) made this pull request unmergeable. Please resolve the merge conflicts.

Contributor

bors commented Nov 21, 2016

☔️ The latest upstream changes (presumably #37824) made this pull request unmergeable. Please resolve the merge conflicts.

@aturon

This comment has been minimized.

Show comment
Hide comment
Member

aturon commented Nov 22, 2016

@aturon aturon removed their assignment Nov 22, 2016

@est31

This comment has been minimized.

Show comment
Hide comment
@est31

est31 Nov 22, 2016

Contributor

Okay, running on 32 bit into a linker error of the form:

rust/src/librustc_const_math/int.rs:545: Nicht definierter Verweis auf `core::panicking::panic::hdb3be1030a0e450d'
rust/build/i686-unknown-linux-gnu/stage1-rustc/i686-unknown-linux-gnu/release/deps/rustc_const_math-fb45b0b7ff405aab.0.o: In Funktion `rustc_const_math::int::{{impl}}::rem':
rust/src/librustc_const_math/int.rs:577: Nicht definierter Verweis auf `core::panicking::panic::hdb3be1030a0e450d'
/tmp/rustc.8pXinEKP9SgF/libcompiler_builtins-83f89429e0eb597e.rlib(compiler_builtins-83f89429e0eb597e.0.o): In Funktion `compiler_builtins::reimpls::u128_div_mod':
rust/src/libcompiler_builtins/lib.rs:132: Nicht definierter Verweis auf `core::panicking::panic::hdb3be1030a0e450d'
collect2: error: ld returned 1 exit status

Apparently the __udivmodti4 intrinsic may panic. According to readelf, its the only one in the libcompiler_builtin library that calls panic. I've localized the error to the ashl and ashr macros inside the src/libcompiler_builtins/lib.rs file, and the error messages of the panics are "attempt to calculate the remainder with a divisor of zero" and "attempt to divide by zero" (found out with a very reliable and robust method involving a strings invocation and grepping for "rustc version" xD)...

I'm not sure whether or not I should panic here, and how to fix the linker issue if I should indeed panic.

Setting panic=abort for the libcompiler_builtin crate does not remove the panic invocations for some reason, nor the linker failure...

Contributor

est31 commented Nov 22, 2016

Okay, running on 32 bit into a linker error of the form:

rust/src/librustc_const_math/int.rs:545: Nicht definierter Verweis auf `core::panicking::panic::hdb3be1030a0e450d'
rust/build/i686-unknown-linux-gnu/stage1-rustc/i686-unknown-linux-gnu/release/deps/rustc_const_math-fb45b0b7ff405aab.0.o: In Funktion `rustc_const_math::int::{{impl}}::rem':
rust/src/librustc_const_math/int.rs:577: Nicht definierter Verweis auf `core::panicking::panic::hdb3be1030a0e450d'
/tmp/rustc.8pXinEKP9SgF/libcompiler_builtins-83f89429e0eb597e.rlib(compiler_builtins-83f89429e0eb597e.0.o): In Funktion `compiler_builtins::reimpls::u128_div_mod':
rust/src/libcompiler_builtins/lib.rs:132: Nicht definierter Verweis auf `core::panicking::panic::hdb3be1030a0e450d'
collect2: error: ld returned 1 exit status

Apparently the __udivmodti4 intrinsic may panic. According to readelf, its the only one in the libcompiler_builtin library that calls panic. I've localized the error to the ashl and ashr macros inside the src/libcompiler_builtins/lib.rs file, and the error messages of the panics are "attempt to calculate the remainder with a divisor of zero" and "attempt to divide by zero" (found out with a very reliable and robust method involving a strings invocation and grepping for "rustc version" xD)...

I'm not sure whether or not I should panic here, and how to fix the linker issue if I should indeed panic.

Setting panic=abort for the libcompiler_builtin crate does not remove the panic invocations for some reason, nor the linker failure...

@eddyb

This comment has been minimized.

Show comment
Hide comment
@eddyb

eddyb Nov 22, 2016

Member

@est31 -C panic=abort is a red herring, forget about it, it changes the runtime, not code generation. Sounds like all we have to do is either always compile libcompiler_builtins with -Z force-overflow-checks=off or explicitly use Wrapping and/or wrapping_add etc.

Member

eddyb commented Nov 22, 2016

@est31 -C panic=abort is a red herring, forget about it, it changes the runtime, not code generation. Sounds like all we have to do is either always compile libcompiler_builtins with -Z force-overflow-checks=off or explicitly use Wrapping and/or wrapping_add etc.

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 23, 2016

Contributor

☔️ The latest upstream changes (presumably #37487) made this pull request unmergeable. Please resolve the merge conflicts.

Contributor

bors commented Nov 23, 2016

☔️ The latest upstream changes (presumably #37487) made this pull request unmergeable. Please resolve the merge conflicts.

@mattico

This comment has been minimized.

Show comment
Hide comment
@mattico

mattico Nov 23, 2016

Contributor

The approach we've used so far in compiler-builtins is to use explicit wrapping operations everywhere. Given that we're mostly translating C code it may make sense to just use -Z force-overflow-checks=off.

Using the Wrapping type is annoying due to #23545 (see https://github.com/rust-lang/rust/blob/master/src/libcore/num/wrapping.rs#L103-L118), so if you want to use Wrapping everywhere you have to do things like x << y.0 as usize where x and y are both Wrapping(_).

cc @japaric

Contributor

mattico commented Nov 23, 2016

The approach we've used so far in compiler-builtins is to use explicit wrapping operations everywhere. Given that we're mostly translating C code it may make sense to just use -Z force-overflow-checks=off.

Using the Wrapping type is annoying due to #23545 (see https://github.com/rust-lang/rust/blob/master/src/libcore/num/wrapping.rs#L103-L118), so if you want to use Wrapping everywhere you have to do things like x << y.0 as usize where x and y are both Wrapping(_).

cc @japaric

@est31

This comment has been minimized.

Show comment
Hide comment
@est31

est31 Nov 23, 2016

Contributor

Progress update: I've been able to eliminate the linker errors by substituting the operations that could fail with unchecked_ versions of them. It makes sense as the C intrinsics do the same and we do the checking afterwards.

I've right now arrived at debugging the functionality of the actual intrinsics themselves... Right now the failure is with the i128 unit tests, when parsing the literals for very large integers, apparently it overflows which it shouldn't.

Contributor

est31 commented Nov 23, 2016

Progress update: I've been able to eliminate the linker errors by substituting the operations that could fail with unchecked_ versions of them. It makes sense as the C intrinsics do the same and we do the checking afterwards.

I've right now arrived at debugging the functionality of the actual intrinsics themselves... Right now the failure is with the i128 unit tests, when parsing the literals for very large integers, apparently it overflows which it shouldn't.

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 24, 2016

Contributor

☔️ The latest upstream changes (presumably #37890) made this pull request unmergeable. Please resolve the merge conflicts.

Contributor

bors commented Nov 24, 2016

☔️ The latest upstream changes (presumably #37890) made this pull request unmergeable. Please resolve the merge conflicts.

@est31 est31 changed the title from [WIP] i128 and u128 support to i128 and u128 support Nov 25, 2016

@est31

This comment has been minimized.

Show comment
Hide comment
@est31

est31 Nov 25, 2016

Contributor

Okay, the PR is ready for review. I've finished the work on intrinsics and wouldn't know of anything broken or which needs to be done. The tests succeed for both 64 bit and 32 bit platforms.

Contributor

est31 commented Nov 25, 2016

Okay, the PR is ready for review. I've finished the work on intrinsics and wouldn't know of anything broken or which needs to be done. The tests succeed for both 64 bit and 32 bit platforms.

@leonardo-m

This comment has been minimized.

Show comment
Hide comment
@leonardo-m

leonardo-m Nov 25, 2016

I am quite happy for the future availability of 128 bit numbers in Rust. The "mul_mod" operation is used by "pow_mod" (modular pow), that is sufficiently common:

fn mul_mod(a: u64, b: u64, m: u64) -> (u64, u64);
fn mul_mod(a: u128, b: u128, m: u128) -> (u128, u128);

If you have 128 bits you can perform the 64 bit mul_mod using 128 bit values, but it's more efficient to use the "divq" instruction and work on 64 bit values. And you can probably perform the 128 bit mul_mod more efficiently without 256 bit numbers.

Are you going to support those mul_mod (or something similar), or should this enhancement request be moved elsewhere?

leonardo-m commented Nov 25, 2016

I am quite happy for the future availability of 128 bit numbers in Rust. The "mul_mod" operation is used by "pow_mod" (modular pow), that is sufficiently common:

fn mul_mod(a: u64, b: u64, m: u64) -> (u64, u64);
fn mul_mod(a: u128, b: u128, m: u128) -> (u128, u128);

If you have 128 bits you can perform the 64 bit mul_mod using 128 bit values, but it's more efficient to use the "divq" instruction and work on 64 bit values. And you can probably perform the 128 bit mul_mod more efficiently without 256 bit numbers.

Are you going to support those mul_mod (or something similar), or should this enhancement request be moved elsewhere?

@est31

This comment has been minimized.

Show comment
Hide comment
@est31

est31 Nov 25, 2016

Contributor

@leonardo-m I think providing modular pow is outside of the scope of this PR. Feel free to open an issue or RFC at https://github.com/rust-lang/rfcs . Also, you might be interested in https://github.com/rust-num/num

Contributor

est31 commented Nov 25, 2016

@leonardo-m I think providing modular pow is outside of the scope of this PR. Feel free to open an issue or RFC at https://github.com/rust-lang/rfcs . Also, you might be interested in https://github.com/rust-num/num

@leonardo-m

This comment has been minimized.

Show comment
Hide comment
@leonardo-m

leonardo-m Nov 25, 2016

My suggestion was about mul_mod (not about pow_mod), and I think it needs a low-level implementation with intrinsics or asm to be efficient. I'll probably open an issue here.

leonardo-m commented Nov 25, 2016

My suggestion was about mul_mod (not about pow_mod), and I think it needs a low-level implementation with intrinsics or asm to be efficient. I'll probably open an issue here.

@alexcrichton

This comment has been minimized.

Show comment
Hide comment
@alexcrichton

alexcrichton Nov 25, 2016

Member

r? @eddyb (feel free to transfer)

Member

alexcrichton commented Nov 25, 2016

r? @eddyb (feel free to transfer)

@eddyb

This comment has been minimized.

Show comment
Hide comment
@eddyb

eddyb Nov 27, 2016

Member

Started crater run.

Member

eddyb commented Nov 27, 2016

Started crater run.

@eddyb

LGTM, only 2 minor nits. I assume FIXMEs are left for later.

Show outdated Hide outdated src/libcore/fmt/num.rs
});
let const_err = common::const_to_opt_u128(len, false)
.and_then(|len| common::const_to_opt_u128(index, false)
.map(|index| ErrKind::IndexOutOfBounds {

This comment has been minimized.

@eddyb

eddyb Nov 28, 2016

Member

IndexOutOfBounds should've been updated to u128.

@eddyb

eddyb Nov 28, 2016

Member

IndexOutOfBounds should've been updated to u128.

This comment has been minimized.

@nagisa

nagisa Nov 28, 2016

Contributor

Currently we do not have any platform that supports isize larger than i64 so its not really important. Would be good to add a FIXME, though.

@nagisa

nagisa Nov 28, 2016

Contributor

Currently we do not have any platform that supports isize larger than i64 so its not really important. Would be good to add a FIXME, though.

This comment has been minimized.

@est31

est31 Nov 28, 2016

Contributor

The index is assured by typecheck to be usize and therefore can't exceed the range of 64 bits, can it? Would it be an idea to re-add const_to_opt_uint for cases like this and the one you mentioned above?

@est31

est31 Nov 28, 2016

Contributor

The index is assured by typecheck to be usize and therefore can't exceed the range of 64 bits, can it? Would it be an idea to re-add const_to_opt_uint for cases like this and the one you mentioned above?

This comment has been minimized.

@est31

est31 Nov 28, 2016

Contributor

Hmm, the function was removed because it would cause bad behaviour in cross compilation situations...

I guess I'll add a const_to_opt_u64 function instead, as there are no 128 bit targets nor hosts neither in existence nor on the horizon.

@est31

est31 Nov 28, 2016

Contributor

Hmm, the function was removed because it would cause bad behaviour in cross compilation situations...

I guess I'll add a const_to_opt_u64 function instead, as there are no 128 bit targets nor hosts neither in existence nor on the horizon.

This comment has been minimized.

@eddyb

eddyb Nov 28, 2016

Member

Oh, the assumption that pointers are always 64-bit or less is interesting (but not explicit?). The code is fine as-is in that case.

@eddyb

eddyb Nov 28, 2016

Member

Oh, the assumption that pointers are always 64-bit or less is interesting (but not explicit?). The code is fine as-is in that case.

@@ -281,7 +281,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
mir::TerminatorKind::Assert { ref cond, expected, ref msg, target, cleanup } => {
let cond = self.trans_operand(&bcx, cond).immediate();
let mut const_cond = common::const_to_opt_uint(cond).map(|c| c == 1);
let mut const_cond = common::const_to_opt_u128(cond, false).map(|c| c == 1);

This comment has been minimized.

@eddyb

eddyb Nov 28, 2016

Member

Heh, this only wants one bit (cond has type i1). Not sure if there's a nicer way to do this though.

@eddyb

eddyb Nov 28, 2016

Member

Heh, this only wants one bit (cond has type i1). Not sure if there's a nicer way to do this though.

This comment has been minimized.

@est31

est31 Nov 28, 2016

Contributor

There is none without re-adding const_to_opt_uint and you agreed on IRC that that shouldn't be done.

@est31

est31 Nov 28, 2016

Contributor

There is none without re-adding const_to_opt_uint and you agreed on IRC that that shouldn't be done.

@est31

This comment has been minimized.

Show comment
Hide comment
@est31

est31 Nov 30, 2016

Contributor

rebased. ping @eddyb

Contributor

est31 commented Nov 30, 2016

rebased. ping @eddyb

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 30, 2016

Contributor

☔️ The latest upstream changes (presumably #38014) made this pull request unmergeable. Please resolve the merge conflicts.

Contributor

bors commented Nov 30, 2016

☔️ The latest upstream changes (presumably #38014) made this pull request unmergeable. Please resolve the merge conflicts.

@brson

This comment has been minimized.

Show comment
Hide comment
@brson

brson Nov 30, 2016

Contributor

Crater's been having a hard time lately. Latest run failed again. I'm trying again.

Contributor

brson commented Nov 30, 2016

Crater's been having a hard time lately. Latest run failed again. I'm trying again.

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Nov 30, 2016

Contributor

☔️ The latest upstream changes (presumably #37800) made this pull request unmergeable. Please resolve the merge conflicts.

Contributor

bors commented Nov 30, 2016

☔️ The latest upstream changes (presumably #37800) made this pull request unmergeable. Please resolve the merge conflicts.

@est31

This comment has been minimized.

Show comment
Hide comment
@est31

est31 Dec 1, 2016

Contributor

Seems I'm running into a problem here...

When attempting to rebase this PR from basing on 5a02480 to base on dc81742 (compare changes), I can't bootstrap it anymore.

The error I'm running into (note its with stage0 still used as compiler so its not fault of this PR!) seems like a genuine zombie issue, a revival of issue #37686. Its fix (commit 84239df) is only present on the master branch, but not on the beta branch (at least not on the beta branch of commit d4aea2d on which the new bootstrap compiler as of #37800 bases on).

I'd like to hear your opinions on how to resolve this issue. I'm almost certain that other PRs in the future will run into this problem as well.

Contributor

est31 commented Dec 1, 2016

Seems I'm running into a problem here...

When attempting to rebase this PR from basing on 5a02480 to base on dc81742 (compare changes), I can't bootstrap it anymore.

The error I'm running into (note its with stage0 still used as compiler so its not fault of this PR!) seems like a genuine zombie issue, a revival of issue #37686. Its fix (commit 84239df) is only present on the master branch, but not on the beta branch (at least not on the beta branch of commit d4aea2d on which the new bootstrap compiler as of #37800 bases on).

I'd like to hear your opinions on how to resolve this issue. I'm almost certain that other PRs in the future will run into this problem as well.

@est31

This comment has been minimized.

Show comment
Hide comment
@est31

est31 Dec 1, 2016

Contributor

Note: you can reproduce the issue on current master by doing ./x.py test --stage 0 src/test/run-pass --test-args 37686.

Contributor

est31 commented Dec 1, 2016

Note: you can reproduce the issue on current master by doing ./x.py test --stage 0 src/test/run-pass --test-args 37686.

@est31

This comment has been minimized.

Show comment
Hide comment
@est31

est31 Dec 1, 2016

Contributor

Okay, figured out how to workaround the issue, see the last commit. So its not required anymore for this PR to get stage0 updated.

Contributor

est31 commented Dec 1, 2016

Okay, figured out how to workaround the issue, see the last commit. So its not required anymore for this PR to get stage0 updated.

@brson

This comment has been minimized.

Show comment
Hide comment
@brson

brson Dec 1, 2016

Contributor

Still working on crater.

Contributor

brson commented Dec 1, 2016

Still working on crater.

@brson

This comment has been minimized.

Show comment
Hide comment
@brson

brson Dec 2, 2016

Contributor

My crater run failed because nightly cargo is broken. I think we have to wait until nightly cargo works again.

Contributor

brson commented Dec 2, 2016

My crater run failed because nightly cargo is broken. I think we have to wait until nightly cargo works again.

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Dec 3, 2016

Contributor

☔️ The latest upstream changes (presumably #38055) made this pull request unmergeable. Please resolve the merge conflicts.

Contributor

bors commented Dec 3, 2016

☔️ The latest upstream changes (presumably #38055) made this pull request unmergeable. Please resolve the merge conflicts.

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Dec 3, 2016

Contributor

☔️ The latest upstream changes (presumably #38079) made this pull request unmergeable. Please resolve the merge conflicts.

Contributor

bors commented Dec 3, 2016

☔️ The latest upstream changes (presumably #38079) made this pull request unmergeable. Please resolve the merge conflicts.

@eddyb

This comment has been minimized.

Show comment
Hide comment
@eddyb

eddyb Dec 4, 2016

Member

Crater report shows a single regression (from changing the AST).

@bors r+

Member

eddyb commented Dec 4, 2016

Crater report shows a single regression (from changing the AST).

@bors r+

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Dec 4, 2016

Contributor

📌 Commit f60a7c2 has been approved by eddyb

Contributor

bors commented Dec 4, 2016

📌 Commit f60a7c2 has been approved by eddyb

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Dec 4, 2016

Contributor

⌛️ Testing commit f60a7c2 with merge e618fe0...

Contributor

bors commented Dec 4, 2016

⌛️ Testing commit f60a7c2 with merge e618fe0...

nagisa and others added some commits Sep 27, 2016

Fix rebase fallout
This commit includes manual merge conflict resolution changes from a rebase by @est31.
Use LLVMRustConstInt128Get on stage1 too
llvm::LLVMConstIntGetZExtValue doesn't accept values with more than 64 bits.

This fixes an LLVM assertion error when compiling libcore with stage1:

src/llvm/include/llvm/ADT/APInt.h:1336:
	uint64_t llvm::APInt::getZExtValue() const:
		Assertion `getActiveBits() <= 64 && "Too many bits for uint64_t"' failed.
Make rustdoc aware of the primitive i128 type
Many thanks to ollie27 for spotting all the places.
40 -> 39, as ceil(log10(2^128)) == 39
just as ceil(log10(2^64)) == 20
UGLY hack around an ICE bc of stage0
Current stage0 with version "1.14.0-beta.1 (d4aea2d 2016-11-15)"
suffers from issue 37686. You can confirm this on master by running

./x.py test --stage 0 src/test/run-pass --test-args 37686

Add this workaround until there is a fix. No idea how it works,
but it does work.
Always use Rust based intrinsics on Windows
The check inside compiler-rt file int_types.h to #define CRT_HAS_128BIT
looks like:

 #if (defined(__LP64__) || defined(__wasm__)) && \
     !(defined(__mips__) && defined(__clang__))
 #define CRT_HAS_128BIT
 #endif

Windows uses LLP64 instead of LP64, so it doesn't ship with the C based
intrinsics.

Also, add libcompiler_builtins to the list of crates that may have platform
specific checks (like the ones we just added).
Try to fix some things
* shift so that no panics are generated (otherwise results in linker error)
* no_std as insurance to not get into issues with errors like "cannot satisfy dependencies so `rustc_i128` only shows up once" (pure guessing here, but it doesn't hurt...)
libcompiler_builtins: don't codegen dead code call to eh_personality
There was a linker error on 32 bit platforms with optimisations turned off,
complaining that there was an undefined reference to "rust_eh_personality",
when compiling the rustc_const_math as stage1 artifact.

Apparently the compiler_builtins crate includes a call to "rust_eh_personality".
If compiled for 64 bits, this call doesn't appear, which explains why the linker
error only happens on 32 bit platforms, and optimisations will get it removed
on 32 bit as well.

There were two origins of the call:
    1. A for loop where apparently the compiler wasn't sure
       whether next() could panic or not, and therefore generated a landing
       pad for the worst case. The minimal reproducible example is "for _ in 0..sr { }".
    2. A default impl of uabs where the compiler apparently wasn't sure either
       whether iabs() could panic or not. Many thanks to nagisa for
       contributing the fix.

This commit also puts extern "C" to the intrinsics, as this is generally a
good thing to do.
Port to wrapping_* and unchecked_* operations
Otherwise, we codegen panic calls which create problems with debug assertions turned on.
Fix another windows ABI mistake
...this time with the float intrinsics.
@est31

This comment has been minimized.

Show comment
Hide comment
@est31

est31 Dec 15, 2016

Contributor

Rebased. r? @eddyb

Contributor

est31 commented Dec 15, 2016

Rebased. r? @eddyb

@leonardo-m

This comment has been minimized.

Show comment
Hide comment
@leonardo-m

leonardo-m Dec 15, 2016

Keep going! :-)

leonardo-m commented Dec 15, 2016

Keep going! :-)

@est31

This comment has been minimized.

Show comment
Hide comment
@est31

est31 Dec 15, 2016

Contributor

Release is close, and this may cause regressions. It'd be better to have it at the start of a release period, not that it gets reverted before release because of the regressions it caused. Gonna reopen once the release is over.

Contributor

est31 commented Dec 15, 2016

Release is close, and this may cause regressions. It'd be better to have it at the start of a release period, not that it gets reverted before release because of the regressions it caused. Gonna reopen once the release is over.

@est31 est31 closed this Dec 15, 2016

@est31 est31 referenced this pull request Dec 20, 2016

Merged

i128 and u128 support #38482

@est31

This comment has been minimized.

Show comment
Hide comment
@est31

est31 Dec 20, 2016

Contributor

See #38482 for the continuation

Contributor

est31 commented Dec 20, 2016

See #38482 for the continuation

@DirkyJerky

This comment has been minimized.

Show comment
Hide comment
@DirkyJerky

DirkyJerky Dec 20, 2016

Contributor

And #37900 was such a rememberable number too 😢

Contributor

DirkyJerky commented Dec 20, 2016

And #37900 was such a rememberable number too 😢

bors added a commit that referenced this pull request Dec 20, 2016

Auto merge of #38482 - est31:i128, r=eddyb
i128 and u128 support

Brings i128 and u128 support to nightly rust, behind a feature flag. The goal of this PR is to do the bulk of the work for 128 bit integer support. Smaller but just as tricky features needed for stabilisation like 128 bit enum discriminants are left for future PRs.

Rebased version of  #37900, which in turn was a rebase + improvement of #35954 . Sadly I couldn't reopen #37900 due to github. There goes my premium position in the homu queue...

[plugin-breaking-change]

cc #35118 (tracking issue)

bors added a commit that referenced this pull request Dec 21, 2016

Auto merge of #38482 - est31:i128, r=eddyb
i128 and u128 support

Brings i128 and u128 support to nightly rust, behind a feature flag. The goal of this PR is to do the bulk of the work for 128 bit integer support. Smaller but just as tricky features needed for stabilisation like 128 bit enum discriminants are left for future PRs.

Rebased version of  #37900, which in turn was a rebase + improvement of #35954 . Sadly I couldn't reopen #37900 due to github. There goes my premium position in the homu queue...

[plugin-breaking-change]

cc #35118 (tracking issue)

bors added a commit that referenced this pull request Dec 21, 2016

Auto merge of #38482 - est31:i128, r=eddyb
i128 and u128 support

Brings i128 and u128 support to nightly rust, behind a feature flag. The goal of this PR is to do the bulk of the work for 128 bit integer support. Smaller but just as tricky features needed for stabilisation like 128 bit enum discriminants are left for future PRs.

Rebased version of  #37900, which in turn was a rebase + improvement of #35954 . Sadly I couldn't reopen #37900 due to github. There goes my premium position in the homu queue...

[plugin-breaking-change]

cc #35118 (tracking issue)

bors added a commit that referenced this pull request Dec 30, 2016

Auto merge of #38482 - est31:i128, r=eddyb
i128 and u128 support

Brings i128 and u128 support to nightly rust, behind a feature flag. The goal of this PR is to do the bulk of the work for 128 bit integer support. Smaller but just as tricky features needed for stabilisation like 128 bit enum discriminants are left for future PRs.

Rebased version of  #37900, which in turn was a rebase + improvement of #35954 . Sadly I couldn't reopen #37900 due to github. There goes my premium position in the homu queue...

[plugin-breaking-change]

cc #35118 (tracking issue)

bors added a commit that referenced this pull request Dec 30, 2016

Auto merge of #38482 - est31:i128, r=eddyb
i128 and u128 support

Brings i128 and u128 support to nightly rust, behind a feature flag. The goal of this PR is to do the bulk of the work for 128 bit integer support. Smaller but just as tricky features needed for stabilisation like 128 bit enum discriminants are left for future PRs.

Rebased version of  #37900, which in turn was a rebase + improvement of #35954 . Sadly I couldn't reopen #37900 due to github. There goes my premium position in the homu queue...

[plugin-breaking-change]

cc #35118 (tracking issue)

bors added a commit that referenced this pull request Dec 31, 2016

Auto merge of #38482 - est31:i128, r=eddyb
i128 and u128 support

Brings i128 and u128 support to nightly rust, behind a feature flag. The goal of this PR is to do the bulk of the work for 128 bit integer support. Smaller but just as tricky features needed for stabilisation like 128 bit enum discriminants are left for future PRs.

Rebased version of  #37900, which in turn was a rebase + improvement of #35954 . Sadly I couldn't reopen #37900 due to github. There goes my premium position in the homu queue...

[plugin-breaking-change]

cc #35118 (tracking issue)

bors added a commit that referenced this pull request Dec 31, 2016

Auto merge of #38482 - est31:i128, r=eddyb
i128 and u128 support

Brings i128 and u128 support to nightly rust, behind a feature flag. The goal of this PR is to do the bulk of the work for 128 bit integer support. Smaller but just as tricky features needed for stabilisation like 128 bit enum discriminants are left for future PRs.

Rebased version of  #37900, which in turn was a rebase + improvement of #35954 . Sadly I couldn't reopen #37900 due to github. There goes my premium position in the homu queue...

[plugin-breaking-change]

cc #35118 (tracking issue)

bors added a commit that referenced this pull request Dec 31, 2016

Auto merge of #38482 - est31:i128, r=eddyb
i128 and u128 support

Brings i128 and u128 support to nightly rust, behind a feature flag. The goal of this PR is to do the bulk of the work for 128 bit integer support. Smaller but just as tricky features needed for stabilisation like 128 bit enum discriminants are left for future PRs.

Rebased version of  #37900, which in turn was a rebase + improvement of #35954 . Sadly I couldn't reopen #37900 due to github. There goes my premium position in the homu queue...

[plugin-breaking-change]

cc #35118 (tracking issue)

@joewalker joewalker referenced this pull request Jan 9, 2017

Closed

Add a basic EDN parser #149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment